VMware image provisioning fails with InvalidVmConfig/InvalidArgument after upgrade to 3.18.1 (firmware not normalized for image-based clone)

Hello all,

When provisioning a VM on VMware using image-based provisioning (clone from template) in Foreman 3.18.1, the clone operation fails with two distinct errors depending on the firmware setting selected in the UI:

UEFI or UEFI Secure Boot β†’ InvalidVmConfig: Invalid virtual machine configuration with property=config.bootOptions.efiSecureBootEnabled and message EFI secure boot could be enabled only on EFI firmware.

Problem:
When provisioning a VM on VMware using image-based provisioning (clone from template) in Foreman 3.18.1, the clone operation fails with two distinct errors depending on the firmware setting selected in the UI:

  1. UEFI or UEFI Secure Boot β†’ InvalidVmConfig: Invalid virtual machine configuration with property=config.bootOptions.efiSecureBootEnabled and message EFI secure boot could be enabled only on EFI firmware.
  2. UEFI (without Secure Boot) β†’ InvalidArgument: A specified parameter was not correct (no property detail)

Both errors originate from fog-vsphere vm_clone.rb receiving an invalid firmware value ('uefi' or 'uefi_secure_boot' instead of the vSphere API-expected 'efi').

Root cause analysis:

Foreman 3.18.1 introduced generate_secure_boot_settings and process_firmware_attributes in compute_resource.rb. The normalize_firmware_type method correctly translates 'uefi'/'uefi_secure_boot' β†’ 'efi', but only when firmware_type is present (i.e. when a PXE loader is set). For image-based provisioning, pxe_loader is empty, so firmware_type is blank, normalize_firmware_type is never called, and the raw UI value ('uefi') is passed directly to fog-vsphere and then to the vSphere API β€” which rejects it as invalid.

Additionally, Foreman 3.18.1 also introduced boot_order in the clone_vm opts (previously absent), which activates the bootOptions block in fog-vsphere vm_clone.rb. This block unconditionally sets efiSecureBootEnabled: options["secure_boot"] || false, causing vSphere to reject the spec even when Secure Boot is disabled, because rbvmomi2 3.8.0 now explicitly serializes false boolean values (previously they were omitted).

Expected outcome:
Image-based VM provisioning on VMware with UEFI, UEFI Secure Boot, or BIOS firmware should work correctly in Foreman 3.18.1 as it did in 3.17.0.

Proposed fixes:

Fix 1 β€” app/models/compute_resources/foreman/model/vmware.rb in clone_vm:

-        "firmware" => args[:firmware],
+        "firmware" => normalize_firmware_type(args[:firmware]),

Fix 2 β€” fog-vsphere lib/fog/vsphere/requests/compute/vm_clone.rb (line ~220):

-            virtual_machine_config_spec.bootOptions = { bootOrder: boot_order, efiSecureBootEnabled: options["secure_boot"] || false }
+            boot_options = { bootOrder: boot_order }
+            boot_options[:efiSecureBootEnabled] = true if options["secure_boot"] == true || options["secure_boot"] == "true"
+            virtual_machine_config_spec.bootOptions = boot_options

Foreman and Proxy versions:
Foreman 3.18.1 / Foreman Proxy 3.18.1

Foreman and Proxy plugin versions:

  • katello 4.20.0
  • foreman_remote_execution 16.5.3
  • foreman-tasks 11.1.1
  • foreman_puppet 9.1.0
  • rubygem-fog-vsphere 3.7.2
  • rubygem-rbvmomi2 3.8.0

Distribution and version:
Red Hat Enterprise Linux 9.7 (Plow)

Other relevant data:

  • The issue is a regression introduced in 3.18.1. Provisioning worked correctly in 3.17.x with the same fog-vsphere (3.7.2) and rbvmomi2 (3.8.0) versions.
  • The bug only affects image-based provisioning (clone from template). Network-based (PXE) provisioning is not affected because firmware_type is populated via pxe_loader in that flow, which triggers normalize_firmware_type.
  • Deploying the same template directly from vCenter works without error.
  • Relevant log extract:
vSphere fault detail: InvalidVmConfig @props={:faultMessage=>[{:key=>"msg.hostd.configSpec.efi", :message=>"EFI secure boot could be enabled only on EFI firmware."}], :property=>"config.bootOptions.efiSecureBootEnabled"}
  • Debug logging of vm_clone opts confirmed "firmware"=>"uefi" being sent to fog-vsphere instead of "firmware"=>"efi". After applying Fix 1, opts correctly show "firmware"=>"efi" and provisioning succeeds.

@nofaralfasi Some thoughts on this?

hi all,

similar problem here:
with foreman 3.18.1 I can not longer deploy VMs (…provisioning a VM on VMware using image-based provisioning (clone from template)…)
I have added the proposed fixes but nothing changed.

