Subversion Repositories havirt

Rev

Rev 13 | Rev 24 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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