Better handling of /etc/libvirt/qemu.conf configuration file
|Affected Versions:||OpenNebula 5.2|
openebula-node Debian package does not handle the
/etc/libvirt/qemu.conf configuration file in a sane way. There are two issues:
opennebula-nodepostinst script checks the existence of the
qemu.confconfiguration file, and if it finds one, the existing configuration file is moved out of the way and replaced by a stub configuration file with minimum set of configuration options required by OpenNebula. This completely destroys existing configuration created by the local system administrator, without confirmation.
/etc/libvirt/qemu.confconfiguration file, in Debian Jessie, is managed by the
libvirt-qemu-systempackage and is marked as a Conffile. After the
opennebula-nodepackage changes the existing configuration file, future
libvirt-qemu-systempackage upgrades might be interrupted by the
debconfsystem asking the user what to do with the changed configuration file.
The above issues affect automated installation and management of OpenNebula nodes to the point, where potential users (me included) might drop the usage of the
opennebula-node package completely and just apply the required changes using their configuration management system of choice. Therefore I think that the current
postinst script included in the package should be fixed. Suggested solutions:
- Check if the
/etc/libvirt/qemu.confconfiguration file contains the desired configuration (user/group/dynamic_ownership) before blindly overwriting it.
- If the script decides to write the new configuration file with the required changes, don't overwrite the
/etc/libvirt/qemu.confconfiguration file directly. Instead, check potential diversions using the
dpkg-divertcommand and operate on that. If there are no diversions, create a diversion before writing the new configuration - this will ensure that upgrades of the
libvirt-qemu-systempackage work correctly.