-
Notifications
You must be signed in to change notification settings - Fork 69
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
Validate deviceMode on a VirtualDisk Backing before reconfigure #24
Validate deviceMode on a VirtualDisk Backing before reconfigure #24
Conversation
Check settings on a virtual device in a device change set before submitting the ReconfigVM_Task. This includes ensuring that the deviceMode is correct for the given backing type. https://bugzilla.redhat.com/show_bug.cgi?id=1430374
c815421
to
b642412
Compare
cc @lfu |
@@ -162,6 +162,25 @@ def disk_mode(dependent, persistent) | |||
end | |||
end | |||
|
|||
def validate_device_backing(backing) | |||
case backing.xsiType | |||
when 'VirtualDiskFlatVer2BackingInfo' |
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.
@agrare
I'm confused with VirtualDiskFlatVer2BackingOption
and VirtualDiskFlatVer2BackingInfo
.
Looks like the valid modes defined here is for VirtualDiskFlatVer2BackingOption
.
According to the ref, valid modes for VirtualDiskFlatVer2BackingInfo
are:
The disk persistence mode. Valid modes are:
persistent
independent_persistent
independent_nonpersistent
nonpersistent
undoable
append
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.
So they don't do a great job of documenting what modes are supported or not.
Those are all valid modes and the reconfigure will succeed, but if you actually use some of the modes the VM won't even power-on.
Those three modes are the ones that the vSphere client will let you select for the disk mode.
👍 LGTM |
…chine Initial commit for new generic service state machine.
The user has the option of setting the disk mode when adding a disk during reconfigure, the possible options provided by VMware are: append, independent_nonpersistent, independent_persistent, nonpersistent, persistent, undoable [ref]
However not all of these options are valid for all backing type. Specifically the backing type that we use for new disks (
VirtualDiskFlatVer2Backing
) only supportspersistent
,independnet_persistent
, andindependent_nonpersistent
[ref]This will validate before submitting the
ReconfigVM_Task
that a supported diskMode was selected by the user.This should be followed up by a UI change to only display valid options to the user, currently it is possible for the user to select persistent, nonpersistent, independent_persistent, and independent_nonpersistent.
https://bugzilla.redhat.com/show_bug.cgi?id=1430374