Here is my vpxd.log:

2026-04-30T10:49:40.367Z error vpxd\[3417177\] \[Originator@6876 sub=Default opID=14034394\] \[VpxLRO\] – ERROR task-7914930 – 52f2d835-bbec-4a87-edda-fbaa69c92b5e(5298dfb2-18b5-1594-97e4-531be045339c) – vm-2580609 – vim.VirtualMachine.clone: :vmodl.fault.InvalidArgument
 β†’ Result:
 β†’ (vmodl.fault.InvalidArgument) {
 β†’    faultCause = (vmodl.MethodFault) null,
 β†’    faultMessage = ,
 β†’    invalidProperty = 
 β†’    msg = "A specified parameter was not correct: "
 β†’ }
 β†’ Args:
 β†’ 
 β†’ Arg folder:
 β†’ β€˜vim.Folder:group-v397309’
 β†’ Arg name:
 β†’ β€œsles16test”
 β†’ Arg spec:
 β†’ (vim.vm.CloneSpec) {
 β†’    location = (vim.vm.RelocateSpec) {
 β†’       service = (vim.ServiceLocator) null,
 β†’       folder = β€˜vim.Folder:group-v397309’,
 β†’       datastore = β€˜vim.Datastore:datastore-265923’,
 β†’       diskMoveType = ,
 β†’       pool = β€˜vim.ResourcePool:resgroup-183043’,
 β†’       host = ,
 β†’       disk = (vim.vm.RelocateSpec.DiskLocator) \[
 β†’          (vim.vm.RelocateSpec.DiskLocator) {
 β†’             diskId = 2000,
 β†’             datastore = β€˜vim.Datastore:datastore-265923’,
 β†’             diskMoveType = ,
 β†’             diskBackingInfo = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
 β†’                fileName = β€œβ€,
 β†’                datastore = ,
 β†’                backingObjectId = ,
 β†’                diskMode = β€œpersistent”,
 β†’                split = ,
 β†’                writeThrough = ,
 β†’                thinProvisioned = true,
 β†’                eagerlyScrub = ,
 β†’                uuid = ,
 β†’                contentId = ,
 β†’                changeId = ,
 β†’                parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null,
 β†’                deltaDiskFormat = ,
 β†’                digestEnabled = ,
 β†’                deltaGrainSize = ,
 β†’                deltaDiskFormatVariant = ,
 β†’                sharing = ,
 β†’                keyId = (vim.encryption.CryptoKeyId) null,
 β†’                digestFormatVersion = 
 β†’             },
 β†’             profile = ,
 β†’             backing = (vim.vm.RelocateSpec.DiskLocator.BackingSpec) null,
 β†’             filterSpec = 
 β†’          }
 β†’       \],
 β†’       transform = ,
 β†’       deviceChange = ,
 β†’       profile = ,
 β†’       cryptoSpec = (vim.encryption.CryptoSpec) null
 β†’    },
 β†’    template = false,
 β†’    config = (vim.vm.ConfigSpec) {
 β†’       changeVersion = ,
 β†’       name = ,
 β†’       version = ,
 β†’       createDate = ,
 β†’       uuid = ,
 β†’       instanceUuid = ,
 β†’       npivNodeWorldWideName = ,
 β†’       npivPortWorldWideName = ,
 β†’       npivWorldWideNameType = ,
 β†’       npivDesiredNodeWwns = ,
 β†’       npivDesiredPortWwns = ,
 β†’       npivTemporaryDisabled = ,
 β†’       npivOnNonRdmDisks = ,
 β†’       npivWorldWideNameOp = ,
 β†’       locationId = ,
 β†’       guestId = ,
 β†’       alternateGuestName = ,
 β†’       annotation = β€œGenerate from Katello”,
 β†’       files = (vim.vm.FileInfo) null,
 β†’       tools = (vim.vm.ToolsConfigInfo) null,
 β†’       flags = (vim.vm.FlagInfo) null,
 β†’       consolePreferences = (vim.vm.ConsolePreferences) null,
 β†’       powerOpInfo = (vim.vm.DefaultPowerOpInfo) null,
 β†’       rebootPowerOff = ,
 β†’       numCPUs = 1,
 β†’       vcpuConfig = ,
 β†’       numCoresPerSocket = 1,
 β†’       memoryMB = 4096,
 β†’       memoryHotAddEnabled = ,
 β†’       cpuHotAddEnabled = ,
 β†’       cpuHotRemoveEnabled = ,
 β†’       virtualICH7MPresent = ,
 β†’       virtualSMCPresent = ,
 β†’       deviceChange = (vim.vm.device.VirtualDeviceSpec) \[
 β†’          (vim.vm.device.VirtualDeviceSpec) {
 β†’             operation = β€œedit”,
 β†’             fileOperation = ,
 β†’             device = (vim.vm.device.VirtualVmxnet3) {
 β†’                dynamicProperty = ,
 β†’                key = 4000,
 β†’                deviceInfo = (vim.Description) {
 β†’                   label = β€œNetwork adapter 1”,
 β†’                   summary = β€œDVSwitch: 50 24 f6 92 8e 98 66 0a-a5 45 17 46 90 a9 64 0c”
 β†’                },
 β†’                backing = (vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo) {
 β†’                   port = (vim.dvs.PortConnection) {
 β†’                      switchUuid = β€œ50 24 f6 92 8e 98 66 0a-a5 45 17 46 90 a9 64 0c”,
 β†’                      portgroupKey = β€œdvportgroup-183031”,
 β†’                      portKey = ,
 β†’                      connectionCookie = 
 β†’                   }
 β†’                },
 β†’                connectable = (vim.vm.device.VirtualDevice.ConnectInfo) {
 β†’                   migrateConnect = ,
 β†’                   startConnected = true,
 β†’                   allowGuestControl = true,
 β†’                   connected = true,
 β†’                   status = 
 β†’                },
 β†’                slotInfo = (vim.vm.device.VirtualDevice.PciBusSlotInfo) {
 β†’                   pciSlotNumber = 33
 β†’                },
 β†’                controllerKey = 100,
 β†’                unitNumber = 7,
 β†’                numaNode = ,
 β†’                deviceGroupInfo = (vim.vm.device.VirtualDevice.DeviceGroupInfo) null,
 β†’                addressType = β€œgenerated”,
 β†’                macAddress = ,
 β†’                wakeOnLanEnabled = true,
 β†’                resourceAllocation = (vim.vm.device.VirtualEthernetCard.ResourceAllocation) {
 β†’                   reservation = 0,
 β†’                   share = (vim.SharesInfo) {
 β†’                      shares = 50,
 β†’                      level = β€œnormal”
 β†’                   },
 β†’                   limit = -1
 β†’                },
 β†’                externalId = ,
 β†’                uptCompatibilityEnabled = true,
 β†’                uptv2Enabled = false,
 β†’                realTimeEnabled = 
 β†’             },
 β†’             profile = ,
 β†’             backing = (vim.vm.device.VirtualDeviceSpec.BackingSpec) null,
 β†’             filterSpec = ,
 β†’             changeMode = 
 β†’          },
 β†’          (vim.vm.device.VirtualDeviceSpec) {
 β†’             operation = β€œedit”,
 β†’             fileOperation = ,
 β†’             device = (vim.vm.device.VirtualDisk) {
 β†’                key = 2000,
 β†’                deviceInfo = (vim.Description) {
 β†’                   label = β€œHard disk 1”,
 β†’                   summary = β€œ52,428,800 KB”
 β†’                },
 β†’                backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
 β†’                   fileName = β€œ\[NFS_DANA19R1CL_Template\] SLES16.0_template_katello_test/SLES16.0_template_katello_test_4.vmdk”,
 β†’                   datastore = β€˜vim.Datastore:datastore-1317869’,
 β†’                   backingObjectId = β€œβ€,
 β†’                   diskMode = β€œpersistent”,
 β†’                   split = false,
 β†’                   writeThrough = false,
 β†’                   thinProvisioned = true,
 β†’                   eagerlyScrub = false,
 β†’                   uuid = β€œ6000C295-3355-9c6a-bf80-39c9acab018e”,
 β†’                   contentId = β€œ206e76ffef688bf23145dc3885192c4a”,
 β†’                   changeId = ,
 β†’                   parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null,
 β†’                   deltaDiskFormat = ,
 β†’                   digestEnabled = false,
 β†’                   deltaGrainSize = ,
 β†’                   deltaDiskFormatVariant = ,
 β†’                   sharing = β€œsharingNone”,
 β†’                   keyId = (vim.encryption.CryptoKeyId) null,
 β†’                   digestFormatVersion = 
 β†’                },
 β†’                connectable = (vim.vm.device.VirtualDevice.ConnectInfo) null,
 β†’                slotInfo = (vim.vm.device.VirtualDevice.BusSlotInfo) null,
 β†’                controllerKey = 1000,
 β†’                unitNumber = 0,
 β†’                numaNode = ,
 β†’                deviceGroupInfo = (vim.vm.device.VirtualDevice.DeviceGroupInfo) null,
 β†’                capacityInKB = 52428800,
 β†’                capacityInBytes = 53687091200,
 β†’                shares = (vim.SharesInfo) {
 β†’                   shares = 1000,
 β†’                   level = β€œnormal”
 β†’                },
 β†’                storageIOAllocation = (vim.StorageResourceManager.IOAllocationInfo) {
 β†’                   limit = -1,
 β†’                   shares = (vim.SharesInfo) {
 β†’                      shares = 1000,
 β†’                      level = β€œnormal”
 β†’                   },
 β†’                   reservation = 0
 β†’                },
 β†’                diskObjectId = β€œ32929-2000”,
 β†’                vFlashCacheConfigInfo = (vim.vm.device.VirtualDisk.VFlashCacheConfigInfo) null,
 β†’                iofilter = ,
 β†’                vDiskId = (vim.vslm.ID) null,
 β†’                vDiskVersion = 1,
 β†’                virtualDiskFormat = ,
 β†’                nativeUnmanagedLinkedClone = false,
 β†’                independentFilters = ,
 β†’                guestReadOnly = false
 β†’             },
 β†’             profile = ,
 β†’             backing = (vim.vm.device.VirtualDeviceSpec.BackingSpec) null,
 β†’             filterSpec = ,
 β†’             changeMode = 
 β†’          }
 β†’       \],
 β†’       cpuAllocation = (vim.ResourceAllocationInfo) null,
 β†’       memoryAllocation = (vim.ResourceAllocationInfo) null,
 β†’       latencySensitivity = (vim.LatencySensitivity) null,
 β†’       cpuAffinity = (vim.vm.AffinityInfo) null,
 β†’       memoryAffinity = (vim.vm.AffinityInfo) null,
 β†’       networkShaper = (vim.vm.NetworkShaperInfo) null,
 β†’       cpuFeatureMask = ,
 β†’       extraConfig = ,
 β†’       swapPlacement = ,
 β†’       bootOptions = (vim.vm.BootOptions) {
 β†’          bootDelay = ,
 β†’          enterBIOSSetup = ,
 β†’          efiSecureBootEnabled = false,
 β†’          bootRetryEnabled = ,
 β†’          bootRetryDelay = ,
 β†’          bootOrder = (vim.vm.BootOptions.BootableDevice) \[
 β†’             (vim.vm.BootOptions.BootableDiskDevice) {
 β†’                deviceKey = 2000
 β†’             }
 β†’          \],
 β†’          networkBootProtocol = 
 β†’       },
 β†’       vAppConfig = (vim.vApp.VmConfigSpec) null,
 β†’       ftInfo = (vim.vm.FaultToleranceConfigInfo) null,
 β†’       repConfig = (vim.vm.ReplicationConfigSpec) null,
 β†’       vAppConfigRemoved = ,
 β†’       vAssertsEnabled = ,
 β†’       changeTrackingEnabled = ,
 β†’       firmware = β€œuefi”,
 β†’       maxMksConnections = ,
 β†’       guestAutoLockEnabled = ,
 β†’       managedBy = (vim.ext.ManagedByInfo) null,
 β†’       memoryReservationLockedToMax = ,
 β†’       nestedHVEnabled = ,
 β†’       vPMCEnabled = ,
 β†’       scheduledHardwareUpgradeInfo = (vim.vm.ScheduledHardwareUpgradeInfo) null,
 β†’       vmProfile = ,
 β†’       messageBusTunnelEnabled = ,
 β†’       crypto = (vim.encryption.CryptoSpec) null,
 β†’       migrateEncryption = ,
 β†’       sgxInfo = (vim.vm.SgxInfo) null,
 β†’       ftEncryptionMode = ,
 β†’       guestMonitoringModeInfo = (vim.vm.GuestMonitoringModeInfo) null,
 β†’       sevEnabled = ,
 β†’       virtualNuma = (vim.vm.VirtualNuma) null,
 β†’       motherboardLayout = ,
 β†’       pmemFailoverEnabled = ,
 β†’       vmxStatsCollectionEnabled = ,
 β†’       vmOpNotificationToAppEnabled = ,
 β†’       vmOpNotificationTimeout = ,
 β†’       deviceSwap = (vim.vm.VirtualDeviceSwap) null,
 β†’       simultaneousThreads = ,
 β†’       pmem = (vim.vm.VirtualPMem) null,
 β†’       deviceGroups = (vim.vm.VirtualDeviceGroups) null,
 β†’       fixedPassthruHotPlugEnabled = ,
 β†’       metroFtEnabled = ,
 β†’       metroFtHostGroup = ,
 β†’       tdxEnabled = ,
 β†’       sevSnpEnabled = 
 β†’    },
 β†’    customization = (vim.vm.customization.Specification) {
 β†’       options = (vim.vm.customization.Options) null,
 β†’       identity = (vim.vm.customization.LinuxPrep) {
 β†’          hostName = (vim.vm.customization.FixedName) {
 β†’             name = β€œsles16test”
 β†’          },
 β†’          domain = β€œda.doehler.com”,
 β†’          timeZone = β€œUTC”,
 β†’          hwClockUTC = true,
 β†’          scriptText = ,
 β†’          compatibleCustomizationMethod = 
 β†’       },
 β†’       globalIPSettings = (vim.vm.customization.GlobalIPSettings) {
 β†’          dnsSuffixList = (string) \[
 β†’             β€œda.doehler.com”
 β†’          \],
 β†’          dnsServerList = (string) \[
 β†’             β€œ192.168.175.20”,
 β†’             β€œ192.168.176.20”
 β†’          \]
 β†’       },
 β†’       nicSettingMap = (vim.vm.customization.AdapterMapping) \[
 β†’          (vim.vm.customization.AdapterMapping) {
 β†’             macAddress = ,
 β†’             adapter = (vim.vm.customization.IPSettings) {
 β†’                ip = (vim.vm.customization.FixedIp) {
 β†’                   ipAddress = β€œ192.168.182.92”
 β†’                },
 β†’                subnetMask = β€œ255.255.255.128”,
 β†’                gateway = (string) \[
 β†’                   β€œ192.168.182.126”
 β†’                \],
 β†’                ipV6Spec = (vim.vm.customization.IPSettings.IpV6AddressSpec) null,
 β†’                dnsServerList = (string) \[
 β†’                   β€œ192.168.175.20”,
 β†’                   β€œ192.168.176.20”
 β†’                \],
 β†’                dnsDomain = β€œda.doehler.com”,
 β†’                primaryWINS = ,
 β†’                secondaryWINS = ,
 β†’                netBIOS = 
 β†’             }
 β†’          }
 β†’       \],
 β†’       encryptionKey = 
 β†’    },
 β†’    powerOn = false,
 β†’    snapshot = ,
 β†’    memory = ,
 β†’    tpmProvisionPolicy = 
 β†’ }

