How Do I Customize Properties When Creating a VM on oVirt?
Symptom
During VM creation, a custom property qemu:commandline is desired, but this custom property is not included in the list of recognized keywords.

Key Process and Cause Analysis
The XML configuration of an oVirt-based VM cannot be manually modified. To enable various VM configurations, oVirt allows property customization. The official built-in custom properties do not contain qemu:commandline. However, the vdsm-hook-qemucmdline extension package is provided, which requires manual installation and configuration.
Conclusion and Solution
- Currently, vdsm-hook-qemucmdline supports only the qemu:arg subtag. If you want to enable other qemucmdline property tags, you can modify the /usr/libexec/vdsm/hooks/before_vm_start/50_qemucmdline script to customize the property configuration.
- If you want to enable other custom properties, create and add custom attributes and hook scripts by referring to the official document.
- Install the extension package.
1yum install vdsm-hook-qemucmdline.noarch
- Add customized properties.
1engine-config -s "UserDefinedVMProperties=qemu_cmdline=^.*$" --cver=4.4
- Restart the ovirt-engine service.
1service ovirt-engine restart
The following is an example.
- Access the oVirt web page, choose New Virtual Machine > Custom Properties > qemu_cmdline, and enter the following content:
["-chardev","socket,path=/tmp/vm_sock0,server=on,wait=off,id=vm_sock","-device","virtio-serial","-device","virtserialport,chardev=vm_sock,name=serialport0"]

- After the VM is created and started, run the virsh dumpxml command to check the VM configuration. The following content is added to the VM configuration.
<qemu:commandline> <qemu:arg value='-chardev'/> <qemu:arg value='socket,path=/tmp/vm_sock0,server=on,wait=off,id=vm_sock'/> <qemu:arg value='-device'/> <qemu:arg value='virtio-serial'/> <qemu:arg value='-device'/> <qemu:arg value='virtserialport,chardev=vm_sock,name=serialport0'/> </qemu:commandline>
Parent topic: oVirt