DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.

DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
CloudStack users wish to have the ability functionality to add “extra configuration” metadata to a user VM during deployment in a manner that is similar across the 3 major supported hypervisors. This data could be anything ranging from instructions to install hypervisor specific required tools and drivers in each VM that is deployed from a template which does not have these tools installed. To simplify the implementation, the user will pass this additional configuration as URL encoded string that will be decoded and parsed for each hypervisor type. These additional metadata must be included in the VM instance definition.
Any additional configuration setting/command needs to be first included into the list of allowed settings by the Root Admin through a configurable global configuration. No command/setting is allowed by default.
The primary configuration file for KVM host guest instances is a domain XML. The additional configuration for KVM should be provided in XML format in a URL encoded string which will be parsed and append to the KVM instance XML configuration file builder.
A configurable global config 'allow.additional.vm.configuration.list.kvm' is available for Root admin to specify a list options that are allowed with this feature. with KVM No option is allowed by default.
Example: the following metadata can be passed to enable hugepages on KVM hosts specify guest VM NUMA topology using the <numa> element in the domain XML, with 'memoryBacking' included in the list of allowed setting/configuration
<memoryBacking>
<hugepages/>
</memoryBacking>
...
Another Example: the following examples allows user to add EHCI controller to VM, also with the 'controller' element/tag included in the list of allowed settings/configuration
<controller type='usb' index='1' model='ehci'></controller>
...
%3Ccontroller%20type%3D%27usb%27%20index%3D%271%27%20model%3D%27ehci%27%3E%3C%2Fcontroller%3E
Support for XenServer has only been added for the XAPI's 'vm-param-set' configuration using its arguments/keys as strings. Below is a full list of all supported operations with this feature;
Simple key=value pair configurations, e.g PV-args=hvc0, is-a-template=true. Any of these settings will override an existing setting with the new value from the user.
A configurable global config 'allow.additional.vm.configuration.black.list.kvmxenserver' is available for Root admin to specify a list of 'vm-param-set' options that are disallowed allowed with this feature.
The keys in the blacklisted commands are used to validate the tags from the user passed XML as extraconfig data. Any tag/element that is found with the name in the blacklist of commands will result to an Exception.
e.g. <name>my vm </name> or <memory unit="KiB">262144</memory> or <currentMemory unit="KiB">262144</currentMemory> will throw an exception by default because this type of XML tags have been blacklisted.
Similar for this hypervisor, the primary configuration file of the guest VM is built by CloudStack, therefor, the additional metadata will also be parsed and append to the builder.
...
No configuration is allowed by default.
is-a-template,
memory-static-max,
memory-dynamic-max,
memory-dynamic-min,
memory-static-min,
VCPUs-max,
VCPUs-at-startup,
HVM-boot-policy,
order,
shutdown-delay, Long
start-delay, Long
ha-restart-priority,
PV-bootloader-args,
PV-bootloader,
PV-legacy-args,
PV-args,
PV-ramdisk,
PV-kernel,
HVM-shadow-multiplier,
To set a (key,value) pair in a map parameter, use the syntax 'map-param:key=value'. Any of this settings do not override already defined params but append to the map. For example 'platform:timeoffset=value' will not override already defined platform settings but will append to the settings this new additional configuration that is being set.
VCPUs-params:,
platform:,
HVM-boot-params:,
other-config:,
xenstore-data:
Example: Following commands are used to convert a VM from HVM to PV;, also admin needs to include HVM-boot-policy, PV-bootloader and PV-args for the configuration below to be allowed.
vm-param-set HVM-boot-policy=
vm-param-set PV-bootloader=pygrub
vm-param-set PV-args=hvc0
User needs to pass the following URL encoded string:
vm-param-set%20PV-bootloader%3Dpygrub%0Avm-param-set%20PV-args%3Dhvc0%0Avm-param-set%20HVM-boot-policy%3D
...
HVM-boot-policy%3D%0APV-bootloader%3Dpygrub%0APV-args%3Dhvc0
For validation, user can log/ssh on to the VM hypervisor host and execute the following commands on the terminal to verify that additional configuration is available in the state.db for that instance :
And verify that they have been correctly set.
...
The algorithm for XenServer does the following checks;
Similar for this hypervisor, the primary configuration file of the guest VM is built by CloudStack, therefor, the additional metadata will also be parsed and append to the VMX file builder.
A configurable global config 'allow.additional.vm.configuration.list.vmware' is available for Root admin to specify a list options that are allowed with this feature.
Example: the following is an example to set Hyper-V to run on ESXi, with 'hypervisor.cpuid.v0' included on the list of allowed settings/configuration keys.
hypervisor.cpuid.v0=FALSE
...
hypervisor.cpuid.v0%3DFALSE
...
Similar to the other hypervisors, user need to ssh into the host and examine the vmx file to see extra configuration is present. Execute the following commands from the terminal.
...
The configuration passed is parsed as key/value pair and every key is validated against against the blacklisted allowed list of commands set by Root admin. An Exception is thrown if an invalid key is found.
...
UserVmManageImpl class is refactored to include the new Boolean configuration setting to allow/disallow passing of additional data during VM deployment/updating, and stores the data in the 'user_vm_details' table.
...
VirtualMachineTO class is refactored to carry the additional configuration data from the Service Layer to Hypervisor Layer.
KVM : LibvirtComputingResource class is refactored to include additional configuration metadata into the VM domain XML before starting it.
XenServer: CitrixResourceBase class is refactored as well to include additional metadata in the primary configuration file builder of the VM before starting it.
VMware: VmwareResource is also refactored to include additional configuration into the VMX configuration file builder before starting the VM.
N/A