hi all,

similar problem here:
with foreman 3.18.1 I can not longer deploy VMs (…provisioning a VM on VMware using image-based provisioning (clone from template)…)
I have added the proposed fixes but nothing changed.

Here is my vpxd.log:

2026-04-30T10:49:40.367Z error vpxd\[3417177\] \[Originator@6876 sub=Default opID=14034394\] \[VpxLRO\] – ERROR task-7914930 – 52f2d835-bbec-4a87-edda-fbaa69c92b5e(5298dfb2-18b5-1594-97e4-531be045339c) – vm-2580609 – vim.VirtualMachine.clone: :vmodl.fault.InvalidArgument
β†’ Result:
β†’ (vmodl.fault.InvalidArgument) {
β†’    faultCause = (vmodl.MethodFault) null,
β†’    faultMessage = ,
β†’    invalidProperty =
β†’    msg = "A specified parameter was not correct: "
β†’ }
β†’ Args:
β†’
β†’ Arg folder:
β†’ β€˜vim.Folder:group-v397309’
β†’ Arg name:
β†’ β€œsles16test”
β†’ Arg spec:
β†’ (vim.vm.CloneSpec) {
β†’    location = (vim.vm.RelocateSpec) {
β†’       service = (vim.ServiceLocator) null,
β†’       folder = β€˜vim.Folder:group-v397309’,
β†’       datastore = β€˜vim.Datastore:datastore-265923’,
β†’       diskMoveType = ,
β†’       pool = β€˜vim.ResourcePool:resgroup-183043’,
β†’       host = ,
β†’       disk = (vim.vm.RelocateSpec.DiskLocator) \[
β†’          (vim.vm.RelocateSpec.DiskLocator) {
β†’             diskId = 2000,
β†’             datastore = β€˜vim.Datastore:datastore-265923’,
β†’             diskMoveType = ,
β†’             diskBackingInfo = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
β†’                fileName = β€œβ€,
β†’                datastore = ,
β†’                backingObjectId = ,
β†’                diskMode = β€œpersistent”,
β†’                split = ,
β†’                writeThrough = ,
β†’                thinProvisioned = true,
β†’                eagerlyScrub = ,
β†’                uuid = ,
β†’                contentId = ,
β†’                changeId = ,
β†’                parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null,
β†’                deltaDiskFormat = ,
β†’                digestEnabled = ,
β†’                deltaGrainSize = ,
β†’                deltaDiskFormatVariant = ,
β†’                sharing = ,
β†’                keyId = (vim.encryption.CryptoKeyId) null,
β†’                digestFormatVersion =
β†’             },
β†’             profile = ,
β†’             backing = (vim.vm.RelocateSpec.DiskLocator.BackingSpec) null,
β†’             filterSpec =
β†’          }
β†’       \],
β†’       transform = ,
β†’       deviceChange = ,
β†’       profile = ,
β†’       cryptoSpec = (vim.encryption.CryptoSpec) null
β†’    },
β†’    template = false,
β†’    config = (vim.vm.ConfigSpec) {
β†’       changeVersion = ,
β†’       name = ,
β†’       version = ,
β†’       createDate = ,
β†’       uuid = ,
β†’       instanceUuid = ,
β†’       npivNodeWorldWideName = ,
β†’       npivPortWorldWideName = ,
β†’       npivWorldWideNameType = ,
β†’       npivDesiredNodeWwns = ,
β†’       npivDesiredPortWwns = ,
β†’       npivTemporaryDisabled = ,
β†’       npivOnNonRdmDisks = ,
β†’       npivWorldWideNameOp = ,
β†’       locationId = ,
β†’       guestId = ,
β†’       alternateGuestName = ,
β†’       annotation = β€œGenerate from Katello”,
β†’       files = (vim.vm.FileInfo) null,
β†’       tools = (vim.vm.ToolsConfigInfo) null,
β†’       flags = (vim.vm.FlagInfo) null,
β†’       consolePreferences = (vim.vm.ConsolePreferences) null,
β†’       powerOpInfo = (vim.vm.DefaultPowerOpInfo) null,
β†’       rebootPowerOff = ,
β†’       numCPUs = 1,
β†’       vcpuConfig = ,
β†’       numCoresPerSocket = 1,
β†’       memoryMB = 4096,
β†’       memoryHotAddEnabled = ,
β†’       cpuHotAddEnabled = ,
β†’       cpuHotRemoveEnabled = ,
β†’       virtualICH7MPresent = ,
β†’       virtualSMCPresent = ,
β†’       deviceChange = (vim.vm.device.VirtualDeviceSpec) \[
β†’          (vim.vm.device.VirtualDeviceSpec) {
β†’             operation = β€œedit”,
β†’             fileOperation = ,
β†’             device = (vim.vm.device.VirtualVmxnet3) {
β†’                dynamicProperty = ,
β†’                key = 4000,
β†’                deviceInfo = (vim.Description) {
β†’                   label = β€œNetwork adapter 1”,
β†’                   summary = β€œDVSwitch: 50 24 f6 92 8e 98 66 0a-a5 45 17 46 90 a9 64 0c”
β†’                },
β†’                backing = (vim.vm.device.VirtualEthernetCard.DistributedVirtualPortBackingInfo) {
β†’                   port = (vim.dvs.PortConnection) {
β†’                      switchUuid = β€œ50 24 f6 92 8e 98 66 0a-a5 45 17 46 90 a9 64 0c”,
β†’                      portgroupKey = β€œdvportgroup-183031”,
β†’                      portKey = ,
β†’                      connectionCookie =
β†’                   }
β†’                },
β†’                connectable = (vim.vm.device.VirtualDevice.ConnectInfo) {
β†’                   migrateConnect = ,
β†’                   startConnected = true,
β†’                   allowGuestControl = true,
β†’                   connected = true,
β†’                   status =
β†’                },
β†’                slotInfo = (vim.vm.device.VirtualDevice.PciBusSlotInfo) {
β†’                   pciSlotNumber = 33
β†’                },
β†’                controllerKey = 100,
β†’                unitNumber = 7,
β†’                numaNode = ,
β†’                deviceGroupInfo = (vim.vm.device.VirtualDevice.DeviceGroupInfo) null,
β†’                addressType = β€œgenerated”,
β†’                macAddress = ,
β†’                wakeOnLanEnabled = true,
β†’                resourceAllocation = (vim.vm.device.VirtualEthernetCard.ResourceAllocation) {
β†’                   reservation = 0,
β†’                   share = (vim.SharesInfo) {
β†’                      shares = 50,
β†’                      level = β€œnormal”
β†’                   },
β†’                   limit = -1
β†’                },
β†’                externalId = ,
β†’                uptCompatibilityEnabled = true,
β†’                uptv2Enabled = false,
β†’                realTimeEnabled =
β†’             },
β†’             profile = ,
β†’             backing = (vim.vm.device.VirtualDeviceSpec.BackingSpec) null,
β†’             filterSpec = ,
β†’             changeMode =
β†’          },
β†’          (vim.vm.device.VirtualDeviceSpec) {
β†’             operation = β€œedit”,
β†’             fileOperation = ,
β†’             device = (vim.vm.device.VirtualDisk) {
β†’                key = 2000,
β†’                deviceInfo = (vim.Description) {
β†’                   label = β€œHard disk 1”,
β†’                   summary = β€œ52,428,800 KB”
β†’                },
β†’                backing = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) {
β†’                   fileName = β€œ\[NFS_DANA19R1CL_Template\] SLES16.0_template_katello_test/SLES16.0_template_katello_test_4.vmdk”,
β†’                   datastore = β€˜vim.Datastore:datastore-1317869’,
β†’                   backingObjectId = β€œβ€,
β†’                   diskMode = β€œpersistent”,
β†’                   split = false,
β†’                   writeThrough = false,
β†’                   thinProvisioned = true,
β†’                   eagerlyScrub = false,
β†’                   uuid = β€œ6000C295-3355-9c6a-bf80-39c9acab018e”,
β†’                   contentId = β€œ206e76ffef688bf23145dc3885192c4a”,
β†’                   changeId = ,
β†’                   parent = (vim.vm.device.VirtualDisk.FlatVer2BackingInfo) null,
β†’                   deltaDiskFormat = ,
β†’                   digestEnabled = false,
β†’                   deltaGrainSize = ,
β†’                   deltaDiskFormatVariant = ,
β†’                   sharing = β€œsharingNone”,
β†’                   keyId = (vim.encryption.CryptoKeyId) null,
β†’                   digestFormatVersion =
β†’                },
β†’                connectable = (vim.vm.device.VirtualDevice.ConnectInfo) null,
β†’                slotInfo = (vim.vm.device.VirtualDevice.BusSlotInfo) null,
β†’                controllerKey = 1000,
β†’                unitNumber = 0,
β†’                numaNode = ,
β†’                deviceGroupInfo = (vim.vm.device.VirtualDevice.DeviceGroupInfo) null,
β†’                capacityInKB = 52428800,
β†’                capacityInBytes = 53687091200,
β†’                shares = (vim.SharesInfo) {
β†’                   shares = 1000,
β†’                   level = β€œnormal”
β†’                },
β†’                storageIOAllocation = (vim.StorageResourceManager.IOAllocationInfo) {
β†’                   limit = -1,
β†’                   shares = (vim.SharesInfo) {
β†’                      shares = 1000,
β†’                      level = β€œnormal”
β†’                   },
β†’                   reservation = 0
β†’                },
β†’                diskObjectId = β€œ32929-2000”,
β†’                vFlashCacheConfigInfo = (vim.vm.device.VirtualDisk.VFlashCacheConfigInfo) null,
β†’                iofilter = ,
β†’                vDiskId = (vim.vslm.ID) null,
β†’                vDiskVersion = 1,
β†’                virtualDiskFormat = ,
β†’                nativeUnmanagedLinkedClone = false,
β†’                independentFilters = ,
β†’                guestReadOnly = false
β†’             },
β†’             profile = ,
β†’             backing = (vim.vm.device.VirtualDeviceSpec.BackingSpec) null,
β†’             filterSpec = ,
β†’             changeMode =
β†’          }
β†’       \],
β†’       cpuAllocation = (vim.ResourceAllocationInfo) null,
β†’       memoryAllocation = (vim.ResourceAllocationInfo) null,
β†’       latencySensitivity = (vim.LatencySensitivity) null,
β†’       cpuAffinity = (vim.vm.AffinityInfo) null,
β†’       memoryAffinity = (vim.vm.AffinityInfo) null,
β†’       networkShaper = (vim.vm.NetworkShaperInfo) null,
β†’       cpuFeatureMask = ,
β†’       extraConfig = ,
β†’       swapPlacement = ,
β†’       bootOptions = (vim.vm.BootOptions) {
β†’          bootDelay = ,
β†’          enterBIOSSetup = ,
β†’          efiSecureBootEnabled = false,
β†’          bootRetryEnabled = ,
β†’          bootRetryDelay = ,
β†’          bootOrder = (vim.vm.BootOptions.BootableDevice) \[
β†’             (vim.vm.BootOptions.BootableDiskDevice) {
β†’                deviceKey = 2000
β†’             }
β†’          \],
β†’          networkBootProtocol =
β†’       },
β†’       vAppConfig = (vim.vApp.VmConfigSpec) null,
β†’       ftInfo = (vim.vm.FaultToleranceConfigInfo) null,
β†’       repConfig = (vim.vm.ReplicationConfigSpec) null,
β†’       vAppConfigRemoved = ,
β†’       vAssertsEnabled = ,
β†’       changeTrackingEnabled = ,
β†’       **firmware = β€œuefi”,**
β†’       maxMksConnections = ,
β†’       guestAutoLockEnabled = ,
β†’       managedBy = (vim.ext.ManagedByInfo) null,
β†’       memoryReservationLockedToMax = ,
β†’       nestedHVEnabled = ,
β†’       vPMCEnabled = ,
β†’       scheduledHardwareUpgradeInfo = (vim.vm.ScheduledHardwareUpgradeInfo) null,
β†’       vmProfile = ,
β†’       messageBusTunnelEnabled = ,
β†’       crypto = (vim.encryption.CryptoSpec) null,
β†’       migrateEncryption = ,
β†’       sgxInfo = (vim.vm.SgxInfo) null,
β†’       ftEncryptionMode = ,
β†’       guestMonitoringModeInfo = (vim.vm.GuestMonitoringModeInfo) null,
β†’       sevEnabled = ,
β†’       virtualNuma = (vim.vm.VirtualNuma) null,
β†’       motherboardLayout = ,
β†’       pmemFailoverEnabled = ,
β†’       vmxStatsCollectionEnabled = ,
β†’       vmOpNotificationToAppEnabled = ,
β†’       vmOpNotificationTimeout = ,
β†’       deviceSwap = (vim.vm.VirtualDeviceSwap) null,
β†’       simultaneousThreads = ,
β†’       pmem = (vim.vm.VirtualPMem) null,
β†’       deviceGroups = (vim.vm.VirtualDeviceGroups) null,
β†’       fixedPassthruHotPlugEnabled = ,
β†’       metroFtEnabled = ,
β†’       metroFtHostGroup = ,
β†’       tdxEnabled = ,
β†’       sevSnpEnabled =
β†’    },
β†’    customization = (vim.vm.customization.Specification) {
β†’       options = (vim.vm.customization.Options) null,
β†’       identity = (vim.vm.customization.LinuxPrep) {
β†’          hostName = (vim.vm.customization.FixedName) {
β†’             name = β€œsles16test”
β†’          },
β†’          domain = β€œda.doehler.com”,
β†’          timeZone = β€œUTC”,
β†’          hwClockUTC = true,
β†’          scriptText = ,
β†’          compatibleCustomizationMethod =
β†’       },
β†’       globalIPSettings = (vim.vm.customization.GlobalIPSettings) {
β†’          dnsSuffixList = (string) \[
β†’             β€œda.doehler.com”
β†’          \],
β†’          dnsServerList = (string) \[
β†’             β€œ192.168.175.20”,
β†’             β€œ192.168.176.20”
β†’          \]
β†’       },
β†’       nicSettingMap = (vim.vm.customization.AdapterMapping) \[
β†’          (vim.vm.customization.AdapterMapping) {
β†’             macAddress = ,
β†’             adapter = (vim.vm.customization.IPSettings) {
β†’                ip = (vim.vm.customization.FixedIp) {
β†’                   ipAddress = β€œ192.168.182.92”
β†’                },
β†’                subnetMask = β€œ255.255.255.128”,
β†’                gateway = (string) \[
β†’                   β€œ192.168.182.126”
β†’                \],
β†’                ipV6Spec = (vim.vm.customization.IPSettings.IpV6AddressSpec) null,
β†’                dnsServerList = (string) \[
β†’                   β€œ192.168.175.20”,
β†’                   β€œ192.168.176.20”
β†’                \],
β†’                dnsDomain = β€œda.doehler.com”,
β†’                primaryWINS = ,
β†’                secondaryWINS = ,
β†’                netBIOS =
β†’             }
β†’          }
β†’       \],
β†’       encryptionKey =
β†’    },
β†’    powerOn = false,
β†’    snapshot = ,
β†’    memory = ,
β†’    tpmProvisionPolicy =
β†’ }

