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

Virt disk fixes - Fluorine backport #50379

merged 5 commits into from Nov 5, 2018


None yet
2 participants
Copy link

commented Nov 5, 2018

Backport of PR #50356

What does this PR do?

This PR handles cdrom disks devices in the virt module. When updating VMs created outside of salt virt module we would hit problems since these devices can have no attached source.

What issues does this PR fix or reference?


Previous Behavior

Run a virt.update on a VM that has a cdrom device with no ISO attached. The salt call will fail with a message saying None is not an iterable type.

New Behavior

Running a virt.update doesn't trigger an exception and keeps the cdrom (or floppy) device intact.

Tests written?


Commits signed with GPG?


cbosdo added some commits Nov 2, 2018

Virt: VM disk source may not be specified
Disks like cdroms have no source element. We need to handle iit in the
disks comparison or we'll have exceptions when updating VMs that haven't
been generated by salt virt module.
virt: introduce disk device type
Disk devices can be of several types and we need to handle them in order
to update existing VMms with floppy or cdrom devices.
cdrom devices are particularly interesting since they can also have no
virt: use a list of disks for the domain template
Using a dict breaks the disk order which might be of importance to
users. It only hides the disk name from the template rendering, but
that one property wasn't used.
virt: try hard not to break the disk order in update
While updating a domain, we need to ensure the disks are in the order
defined by the user.
virt: fix disk targets before diffing
Ensure the disk target devices are unique within the disks in the new
list before diffing them. Libvirt will reorder the disks based on their
targets. If the users gives a disk order that is not consistent with the
currently running VM, then it's his fault giving us wrong data.

This comment has been minimized.

Copy link
Contributor Author

commented Nov 5, 2018

@gtmanfred @rallytime this PR is ready for review

@rallytime rallytime merged commit f2d4b7b into saltstack:fluorine Nov 5, 2018

10 checks passed

WIP Ready for review
continuous-integration/jenkins/pr-merge This commit looks good
jenkins/pr/docs The docs job has passed
jenkins/pr/lint The lint job has passed
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.