VMware: Can't remove NIC on VMs provisioned by Foreman

Foreman: 1.11.4
VMware vSphere 6.x

I hooked up vCenter to Foreman as a compute resource, and provisioned a
dozen CentOS 7 VMs using Foreman and Network Boot.

Now, when I try to remove some Network interfaces on some of the hosts,
vCenter complains with:

A specified parameter was not correct: configSpec.bootOptions.bootOrder

This looks a bit like the following RedHat/Satellite bug: https://access.redhat.com/solutions/2773751
(login required)

Has anyone else run into this with Foreman and vSphere?

-= Stefan

Yes, it's also an issue when creating a VMware Image to use for
provisioning through Foreman, Fog (the library that is being used for
almost all Compute Resources) makes the first boot device as the primary
network interface, this allows you to "rebuild" a VMware guest that was
provisioned through PXE (not Image), it's the same mechanism as
provisioning a physical server except Foreman does not modify the BIOS
setting a physical host.
The issue with using Fog (API calls) is that the setting is then being
written inside the guest vmx file, there are a few ways to fix it:

  1. Modify the vmx file manually: you have to remove the VM from the vCenter
    inventory, edit the vmx file and remove those lines (search for "hdd" and
    you will see the bootorder lines),
  2. You can try to boot the VM into BIOS and see if you can modify the BIOS
    settings, by what you experience, it should be locked though
  3. Modify the VM boot order using API calls (ruby/python/powershell/etc.)

I'm not familiar with Fog but i think the best option is to remove the
network card as a bootdevice once the guest build status is complete and
enable it once you decide to rebuild it.

··· On Tuesday, February 7, 2017 at 4:06:47 AM UTC+2, Stefan Lasiewski wrote: > > > Foreman: 1.11.4 > VMware vSphere 6.x > > I hooked up vCenter to Foreman as a compute resource, and provisioned a > dozen CentOS 7 VMs using Foreman and Network Boot. > > Now, when I try to remove some Network interfaces on some of the hosts, > vCenter complains with: > > A specified parameter was not correct: configSpec.bootOptions.bootOrder > > This looks a bit like the following RedHat/Satellite bug: > https://access.redhat.com/solutions/2773751 (login required) > > Has anyone else run into this with Foreman and vSphere? > > -= Stefan >

> 2) You can try to boot the VM into BIOS and see if you can modify the
BIOS settings, by what you experience, it should be locked though

Ah yes, this was the strange part. This part of the BIOS is locked, which
is frustrating. Looks like the BIOS bootorder is set to "User Mode" because
Foreman sets the bios.bootorder. This prevents the user from modifying the
Boot Order, according to what I read
on https://communities.vmware.com/thread/434314?start=0&tstart=0 .

> i think the best option is to remove the network card as a bootdevice

Last night I ended up removing both NICs from the VM and re-adding them.
That seems to have fixed this error. On a couple hosts, but not all hosts,
this also removed the NIC as a boot device and allowed us to re-arrange the
boot order in the BIOS.

For the record, this looks to be http://projects.theforeman.org/issues/14160

-= Stefan

-= Stefan

··· On Tuesday, February 7, 2017 at 4:36:37 AM UTC-8, Erez Zarum wrote: > > Yes, it's also an issue when creating a VMware Image to use for > provisioning through Foreman, Fog (the library that is being used for > almost all Compute Resources) makes the first boot device as the primary > network interface, this allows you to "rebuild" a VMware guest that was > provisioned through PXE (not Image), it's the same mechanism as > provisioning a physical server except Foreman does not modify the BIOS > setting a physical host. > The issue with using Fog (API calls) is that the setting is then being > written inside the guest vmx file, there are a few ways to fix it: > 1) Modify the vmx file manually: you have to remove the VM from the > vCenter inventory, edit the vmx file and remove those lines (search for > "hdd" and you will see the bootorder lines), > 2) You can try to boot the VM into BIOS and see if you can modify the BIOS > settings, by what you experience, it should be locked though > 3) Modify the VM boot order using API calls (ruby/python/powershell/etc.) > > I'm not familiar with Fog but i think the best option is to remove the > network card as a bootdevice once the guest build status is complete and > enable it once you decide to rebuild it. > > > > > On Tuesday, February 7, 2017 at 4:06:47 AM UTC+2, Stefan Lasiewski wrote: >> >> >> Foreman: 1.11.4 >> VMware vSphere 6.x >> >> I hooked up vCenter to Foreman as a compute resource, and provisioned a >> dozen CentOS 7 VMs using Foreman and Network Boot. >> >> Now, when I try to remove some Network interfaces on some of the hosts, >> vCenter complains with: >> >> A specified parameter was not correct: >> configSpec.bootOptions.bootOrder >> >> This looks a bit like the following RedHat/Satellite bug: >> https://access.redhat.com/solutions/2773751 (login required) >> >> Has anyone else run into this with Foreman and vSphere? >> >> -= Stefan >> >