jetbrains-infra / packer-builder-vsphere

Packer plugin for remote builds on VMware vSphere
Mozilla Public License 2.0
542 stars 175 forks source link

Support latest version of Packer 1.5.x #306

Closed jmgilman closed 4 years ago

jmgilman commented 4 years ago

The latest version of Packer at the time of this writing is 1.5.4. When attempting to use either the vsphere-iso or vsphere-clone plugins with this version, it generates an API error.

packer-builder-vsphere v2.3 only supports API version 4 packer 1.5.4 uses API version 5

Currently, I'm having to revert to using Packer 1.4.5 to get the plugins to work.

holdenSK commented 4 years ago

AFAIK, vsphere-iso is now integrated into core packer build.

codefox42 commented 4 years ago

Yes - since 1.5.2. :-) I needed to uninstall the old plugin (i.e. remove it from any of the plugin paths) before packer uses the new bundled vsphere builders.

Though, a hint in the main readme would be helpful.

jmgilman commented 4 years ago

Ah, that's not surprising considering how useful these plugins were. I would recommend adding a blurb to the README to prevent this issue coming up again. Thanks!

mooperd commented 4 years ago

Hi - so the vsphere-iso is being merged but the vsphere-clone is being dropped?

codefox42 commented 4 years ago

Both builders have been merged - see also the official docs: vsphere-iso, vsphere-clone

mooperd commented 4 years ago

Thats wonderful! thanks!

One thing which is confusing me about "vsphere-clone" is how I can use the official ubuntu images which have no password. Can "vsphere-clone" inject its own credentials into the image the same as AWS/Google or does the base image have to have a known username/password preseeded?

jmgilman commented 4 years ago

This is outside the scope of this issue, but I'll comment on your question:

If you're already building from an ISO (before you clone), you're likely already using a preseed to automate the installation. You'll have to hardcode a password into the preseed if you want to be able to immediately provision the OS when it comes up.

In our case our provisioner immediately changes the password once it connects using the password created in the preseed (we also only do key based SSH authentication anyways, so it's a moot point for security). You could alternatively dynamically fill in the preseed password at runtime before handing it off to Packer.

If you're not preseeding beforehand, you could try mounting some files before booting and using cloud-init to bootstrap it.

I'm going to close this issue since the original ask has technically been achieved through adoption from Packer.