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

r/virtual_machine: Fix multiple change operations to a single device #371

Merged
merged 1 commit into from
Jan 25, 2018

Conversation

vancluever
Copy link
Contributor

Due to how the DeviceChange struct works in API, it's possible to end up
setting up a list of DeviceChange operations that possibly point to
the same underlying virtual device. In this instance, with our logic,
any subsequent operations that result in a device change will end up
changing all operations before it into the same state as the most
current version of that virtual device, causing an invalid operation.

This can be seen in a scenario that a VM is cloned from template, with
both the SCSI bus type and disk size changing at the same time:

  • The SCSI type change will add an operation that changes the controller
    the disk is attached to.
  • The second operation will change the size of the virtual disk.

Both of these operations will operate on the same VirtualDisk device
instance and if the structure is not duplicated, this will result in the
first device change operation being identical to the second, causing the
subsequent reconfigure operation to fail.

Due to how the DeviceChange struct works in API, it's possible to end up
setting up a list of DeviceChange operations that possibly point to
the same underlying virtual device. In this instance, with our logic,
any subsequent operations that result in a device change will end up
changing all operations before it into the same state as the most
current version of that virtual device, causing an invalid operation.

This can be seen in a scenario that a VM is cloned from template, with
both the SCSI bus type and disk size changing at the same time:

* The SCSI type change will add an operation that changes the controller
the disk is attached to.
* The second operation will change the size of the virtual disk.

Both of these operations will operate on the same VirtualDisk device
instance and if the structure is not duplicated, this will result in the
first device change operation being identical to the second, causing the
subsequent reconfigure operation to fail.
@vancluever vancluever merged commit f66077a into master Jan 25, 2018
@vancluever vancluever deleted the b-multi-change-single-device branch February 13, 2018 15:57
@ghost ghost locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants