Subversion Repositories havirt

Rev

Rev 13 | Rev 24 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13 Rev 23
Line -... Line 1...
-
 
1
# havirt
-
 
2
 
1
Script to macro manage cluster of nodes (hypervisors) and the domains
3
### Script to macro manage cluster of nodes (hypervisors) and the domains
2
(virtuals) on them.
4
(virtuals) on them.
3
 
5
 
4
Used as an extension to virsh, which it calls quite often.
6
Used as an extension to virsh, which it calls quite often.
5
 
7
 
6
All nodes must be able to make an ssh connection to all other nodes using 
8
All nodes must be able to make an ssh connection to all other nodes using 
Line 15... Line 17...
15
acquired using virsh dumpxml.
17
acquired using virsh dumpxml.
16
 
18
 
17
var/ contains YAML representations of Perl hashes which contains information
19
var/ contains YAML representations of Perl hashes which contains information
18
about nodes, domains and the relationship between them.
20
about nodes, domains and the relationship between them.
19
 
21
 
20
===== NOT IMPLEMENTED YET =====
22
### NOT IMPLEMENTED YET
-
 
23
 
21
havirt can be installed on any node, or on a completely separate machine. If
24
havirt can be installed on any node, or on a completely separate machine. If
22
installed on multiple nodes, it can be safely be run simultaneously on multiple
25
installed on multiple nodes, it can be safely be run simultaneously on multiple
23
nodes as file locking is enabled on any code which writes to /var
26
nodes as file locking is enabled on any code which writes to /var
24
 
27
 
25
=== Installation
28
### Installation
26
 
29
 
27
There is no fancy installer. Simply grab the files via subversion.
30
There is no fancy installer. Simply grab the files via subversion.
28
 
31
 
29
svn co http://svn.dailydata.net/svn/havirt/stable /path/to/install
32
    svn co http://svn.dailydata.net/svn/havirt/stable /path/to/install
30
ln -s /path/to/install/havirt /usr/local/bin/havirt
33
    ln -s /path/to/install/havirt /usr/local/bin/havirt
31
 
34
 
32
Some Perl modules are needed. 
35
Some Perl modules are needed. 
33
Exporter
36
- Exporter
34
Getopt::Long
37
- Getopt::Long
35
version
38
- version
36
YAML::Tiny
39
- YAML::Tiny
37
Data::Dumper
40
- Data::Dumper
38
 
41
 
39
Most may be on your system already, but you can run the following command on
42
Most may be on your system already, but you can run the following command on
40
Debian based systems to add the ones not in the base install.
43
Debian based systems to add the ones not in the base install.
41
 
44
 
42
apt install -y libdata-dump-perl libyaml-tiny-perl
45
    apt install -y libdata-dump-perl libyaml-tiny-perl
43
 
46
 
44
=== Setup
47
###  Setup
45
 
48
 
46
Ensure all nodes can talk to each other (including themselves) via public
49
Ensure all nodes can talk to each other (including themselves) via public
47
key encryption (no password). If havirt is on a separate machine, it
50
key encryption (no password). If havirt is on a separate machine, it
48
must be able to talk to all nodes.
51
must be able to talk to all nodes.
49
 
52
 
Line 51... Line 54...
51
/root/.ssh/config which contains aliases for simplicity.
54
/root/.ssh/config which contains aliases for simplicity.
52
 
55
 
53
Once you are sure all of your nodes can talk to each other, run the following
56
Once you are sure all of your nodes can talk to each other, run the following
54
command for each node.
57
command for each node.
55
 
58
 
56
havirt node add NAMEOFNODE
59
    havirt node add NAMEOFNODE
57
 
60
 
58
where NAMEOFNODE is accessible either via DNS or an ssh alias.
61
where NAMEOFNODE is accessible either via DNS or an ssh alias.
59
 
62
 
60
When all nodes are added, you can list them with
63
When all nodes are added, you can list them with
61
 
64
 
62
havirt node list -t tsv
65
    havirt node list -t tsv
63
 
66
 
64
which will dump a tab delimited text file to STDOUT.
67
which will dump a tab delimited text file to STDOUT.
65
 
68
 
66
Now it is time to populate all of the domains currently running
69
Now it is time to populate all of the domains currently running
67
 
70
 
68
havirt node scan # scan all nodes for running domains
71
    havirt node scan # scan all nodes for running domains
69
havirt domain update # get conf for all domains and store in conf/
72
    havirt domain update # get conf for all domains and store in conf/
70
havirt domain list # show all domains
73
    havirt domain list # show all domains
71
 
74
 
72
Note: domain list will not show nodes which have no domains on them.
75
Note: domain list will not show nodes which have no domains on them.