-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
vSphere: Support mounting ISO images to virtual cdrom drives. #4243
Conversation
Please verify the new acceptance test (the one I just created) works for you as well. I have verified it works on my vmware setup. |
I'll try to check the acceptance test. 👍 |
Ok great! 😄 |
@kristinn I tried to check the acceptance test. But, I got the following error messages.
This is a hardware information of the new VM.
|
@tkak Ok I see. I will take a look at this. Thank you for running the test. |
cab5149
to
ee5a399
Compare
@tkak Did you export all the required environment variables? cdromDatastore := os.Getenv("VSPHERE_CDROM_DATASTORE")
cdromPath := os.Getenv("VSPHERE_CDROM_PATH") These ones are new ones that I introduced in my acceptance test. The I can't see the ISO being mounted in the information you provided about the virtual machine. I was running the test and it works for me. The ISO you point to in the environment variables must exist in the datastore. |
@kristinn Yes, I set the environment variables. But I got the error message. Anyway, I resolved the issue by moving a location to call
|
@@ -1231,6 +1325,12 @@ func (vm *virtualMachine) deployVirtualMachine(c *govmomi.Client) error { | |||
return err | |||
} | |||
} | |||
|
|||
// Create the cdroms if needed. | |||
if err := createCdroms(newVM, vm.cdroms); err != nil { |
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.
Can you move this to L1310 (before the newVM.Customize(context.TODO(), customSpec)
)?
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.
Ah, ok so that's the reason.
I will do that. Thanks a lot!
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.
One question. Shouldn't it call createCdroms()
from both createVirtualMachine()
and from deployVirtualMachine()
?
Isn't deployVirtualMachine()
used for cloning but createVirtualMachine()
when creating a brand new vm?
201953e
to
9fa7e5e
Compare
Now I've updated the code so the cdrom creation is before the customization call. 😄 |
I only moved the |
@kristinn Thank you for your modification. 😄 I think it looks good. There isn't the error message in case of |
Awesome! 😄 |
@chrislovecnm it's actually this one we should merge since it provides support for mounting isos from different datastores than the vm is hosted on. |
I will rebase this to fix the conflicts. |
@kristinn thanks |
9fa7e5e
to
ef04fcb
Compare
It can come in handy to be able to mount ISOs programmatically. For instance if you're developing a custom appliance (that automatically installs itself on the hard drive volume) that you want to automatically test on every successful build (given the ISO is uploaded to the vmware datastore). There are probably lots of other reasons for using this functionality.
ef04fcb
to
a67fa66
Compare
@@ -71,6 +72,9 @@ The `windows_opt_config` block supports: | |||
* `domain_user` - (Optional) User that is a member of the specified domain. | |||
* `domain_user_password` - (Optional) Password for domain user, in plain text. | |||
|
|||
<a id="disks"></a> | |||
## Disks | |||
|
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 decided to add this since it was missing (it's being linked to in line 48, but clicking that link wouldn't do much).
I added information about this change to the website documentation (the markdown files). This is squashed, I've executed the acceptance test and it seems to be ready for merge - after Travis has built it successfully. |
@chrislovecnm Just in case you didn't get a notification about my last comment. 😄 This can be merged now. |
LGTM! Thanks to all involved. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
It can come in handy to be able to mount ISOs programmatically.
For instance if you're developing a custom appliance (that automatically installs itself on the hard drive volume)
that you want to automatically test on every successful build (given the ISO is uploaded to the vmware datastore).
There are probably lots of other reasons for using this functionality.