"Provisioning using VMWare template fails with error "configSpec.bootOptions.bootOrder""

I've run into the above error and found what seemed to be a work around
here:

https://access.redhat.com/solutions/2773751

  • Convert the image Template into the VM.
  • Edit the "vmx" file and comment / remove the below lines.
··· --- bios.hddOrder bios.bootOrder --- - Convert the VM into the template again.

or

  • Take a backup and then edit the file create_vm.rb.

cp /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere*/lib/fog/vsphere/requests/compute/create_vm.rb /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere*/lib/fog/vsphere/requests/compute/create_vm.rb_backup

vi /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere*/lib/fog/vsphere/requests/compute/create_vm.rb


  • Comment the line #23.

22 vm_cfg[:firmware] = attributes[:firmware] if attributes.key?(:firmware)
23 #vm_cfg[:bootOptions] = boot_options(attributes) if attributes.key?(:boot_order) || attributes.key?(:boot_retry) # WORKAROUND
24 resource_pool = if attributes[:resource_pool] && attributes[:resource_pool] != ‘Resources’

  • Restart the services.

katello-service restart


I did both and still receive the error with Foreman 1.15.1 with VMware
ESXi, 6.5.0, 5969303. The template was created from a VM I built using
foreman if that has any effect.

So, follow up to this. It seems once you make the changes you need to
rebuild the VM you use as an image that will use the new changes. The boot
order parts are no longer present. Once I rebuilt a VM and then used that
as the image I could then use that image template to build others.

http://projects.theforeman.org/issues/14160

TLDR: its a bug in vmware that they may or may not fix, I couldn't get a straight answer out of my vmware contacts. A workaround is implemented in fog-vsphere that should go into 1.16 but there was a regression that still needs to be addressed (https://github.com/fog/fog-vsphere/pull/109).

Greetings
Klaas Demter

ATIX - The Linux & Open Source Company
www.atix.de

----- Ursprüngliche Mail -----

··· Von: "Mike Wilson" An: "Foreman users" Gesendet: Freitag, 8. September 2017 01:14:48 Betreff: [foreman-users] "Provisioning using VMWare template fails with error "configSpec.bootOptions.bootOrder""

I’ve run into the above error and found what seemed to be a work around
here:

https://access.redhat.com/solutions/2773751

  • Convert the image Template into the VM.
  • Edit the “vmx” file and comment / remove the below lines.

bios.hddOrder
bios.bootOrder

  • Convert the VM into the template again.

or

  • Take a backup and then edit the file create_vm.rb.

cp /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere*/lib/fog/vsphere/requests/compute/create_vm.rb /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere*/lib/fog/vsphere/requests/compute/create_vm.rb_backup

vi /opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere*/lib/fog/vsphere/requests/compute/create_vm.rb


  • Comment the line #23.

22 vm_cfg[:firmware] = attributes[:firmware] if attributes.key?(:firmware)
23 #vm_cfg[:bootOptions] = boot_options(attributes) if attributes.key?(:boot_order) || attributes.key?(:boot_retry) # WORKAROUND
24 resource_pool = if attributes[:resource_pool] && attributes[:resource_pool] != ‘Resources’

  • Restart the services.

katello-service restart


I did both and still receive the error with Foreman 1.15.1 with VMware
ESXi, 6.5.0, 5969303. The template was created from a VM I built using
foreman if that has any effect.


You received this message because you are subscribed to the Google Groups “Foreman users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.

So it's not muddy, the bit I am refering to here is this changes you make
to the "/opt/theforeman/tfm/root/usr/share/gems/gems/fog-vsphere*/
lib/fog/vsphere/requests/compute/create_vm.rb" file. Once that's done and
you rebuild a new VM that VM will not have the order bits and when you
convert to template that should work as image.

··· On Friday, September 8, 2017 at 10:33:58 AM UTC-5, Mike Wilson wrote: > > So, follow up to this. It seems once you make the changes you need to > rebuild the VM you use as an image that will use the new changes. The boot > order parts are no longer present. Once I rebuilt a VM and then used that > as the image I could then use that image template to build others. >