packer-builder-vsphere icon indicating copy to clipboard operation
packer-builder-vsphere copied to clipboard

DRS cluster doesn't detect default datastore and network

Open mkuzmin opened this issue 6 years ago • 13 comments

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

mkuzmin avatar Nov 01 '18 22:11 mkuzmin

I just ran across this same issue. Any idea when it might get addressed?

pagnmickie avatar Nov 26 '18 15:11 pagnmickie

Specify the value explicitly. This issue is not so easy to fix.

mkuzmin avatar Nov 26 '18 16:11 mkuzmin

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.

pagnmickie avatar Nov 26 '18 16:11 pagnmickie

Not sure I follow. On DRS-enabled clusters you don't need to specify host parameter.

mkuzmin avatar Nov 27 '18 12:11 mkuzmin

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.

thor avatar Dec 19 '18 15:12 thor

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 avatar Dec 23 '18 18:12 mkuzmin

@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

jcoconnor avatar Jan 02 '19 11:01 jcoconnor

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.

jcoconnor avatar Jan 02 '19 16:01 jcoconnor

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 avatar Jan 05 '19 04:01 mkuzmin

@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

jcoconnor avatar Jan 05 '19 12:01 jcoconnor

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.

pbusquemdf avatar Sep 20 '19 15:09 pbusquemdf

This appears related: https://github.com/jetbrains-infra/packer-builder-vsphere/issues/241

jkugler avatar Oct 08 '19 17:10 jkugler

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?

Guy-Rawsthorn avatar Nov 12 '20 15:11 Guy-Rawsthorn