bbd7be1ef886852ab6511df01fccbe1e5b7dd401
[mclu.git] / CONFIGURATION
1 Configuring mclu
2 ----------------
3
4 Introduction
5 ------------
6
7 mclu is based around the idea that you have a small collection of
8 fairly similar "nodes".  Ideally they would be identical nodes, if you
9 want live migration to work seamlessly, but they don't have to be.
10
11 Here is a picture of the cluster that I run mclu on:
12 http://rwmj.wordpress.com/2014/04/28/caseless-virtualization-cluster-part-5/#content
13
14 Nodes, control node, NFS server
15 -------------------------------
16
17 There is also one "control" node, which could be your laptop or could
18 be one of the cluster nodes.  This is where you run the 'mclu'
19 command, and also where the single configuration file is located
20 (mclu.conf, usually located in /etc/mclu).
21
22 Each node must be accessible from the control node over ssh.  Each
23 node must be running the libvirt daemon (libvirtd).
24
25 mclu uses a mix of ssh commands and remote libvirt to manage the
26 nodes.  You should configure ssh so it can access the nodes without
27 needing passwords (eg. using ssh-agent).  If you use the default
28 libvirt URI (see config file) then you also need to set up
29 passwordless root ssh access to the nodes; there are other ways to
30 configure this, eg. opening the libvirtd port on each node, but they
31 are probably not as secure.
32
33 Each node, including the control node, must have access to shared
34 storage where the guest disk images are stored.  The easiest way to do
35 this is to export /var/lib/libvirt/images from one machine and
36 NFS-mount it on all the nodes (and also to have a nice fast network).
37 Cluster filesystems are another possibility.  mclu does NOT support
38 non-shared storage nor storage migration.
39
40 Wake-on-LAN
41 -----------
42
43 The nodes can be up or down.  mclu deals transparently with nodes
44 being switched off.  If you configure wake-on-LAN (usually a BIOS
45 setting) then mclu will be able to wake up nodes.
46
47 Running guests
48 --------------
49
50 The guest libvirt XML files are also stored on the control node
51 (usually /etc/mclu/xmls).  Guests are created as transient, which
52 means the libvirt daemon running on each node does not have a
53 persistent configuration of any guest.
54
55 Guests run on a single node at a time.  You can list/start/stop/
56 migrate them using mclu.  The requirement for a guest to be running on
57 a single node may be enforced if you run libvirt sanlock or virtlockd.
58 This requires further configuration, see:
59 http://libvirt.org/locking.html
60 https://rwmj.wordpress.com/2014/05/08/setting-up-virtlockd-on-nfs/#content
61
62 If sanlock/virtlockd is not running then mclu will try its best not to
63 have the guest running in two places at once (if it happens, this will
64 cause permanent disk corruption in the guest).
65
66 Migration
67 ---------
68
69 For guest live migration to work transparently, you will probably want
70 to configure libvirt bridged networking and open firewall ports
71 49152-49215 on every node.
72
73 Bridged networking means that each guest appears as a local machine on
74 your network, and if it migrates then network connections will not be
75 interrupted.  See:
76 http://wiki.libvirt.org/page/Networking#Bridged_networking_.28aka_.22shared_physical_device.22.29
77
78 The firewall ports have to be opened because libvirt cannot (yet?)  do
79 fully managed migration over two SSH connections (even though the
80 documentation says it can).  Hopefully they will fix this soon.
81
82 Editing guest configuration or disk images
83 ------------------------------------------
84
85 The guest configuration (libvirt XML) is stored in the xmls directory
86 (usually /etc/mclu/xmls).  You can edit this file directly if you want.
87 Changes will not take effect until the guest is restarted.
88
89 The guest disk images are located in the images directory (usually
90 /var/lib/libvirt/images).  You can use libguestfs against these in
91 read-only mode (or read-write mode PROVIDED the guest is not running).
92
93 You can also create or import guests by dropping an XML file and an
94 image into those directories.  (But it might be easier to use the
95 'mclu build' and 'mclu import' subcommands).