-
Notifications
You must be signed in to change notification settings - Fork 341
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
Fix disk creation resulting in 'invalid configuration for device' error #2009
Fix disk creation resulting in 'invalid configuration for device' error #2009
Conversation
The CI stage is failing with this error:
However, none of these LOC are touched by my PR. |
Build succeeded. ✔️ ansible-tox-linters SUCCESS in 11m 09s |
7df2a3b
to
c784d76
Compare
@mariolenz Please consider merging this :) |
Build succeeded. ✔️ ansible-tox-linters SUCCESS in 8m 32s |
I've assigned this PR to myself. Hopefully, this helps me to remember having a look at this. |
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.
Under some circumstances, disk creation fails with an
invalid configuration for device
error. Once this error shows up for a VM, it persistently happens whenever trying to add disks, however, I do not know how to make it show up for a VM, sometimes it is just there.
In that case, it's hard to test this. But the code LGTM so let's give it a try :-)
Build succeeded (gate pipeline). ✔️ ansible-tox-linters SUCCESS in 4m 57s |
Pull request merge failed: Resource not accessible by integration, You may need to manually rebase your PR and retry. |
Sooner or later, I'd like to understand this... |
Thank you @mariolenz Would it be possible to backport this, atleast to 4.x? |
… device' error (#2245) Backport #2009 SUMMARY Under some circumstances, disk creation fails with an invalid configuration for device error. Once this error shows up for a VM, it persistently happens whenever trying to add disks, however, I do not know how to make it show up for a VM, sometimes it is just there. In comparing the API calls done by VCenter (which works) and ansible (which fails with the error above), I noticed that VCenter sets fileOperation to create. Setting this in ansible, as done in this patch, fixes the disk creation in ansible. The docs describe the fileOperation parameter like this: Type of operation being performed on the backing of the specified virtual device. If no file operation is specified in the VirtualDeviceSpec, then any backing filenames in the VirtualDevice must refer to files that already exist. The "replace" and "delete" values for this property are only applicable to virtual disk backing files. So it really must be set when the backing file does not exist, (which it ofc doesn't when creating a disk). ISSUE TYPE Bugfix Pull Request COMPONENT NAME vm_device_helper
|
SUMMARY
Under some circumstances, disk creation fails with an
invalid configuration for device
error.Once this error shows up for a VM, it persistently happens whenever trying to add disks, however, I do not know how to make it show up for a VM, sometimes it is just there.
In comparing the API calls done by VCenter (which works) and ansible (which fails with the error above), I noticed that VCenter sets
fileOperation
tocreate
. Setting this in ansible, as done in this patch, fixes the disk creation in ansible.The docs describe the
fileOperation
parameter like this:So it really must be set when the backing file does not exist, (which it ofc doesn't when creating a disk).
ISSUE TYPE
COMPONENT NAME
vm_device_helper