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
merged 5 commits into from Nov 5, 2018
Merged

Conversation

@cbosdo
Copy link
Collaborator

@cbosdo cbosdo 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?

None

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?

Yes

Commits signed with GPG?

Yes

cbosdo added 5 commits Nov 5, 2018
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.
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
source.
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.
While updating a domain, we need to ensure the disks are in the order
defined by the user.
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.
@cbosdo
Copy link
Collaborator Author

@cbosdo cbosdo 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants