additional info to VM XML vit the metadata field (kvm)
|Category:||Drivers - VM|
|Target version:||Release 5.0|
As libvirt and qemu-kvm are in permanent development if someone would like to use cutting edge/latest stable/ there should be a way to change/tweak the VM XML easy. AFAIK the current XML generation is buried in the "core" (compiled c++ code).
Such an example is the polling of disk stats - it is a job that is ran on the hypervisors so they had only the data that is in the VM XML only and (IMO) there is a need for the poll script to know what is the TM_MAD for each disk and call correct script/driver/ to report the needed data(disk sizes, snapshot sizes etc.). for example if a disk is of type "block" it could be anything - lvm,iscsi,storpool etc. The benefits of this approach are simpler and more flexible vmm/poll script extendable for each additional driver.
Here is another example: Recently we played with the VM optimizations that are done by adding an tweaking tool in the vmm/deploy script to tweak the VM XML. It is good as proof of concept, but in real scenario there is a need to have an field to pass additional data how such hooks/scripts to behave depending on the given VM need. Easiest solution could be a custom field in the metadata of the VM XML to carry base64 encoded blob (or more fields?) that the opennebula admin can add to the VM via the VM templates or similar. I agree there are complication with the live addition of the disks, but it looks like a good beginning to have such info for the vmm/deploy. For the attach i think such data is good to be passed as additional argument so the attach script to know how to complete the tasks, again if the tm_mad is known it could offload the XML snipped to be build by external tool for the given driver,if available.
Probably there are other implications that are out of my mind, so this is a rough scratch what i have in mind.
feature #4358: Adds <metadata><vm_xml64> element to the deployment file.
This new element includes de VM template in XML format and base64