-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
VMware: vm_guest - allow existing vmdk files to be attached to guest #45953
VMware: vm_guest - allow existing vmdk files to be attached to guest #45953
Conversation
Hi @mrmagooey, Thank you for the pullrequest, just so you are aware we have a dedicated Working Group for vmware. |
The test
The test
The test
The test
The test
The test
The test
|
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.
This breaks unit numbering.
3dc2f42
to
9fdbe24
Compare
@pdellaert @mrmagooey @jeking3 Could you please review this ? Thanks in advance. |
# index 7 is reserved to SCSI controller | ||
if disk_index == 7: | ||
disk_index += 1 | ||
|
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.
This should also be capped at 15 based on today's ESXi scsi controller rules, unless we want to just let VMware enforce it with a task error...
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.
I am planning to have that in this PR #33338
Could use an integration test. |
@jeking3 Not sure if VCSIM supports, but will try to add integration test for this change. |
@jeking3 VCSIM does not support |
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.
LGTM
@pdellaert @jeking3 Thanks for the review. @mrmagooey Thanks for the contribution. |
While creating new VM, don't assume the VMDKs are present, create them as we attache the disk to VM. Possible regression fix for introduced via ansible#45953 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
While creating new VM, don't assume the VMDKs are present, create them as we attache the disk to VM. Possible regression fix for introduced via #45953 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Hello, is this fix available in any of the versions released on PyPI? From what I can tell it is not. |
@atodorov This is merged in 2.8 release which is supposed to be release soon. Meanwhile you can use https://docs.ansible.com/ansible/latest/dev_guide/testing.html#how-to-test-a-pr document to test this PR. |
Signed-off-by: James E. King III <jking@apache.org> Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Even after applying the parameters it says "No size mentioned for disk" |
SUMMARY
Allows existing vmdk files to be attached to a new guest vm. Adds the
filename
parameter to thedisk
dictionary. Still requires the the datastore to be separately specified as there are many dependencies on this value through the code.Fixes #30041 , although that issue is for the deprecated vsphere_guest.py module.
ISSUE TYPE
COMPONENT NAME
cloud/vmware/vmware_guest.py
ANSIBLE VERSION
2.7.0dev
vsphere vcenter 6.7
ADDITIONAL INFORMATION
Currently there is no method of attaching existing vmdk disks to a new guest vm (as far as I'm aware...). This PR will search for the specified vmdk file, get its size, and create the spec for attaching the existing disk to this vm. The guest vm also seems to be happy booting off a vmdk file attached like this.
A working yml disk definition to add a vmdk file looks like:
This will need some testing as I don't have a clustered vsphere setup to test on, and that might have some different behaviour that I don't know about.
I also note that there is a separate module being introduced at #36165 which this (should it work properly) might be appropriate to be merged into.