jetbrains-infra / packer-builder-vsphere

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

ISO builder does not support building VMs at hardware version 9 #110

Open cfryanr opened 6 years ago

cfryanr commented 6 years ago

Thanks for creating this open source tool. It's fantastic!

We're using the ISO builder to create VMs on vSphere 6.5, and we would like those VMs to be usable on older versions of vSphere, so we are setting the VM hardware version to version 9. The builder is able to create the VM with the appropriate hardware version. However, that VM cannot actually boot on older versions of vSphere.

The issue is that the code creates a CDROM drive and attaches it to a SATA controller. SATA controllers are not supported by hardware version 9 (citation). Any VM that has a SATA controller will not boot on older vSpheres. Luckily, IDE controllers are supported by every hardware version, so the solution is simply to always use an IDE controller to attach the CDROM drive.

We implemented this SATA->IDE change in our fork to make sure that this approach would work (see commit diff). It worked great! Note that this commit was based on your v2.0-beta4 code, so in addition to changing the CDROM's controller, we also had to add the ability to set the hardware version. It appears that you have since added he ability to set the hardware version to v2.0, so you can ignore those portions of the commit.

Might you consider making a similar change to remove the SATA controller and replace it with an IDE controller as an enhancement request?

Thanks for a great tool!

mkuzmin commented 6 years ago

I agree, we need to make SATA optional, and use IDE by default. The only reason using it was macOS - not a mainstream use case

mkuzmin commented 5 years ago

even without SATA controller, a minimal config is still incompatible with version 9

mkuzmin commented 5 years ago

@cfryanr I need your help here. If I set hardware version to 9, even for a minimal VM configuration, vSphere API returns an error:

The virtual machine version is not compatible with the version of the host 'esxi-1.vsphere65.test'.

Here is a snippet of code https://gist.github.com/mkuzmin/afea4017b38c47a9b09a76bd2a6242e0

Any ideas what would be a reason?

cfryanr commented 5 years ago

Hi,

This works in our fork, which we are still using. However, our fork is based on an old version of the project. I suspect that perhaps a later version of the project might have introduced a different hardware incompatibility aside from the SATA controller. Take a look at this page to see what is allowed/disallowed in hardware version 9:

https://docs.vmware.com/en/VMware-vSphere/6.5/com.vmware.vsphere.vm_admin.doc/GUID-789C3913-1053-4850-A0F0-E29C3D32B6DA.html

I’ve asked my teammates if they have some time to please see if they could help you more.

On Tue, Oct 30, 2018 at 3:46 AM Michael Kuzmin notifications@github.com wrote:

@cfryanr https://github.com/cfryanr I need your help here. If I set hardware version to 9, even for a minimal VM configuration, vSphere API returns an error:

The virtual machine version is not compatible with the version of the host 'esxi-1.vsphere65.test'.

Here is a snippet of code https://gist.github.com/mkuzmin/afea4017b38c47a9b09a76bd2a6242e0

Any ideas what would be a reason?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/jetbrains-infra/packer-builder-vsphere/issues/110#issuecomment-434253201, or mute the thread https://github.com/notifications/unsubscribe-auth/AX2suwGuBBYN1uSydXhX0HiCBKpO5KbMks5uqC4GgaJpZM4UOief .

mkuzmin commented 5 years ago

My minimal gist above contains nothing special, and still reproduces the issue. I appreciate if you directly communicate this to govmomi team or VMware support.