You experience a failure when deploying an OVF in vCenter Server. During the deployment process, the virtual machine unexpectedly powers on before the OVA import task is completed, causing the deployment to fail.
When this issue occurs, you will observe the following error in the /var/log/vmware/vpxd/vpxd.log indicating that the VM was in an invalid power state:
error vpxd[####] [Originator@####sub=StateLock opID=####] [VpxdVmStateLocker::ValidateObject] VM <VM_Name>: PowerState = poweredOn, expected PowerState = poweredOff
error vpxd[####] [Originator@####sub=Default opID=####] [VpxLRO] -- ERROR task-####-- -- Resources -- ResourcePool.ImportVAppLRO: :vim.fault.InvalidPowerState
--> Result:
--> (vim.fault.InvalidPowerState) {
--> faultCause = (vmodl.MethodFault) null,
--> faultMessage = <unset>,
--> requestedState = "poweredOff",
--> existingState = "poweredOn"
--> msg = ""
--> }
Additionally, journalctl logs on the vCenter Server show an automated alarm triggering a power-on task immediately after the VM is created:
[vim.event.AlarmActionTriggeredEvent] [info] [] [####] [####] [Alarm 'New TKG Node added' on #################### triggered an action]
[vim.event.TaskEvent] [info] [] [####] [####] [Task: Power On virtual machine]
vCenter Server 8.x
This issue is caused by a custom vCenter Server alarm that is configured to trigger an automated "Power On virtual machine" action whenever a new VM is added. This alarm interrupts the OVF deployment by powering on the VM prematurely. The OVF import process strictly requires the target virtual machine to remain in a poweredOff state until the manifest and configurations are fully imported.
To resolve this issue, you must prevent the vCenter Server alarm from automatically powering on the virtual machine during deployment.
Log in to the vSphere Client.
Select the vCenter Server, Datacenter, or Cluster where the virtual machine is being deployed.
Navigate to Configure > Alarm Definitions.
Locate the alarm responsible for the automated power-on action.
Disable the alarm temporarily, or modify its trigger conditions so that it does not apply to virtual machines.
Retry the OVF deployment.
(Optional) Once the deployment completes successfully, re-enable the alarm if it was temporarily disabled.