24 |
rodolico |
1 |
### Installation
|
|
|
2 |
|
|
|
3 |
havirt can be installed on any node, or on a completely separate machine. If
|
|
|
4 |
installed on multiple nodes, it can be safely be run simultaneously on multiple
|
|
|
5 |
nodes as file locking is enabled on any code which writes to /var
|
|
|
6 |
|
|
|
7 |
You need shared storage if havirt will run on multiple nodes, and havirt
|
|
|
8 |
should be installed in that storage. The shared space is assumed to be
|
|
|
9 |
mounted a the same location on all nodes. havirt will store temporary files in
|
|
|
10 |
it's install or install/var directory which allows a process on one node to
|
|
|
11 |
respect a running process on another. In our implementation, we have an nfs
|
|
|
12 |
mount at /media/shared/havirt. File locking is required on the shared
|
|
|
13 |
storage.
|
|
|
14 |
|
|
|
15 |
There is no fancy installer. Simply grab the files via subversion.
|
|
|
16 |
|
|
|
17 |
svn co http://svn.dailydata.net/svn/havirt/stable /path/to/install
|
|
|
18 |
ln -s /path/to/install/havirt /usr/local/bin/havirt
|
|
|
19 |
|
|
|
20 |
If you use the same setup we use, where havirt is to be stored in
|
|
|
21 |
/media/shared, the commands are:
|
|
|
22 |
|
|
|
23 |
svn co http://svn.dailydata.net/svn/havirt/stable /media/shared/havirt
|
|
|
24 |
ln -s /media/shared/havirt/havirt /usr/local/bin/havirt
|
|
|
25 |
|
|
|
26 |
Some Perl modules are needed.
|
|
|
27 |
- Exporter
|
|
|
28 |
- Getopt::Long
|
|
|
29 |
- version
|
|
|
30 |
- YAML::Tiny
|
|
|
31 |
- Data::Dumper
|
|
|
32 |
|
|
|
33 |
Most may be on your system already, but you can run the following command on
|
|
|
34 |
Debian based systems to add the ones not in the base install.
|
|
|
35 |
|
|
|
36 |
apt install -y libdata-dump-perl libyaml-tiny-perl
|
|
|
37 |
|
|
|
38 |
### Setup
|
|
|
39 |
|
|
|
40 |
Ensure all nodes can talk to each other (including themselves) via public
|
|
|
41 |
key encryption (no password). If havirt is on a separate machine, it
|
|
|
42 |
must be able to talk to all nodes. To do this, on each node which will be
|
|
|
43 |
managed by havirt, run the following command as root
|
|
|
44 |
|
|
|
45 |
ssh-keygen -t rsa -b 4096
|
|
|
46 |
|
|
|
47 |
When asked for a passphrase, just press the Enter key for no passphrase.
|
|
|
48 |
|
|
|
49 |
Now, on each machine, grab the public key for the generated keys.
|
|
|
50 |
|
|
|
51 |
cat /root/.ssh/rsa.pub >> /media/shared/havirt/sshkeys
|
|
|
52 |
|
|
|
53 |
This will build the file /media/shared/havirt/sshkeys with all of the keys.
|
|
|
54 |
|
|
|
55 |
Finally, on each machine
|
|
|
56 |
|
|
|
57 |
cp /media/shared/havirt/sshkeys /root/.ssh/authorized_keys
|
|
|
58 |
chown root:root /root/.ssh/authorized_keys
|
|
|
59 |
chmod 600 /root/.ssh/authorized_keys
|
|
|
60 |
|
|
|
61 |
Each should be able to talk to the other. I generally create a
|
|
|
62 |
/root/.ssh/config which contains aliases for simplicity.
|
|
|
63 |
|
|
|
64 |
Once you are sure all of your nodes can talk to each other, run the following
|
|
|
65 |
command for each node.
|
|
|
66 |
|
|
|
67 |
havirt node add NAMEOFNODE
|
|
|
68 |
|
|
|
69 |
where NAMEOFNODE is accessible either via DNS or an ssh alias.
|
|
|
70 |
|
|
|
71 |
When all nodes are added, you can list them with
|
|
|
72 |
|
|
|
73 |
havirt node list -t tsv
|
|
|
74 |
|
|
|
75 |
which will dump a tab delimited text file to STDOUT.
|
|
|
76 |
|
|
|
77 |
Now it is time to populate all of the domains currently running
|
|
|
78 |
|
|
|
79 |
havirt node scan # scan all nodes for running domains
|
|
|
80 |
havirt domain update # get conf for all domains and store in conf/
|
|
|
81 |
havirt domain list # show all domains
|
|
|
82 |
|
|
|
83 |
Note: domain list will not show nodes which have no domains on them.
|