packer-builder-vsphere
packer-builder-vsphere copied to clipboard
DRS cluster doesn't detect default datastore and network
if datastore
or network
are not specified explicitly for DRS-enabled clusters, then a build fails with
==> vsphere-iso: Creating VM...
Build 'vsphere-iso' errored: error creating vm: host '' not found
I just ran across this same issue. Any idea when it might get addressed?
Specify the value explicitly. This issue is not so easy to fix.
It's not just the VM host. It's a cycle. You add that, it asks for datastores, then when you add that it asks for networks, etc. Which means I have to build on one host which isn't the best option.
Not sure I follow. On DRS-enabled clusters you don't need to specify host
parameter.
We're running into this as well, but we do use a DRS enabled cluster, and we have specified both datastore
, cluster
and network
, but no host
, yet we also get the host '' is not found
error message similar to the comment on the commit.
The issue seems to happen however upon uploading the floppy, not when creating the virtual machine itself.
yes, I've reproduced the issue with floppy upload. Unfortunately, the fix requires quite significant code refactoring.
As a workaround, you could try using the new http_directory
parameter (#116) and do not upload files into the datastore at all.
@mkuzmin I see Version 2.2 is released with the notes
field added.
However since this issue isn't fixed will have to defer on 2.2 just for the moment.
Unfortunately the http_directory
parameter workaround doesn't work for Windows installs although its very useful as an alternate to the slow upload for winrm
.
Tx - John
Hmm - after talking with our Infra people, it looks like we don't have DRS enabled on our cluster anyway, so it may that the previous (2.1) release "worked" without specifying the host - so looking at a workaround on our side to determine a hostname to use for the build.
I've fixed floppy upload and published a new release 2.3. The issue with defaults is still actual but has a simple workaround.
@mkuzmin Thanks for the quick response on this. I've downloaded Version 2.3 and it appears to allocate a host again from the cluster if the hostname field is blank. It also populates the Notes field.
John
I am using 2.3 and I have the same issues. We have a cluster with DRS, so according to the doc, I should specify the datacenter, the cluster and my network.
Yet, I get the following error: "Build 'vsphere-iso' errored: error creating vm: host '' not found"
If I force a host, then I get this new error:
"Build 'vsphere-iso' errored: error creating vm: Host has multiple datastores. Specify it explicitly"
In a cluster with DRS, both the host and datasource should be coming from the DRS. This is not the case.
This appears related: https://github.com/jetbrains-infra/packer-builder-vsphere/issues/241
The first comment solves my error "ui,error,Build 'vsphere-iso' errored: error creating vm: host '' not found" However, this doesn't appear to be within the 'vsphere-iso/Working With Clusters And Hosts' documentation. Please can this be updated?