-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Update existing VMs in virt.running #48736
Conversation
@rallytime @gtmanfred yet another feature (+ cleanup) PR for the virt modules that you surely want to look into. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like some tests are failing
https://jenkinsci.saltstack.com/job/pr-kitchen-centos7-py2/job/PR-48736/2/
@gtmanfred oops... Two of the failures are indeed mine and I'll fix them, but the 3 others ones are completely unrelated to this PR. |
The two unit tests are now fixed, thanks for the heads up |
fixed a remaining lint error and rebased on the develop branch |
The target element is not mandatory, introduce a test that we properly handle this situation
ElementTree provides a more convenient API than minidom. Switching to ElementTree will reduce the number of dependencies for the virt module and simplify the code a little.
Graphics type 'none' will help to distinguish between no graphics data and removal of graphics device in a future virt.update function.
User need to be able to update an existing virtual machine definition. This function changes the definition for the next start of the VM and tries hard to live update the virtual machine.
So far virt.running does nothing if the corresponding domain is already defined. Use the new virt.update function to change the domain configuration.
Modules test files are named after the module itself, the state virt module needs to comply with that rule too.
What does this PR do?
This PR makes
virt.running
able to update existing VMs, running or not. If the VM is already running, the new definition will be applied for the next start and as many live updates as possible will be attempted.A new
virt.update
function has been introduced in the virt execution module.The PR also removes the use of minidom in the virt execution module for more consistency... and ElementTree helps removing some XML helper functions.
What issues does this PR fix or reference?
None
Previous Behavior
virt.running
on a running VM did nothingvirt.running
on a defined, but stopped VM started itNew Behavior
Tests written?
Yes
Commits signed with GPG?
Yes