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

Validate deviceMode on a VirtualDisk Backing before reconfigure #24

Merged

Conversation

agrare
Copy link
Member

@agrare agrare commented Mar 10, 2017

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 supports persistent, independnet_persistent, and independent_nonpersistent [ref]

VirtualDiskFlatVer2BackingOption
diskMode
The disk mode. Valid disk modes are:
persistent
independent_persistent
independent_nonpersistent

See VirtualDiskMode

This will validate before submitting the ReconfigVM_Task that a supported diskMode was selected by the user.

screenshot from 2017-03-10 15-39-27

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

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
@agrare agrare added the bug label Mar 10, 2017
@agrare
Copy link
Member Author

agrare commented Mar 10, 2017

cc @gmcculloug @blomquisg

@agrare agrare force-pushed the bz_1430374_validate_reconfig_device_mode branch from c815421 to b642412 Compare March 10, 2017 21:04
@gmcculloug
Copy link
Member

cc @lfu

@@ -162,6 +162,25 @@ def disk_mode(dependent, persistent)
end
end

def validate_device_backing(backing)
case backing.xsiType
when 'VirtualDiskFlatVer2BackingInfo'
Copy link
Member

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

Copy link
Member Author

@agrare agrare Mar 14, 2017

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.

@lfu
Copy link
Member

lfu commented Mar 14, 2017

👍 LGTM

@blomquisg blomquisg merged commit a86801a into ManageIQ:master Mar 16, 2017
@blomquisg blomquisg added this to the Sprint 57 Ending Mar 27, 2017 milestone Mar 16, 2017
@agrare agrare deleted the bz_1430374_validate_reconfig_device_mode branch March 16, 2017 20:15
agrare pushed a commit to agrare/manageiq-providers-vmware that referenced this pull request Apr 15, 2019
…chine

Initial commit for new generic service state machine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants