Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better handling of /etc/libvirt/qemu.conf configuration file #1151

Closed
OpenNebulaProject opened this issue Nov 20, 2017 · 1 comment
Closed

Comments

@OpenNebulaProject
Copy link


Author Name: Maciej Delmanowski (Maciej Delmanowski)
Original Redmine Issue: 4947, https://dev.opennebula.org/issues/4947
Original Date: 2016-12-01


The openebula-node Debian package does not handle the /etc/libvirt/qemu.conf configuration file in a sane way. There are two issues:

  • The opennebula-node postinst script checks the existence of the qemu.conf configuration 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.

  • The /etc/libvirt/qemu.conf configuration file, in Debian Jessie, is managed by the libvirt-qemu-system package and is marked as a Conffile. After the opennebula-node package changes the existing configuration file, future libvirt-qemu-system package upgrades might be interrupted by the debconf system 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.conf configuration 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.conf configuration file directly. Instead, check potential diversions using the dpkg-divert command 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-system package work correctly.

@vholer
Copy link
Contributor

vholer commented Apr 26, 2018

This has been fixed by #1768, Libvirt configuration is now managed by the Augeas. It's not replaced as a whole, but only modifies the particular parameters. Closing as fixed.

Note about the:

future libvirt-qemu-system package upgrades might be interrupted by the debconf system asking the user what to do with the changed configuration file.

If you are running apt-get non-interactively, you also need to instruct the apt-get to use the non-interactive interface (via env. variable DEBIAN_FRONTEND=noninteractive), and how to deal with the configuration file changes (via parametrs --force-confnew, --force-confold, --force-confdef). Please check:

@vholer vholer closed this as completed Apr 26, 2018
rsmontero pushed a commit that referenced this issue May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants