Script to macro manage cluster of nodes (hypervisors) and the domains (virtuals) on them. Used as an extension to virsh, which it calls quite often. All nodes must be able to make an ssh connection to all other nodes using public key (no passwords). Note that this includes being able to make an ssh connection to itself as, at this time, it simply makes an ssh connection to whatever node is defined over. There are two subdirectories, conf/ and var/. conf/ is NOT what you think; the app does not have a static configuration. conf/ contains domain (virtual) configurations in an XML format. They are acquired using virsh dumpxml. var/ contains YAML representations of Perl hashes which contains information about nodes, domains and the relationship between them. ===== NOT IMPLEMENTED YET ===== havirt can be installed on any node, or on a completely separate machine. If installed on multiple nodes, it can be safely be run simultaneously on multiple nodes as file locking is enabled on any code which writes to /var === Installation There is no fancy installer. Simply grab the files via subversion. svn co http://svn.dailydata.net/svn/havirt/stable /path/to/install ln -s /path/to/install/havirt /usr/local/bin/havirt Some Perl modules are needed. Exporter Getopt::Long version YAML::Tiny Data::Dumper Most may be on your system already, but you can run the following command on Debian based systems to add the ones not in the base install. apt install -y libdata-dump-perl libyaml-tiny-perl === Setup Ensure all nodes can talk to each other (including themselves) via public key encryption (no password). If havirt is on a separate machine, it must be able to talk to all nodes. Each should be able to talk to the other. I generally create a /root/.ssh/config which contains aliases for simplicity. Once you are sure all of your nodes can talk to each other, run the following command for each node. havirt node add NAMEOFNODE where NAMEOFNODE is accessible either via DNS or an ssh alias. When all nodes are added, you can list them with havirt node list -t tsv which will dump a tab delimited text file to STDOUT. Now it is time to populate all of the domains currently running havirt node scan # scan all nodes for running domains havirt domain update # get conf for all domains and store in conf/ havirt domain list # show all domains Note: domain list will not show nodes which have no domains on them.