23 |
rodolico |
1 |
# havirt
|
|
|
2 |
|
|
|
3 |
### Script to macro manage cluster of nodes (hypervisors) and the domains
|
24 |
rodolico |
4 |
(virtuals) on them. Used as an extension to virsh, which it calls quite often.
|
9 |
rodolico |
5 |
|
|
|
6 |
All nodes must be able to make an ssh connection to all other nodes using
|
|
|
7 |
public key (no passwords). Note that this includes being able to make an ssh
|
|
|
8 |
connection to itself as, at this time, it simply makes an ssh connection to
|
24 |
rodolico |
9 |
whatever node is defined.
|
9 |
rodolico |
10 |
|
24 |
rodolico |
11 |
Very similar to virsh (on purpose); just adds some protection against
|
|
|
12 |
running domains on multiple nodes, allowing monitoring, etc... Samples are:
|
9 |
rodolico |
13 |
|
24 |
rodolico |
14 |
virsh start domainname # virsh way
|
|
|
15 |
havirt domain start domainname nodename
|
9 |
rodolico |
16 |
|
24 |
rodolico |
17 |
These will both start domainname. The virsh command will start it on the
|
|
|
18 |
node you are currently logged into. The havirt command will first verify
|
25 |
rodolico |
19 |
domainname is not running on any node, verify the target node has enough
|
|
|
20 |
resources, then start it on nodename (or the current node, if nodename not
|
|
|
21 |
specified) and modify it's state file to reflect the status change.
|
9 |
rodolico |
22 |
|
24 |
rodolico |
23 |
The other difference is that the virsh command uses the configuration
|
|
|
24 |
domainname.xml stored in /etc/virtlib/qemu, while havirt does a 'virsh
|
|
|
25 |
create' using the domainname.xml stored in installdir/conf.
|
23 |
rodolico |
26 |
|
24 |
rodolico |
27 |
By default, havirt will simply emit the command it will normally run. If the
|
|
|
28 |
--yes (-y) flag is passed, it will execute the command for you.
|
9 |
rodolico |
29 |
|
24 |
rodolico |
30 |
havirt creates two subdirectories, installdir/conf/ and installdir/var/ if
|
|
|
31 |
they don't exist. conf/ stores the xml configuration of all domains, while
|
|
|
32 |
var/ stores the state file (yaml) and some temporary files.
|
9 |
rodolico |
33 |
|
25 |
rodolico |
34 |
havirt also creates a configuration file (config.yaml) in the executables
|
|
|
35 |
directory. This allows you to modify the default behaviour of the program
|
|
|
36 |
more easily. See config.sample.yaml if you want to manually create it,
|
|
|
37 |
or for documentation on what can be modified.
|