For the last few months I have been spending some time on writing a proper component for the LCFG platform for managing up to a certain level the the Xen resources. The very first version of the component only managed the Xen daemons, e.g: xend and xendomains. It was performing a check if the Xen virtual network interfaces were up and if not bringing them up. Very basic functionality.
On Friday has been released the second version version of the component with a few improvements:
- Manage guest’s configuration file
- Manage list of guest’s disk image
- Manage list of guest’s virtual networking interfaces
- Start guest at boot time
- Shutdown guest at poweroff
- Option for controlling the xendomains daemon or not
A few words more:
– Manage guest’s configuration file
The component provides appropriate resources for setting the name of the guest, the initial memory, the maximum memory, the number of CPUs, the guest’s disks, the guest’s network interfaces, an ISO or CD/DVD path.
– Manage list of guest’s disk images
A list of disk images can be specified. File name, size and root path location is specified for each entry. If the disk image does not exist it will be created with the requested size and ready to be used. If there is already one it will be untouched. If the path is not specified, the default (/var/lib/xen/images) will be assumed.
A physical partition can not be managed at this stage. It will have to created manually and then specify the name in the list and the path in the corresponding resource.
– Manage list of guest’s virtual network interfaces
A list of network interfaces for the guest can be specified. For each interface the MAC address must be specified and can also be specified the bridge interface that will be used as well as the networking script. If there is no specification for the bridge and the script, the default values will be assumed (xenbr0 and network-bridge respectively).
– Start guest at boot time
If boot resource is set to yes for a guest then that guest will boot automatically when the component will start.
– Shutdown guest at poweroff
If boot resource is set to yes for a guest then that guest will shut down automatically when the component will stop.
– Option for controlling the xendomains daemon or not
The xendomains daemon controls the status of the guests. If the resource is set to yes, when the comonent restart or configures itself, the corresponding methods of the xendomains daemon will run and by that the running guests will be affected. If the resource is set to no the guests will keep running and the component will restart only the xend daemon. However, the resource is not taken under consideration when the component stops where any running guest will shutdown.
– Boot from ISO image or CD/DVD disk
The path to the ISO image or the physical CD/DVD drive can be specified. If so the guest will boot from that media rather than the system disk.
!xen.virtualmachines mADD(sl5vm) !xen.name_sl5vm mSET(sl5vm) !xen.uuid_sl5vm mSET(6f2cffa1-21f6-43b4-8c52-08b8277a38a3) !xen.maxmem_sl5vm mSET(1024) !xen.memory_sl5vm mSET(1024) !xen.vcpus_sl5vm mSET(2) !xen.disks_sl5vm mADD(osdisk, swap) !xen.diskname_sl5vm_osdisk mSET(sl5vmos) !xen.disktype_sl5vm_osdisk mSET(image) !xen.disksize_sl5vm_osdisk mSET(24) !xen.diskname_sl5vm_swap mSET(sl5vmswap) !xen.disktype_sl5vm_swap mSET(image) !xen.disksize_sl5vm_swap mSET(1) !xen.vifs mADD(vif1) !xen.mac_sl5vm_vif1 mSET(00:1e:c9:52:30:ce) !xen.bridge_sl5vm_vif1 mSET(xenbr1) !xen.script_sl5vm_vif1 mSET(vif-bridge-private) !xen.cdpath_sl5vm mSET(/opt/xen/iso/sl5.iso) !xen.boot_sl5vm mSET(yes)
Based on these resources the component will create a new guest called sl5vm and its configuration file will be /etc/xen/sl5vm. A specific UUID is given, 1G of memory will be allocated and two CPUs will be used. The component will create two disk images. 24G for the system disk and 1G for a disk image to be used as swap memory. The swap disk image will be stores in a different location than the default, /var/lib/xen/images/swap. The guest will also have two network interfaces (eth0 and eth1). The second one will be assigned a private LAN address.