clonehelper - Create a bunch of cloned VMs in via libvirt.
clonehelper [-f <config>] -b <action>
The basic work flow for this is like below.
delete clone start wait a bit till they are all started snapshot shutdown
Print a JSON dump of VMs, maps, and IPs.
Start all the VM clones.
Stop all the VM clones.
Generate the VM clones.
Delete all the VM clones.
Generate the XML config and print it.
Remove and re-add the network using the generated config.
Snapshot all the VM clones.
The config format is a INI file.
The variable/value defaults are shown below.
net=default # Name of the libvirt network in question. blank_domains=/usr/local/etc/clonehelper/blank_domains # List of domains to blank via setting 'dnsmasq:option value='address=/foo.bar/'. # If not this file does not exist, it will be skipped. net_head=/usr/local/etc/clonehelper/net_head # The top part of the net XML config that that dnsmasq options will be # sandwhiched between. net_tail=/usr/local/etc/clonehelper/net_tail # The bottom part of the net XML config that that dnsmasq options will # be sandwhiched between. windows_blank=1 # Blank commonly used MS domains. This is handy for reducing network noise # when testing as well as making sure they any VMs don't do something like # run updates when one does not want it to. mac_base=00:08:74:2d:dd: # Base to use for the MAC. ipv4_base=192.168.1. # Base to use for the IPs for adding static assignments. start=100 # Where to start in set. to_clone=baseVM # The name of the VM to clone. clone_name_base=cloneVM # Base name to use for creating the clones. 'foo' will become 'foo$current', so # for a start of 100, the first one would be 'foo100' and with a count of 10 the # last will be 'foo109'. count=10 # How many clones to create. snapshot_name=clean # The name to use for the snapshot.
temp
To install VM::Libvirt::CloneHelper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VM::Libvirt::CloneHelper
CPAN shell
perl -MCPAN -e shell install VM::Libvirt::CloneHelper
For more information on module installation, please visit the detailed CPAN module installation guide.