

This also does not seem optimal but can be done by editing every guest and setting the path to /usr/local/libexec/qemu-kvm

SERIAL=$(/usr/bin/hal-get-property -udi /org/freedesktop/Hal/devices/computer -key )Įxec /usr/libexec/qemu-kvm -smbios type=1,serial="KVM-$SERIAL-$2"Įxec /usr/libexec/qemu-kvm final step is to tell libvirt to use my new shim rather than the qemu-kvm binary directly. # This is a wrapper around qemu which will supply I check to see if that has been specified because qemu-kvm is also invoked by libvirt to check it's configuration/capabilities which does not require the dmi serial (although it does not hurt). This was not the case in a previous release so it could change). When a vm is being started, the first parameter is -name and then the machine name is specified (at least in the current EL6 version. On RHEL/CentOS 6, the binary lives in /usr/libexec so I put my wrapper in /usr/local/libexec (I think that is the first time I have ever used that directory). The next step was a shim around qemu-kvm which could add the command line parameters.

Which uses dbus but means I can run it without being root. usr/bin/hal-get-property -udi /org/freedesktop/Hal/devices/computer -key Initially I used dmidecode to get the host serial numberīut to run that you must be root and using sudo from the qemu user turned out to be a PITA. I would like to insert a value which is the same as the host serial but with a prefix to indicate that this is indeed a virtual machine and then a suffix to make sure the serial is unique (such as the vm name). xml config file but it is still not used. The libvirt specification permits setting a value in the.
#Icecream screen recorder pro 5.09 serial number serial number#
Unfortunately, libvirt does not use this mechanism and the serial number is blank in the virtual machine. The virtual machine will see this value and puppet will automatically create a fact with this value. Qemu permits you to specify many DMI values on the command line like this: Using bits and pieces from around the internet I have come up with a process where I can pass the serial number of the host into the guest. One of the properties we record for virtual machines is their location (which host they are running on).īy default, KVM does not expose this information even though there are many ways it could technically be done. Our puppet configuration performs a number of checks on our asset database to make sure things are recorded correctly.