ok, firmware = automatic gives the same error

and by the way … with 3.16 everything was fine

ok ok, the source of my problem was that I was running an outdated version of vServer (8.0.3.0400). After upgrading to 8.0.3.0900, I’ve been able to deploy my VMs without any issues (so far).

1 Like

Hello,

version 8.0.3.00900 released?

Hi @orelops95 ,
I was not able to replicate the issue. I’m still working on it, but in the meantime, I pushed PRs with your suggested fixes so the community can use the packit rpms for testing.

Can you please share your GitHub account so I can co-author with you?
The changes look good to me, but it would be great to have some proof of work from other community members.

Hi @lstejska,

my account github: orelops95

This is what I don’t understand. The explained logic sounds solid, but hosts usually have a PXE loader defined even if using image based provisioning, usually, from the OS.

Could it be that the OS as you have it defined in Foreman has no PXE templates assigned?

Okay, I was able to reproduce this issue with the following setup:

  • an operating system that has no PXE-related templates assigned
  • a hostgroup that has no PXE loader defined (not β€œNone”, no at all)

btw, is ths a valid scenario?

If you only deploy image based, there is no need to have any of the PXE-related stuff configured, I’d say. (Read: yes)

We also experienced this issue and are on vSphere Client version 8.0.3.00800. Here is a fix we applied:

Modify the def create_vm(args = {}) block in /usr/share/foreman/app/models/compute_resources/foreman/model/vmware.rb

Should look similar:

    def create_vm(args = { })
      vm = nil
      test_connection
      return unless errors.empty?

      args = parse_networks(args)
      args = args.with_indifferent_access
      # HOTFIX FOR WINDOWS 2022 UEFI VALIDATION
      if args[:firmware] == 'uefi' || args['firmware'] == 'uefi'
        args[:firmware] = 'efi'
      end

After modifying, restart foreman services.

FTR, Fixes #39310 - Normalize firmware type for image based provisioning by stejskalleos Β· Pull Request #10982 Β· theforeman/foreman Β· GitHub was merged and Bug #39310: VMware - Normalize firmware type in clone args - Foreman indicates it’s fixed in 3.18.2 and later releases.

The fix does the same args transformation, but in a differently integrated way :slight_smile: