Problem
An “InvalidPowerState” error may be encountered when applying or removing VM protection:
Applying Protection
- When a VM is added for protection, it may fail to complete the task and report “Failed to apply the Storage Policy change.”
- Task details display the following text:
The attempted operation cannot be performed in the current state (Powered on).com.vmware.vim25.InvalidPowerState@481cf866 [existingState=com.vmware.vim25.VirtualMachinePowerState@7eef5694 [val=poweredOn,name=poweredOn,ordinal=1],requestedState=com.vmware.vim25.VirtualMachinePowerState@5a1a508e [val=poweredOff,name=poweredOff,ordinal=0],dynamicProperty=,dynamicType=,faultCause=,faultMessage=,detail=,cause=,detailMessage=,stackTrace={},suppressedExceptions=java.util.Collections$UnmodifiableRandomAccessList@12bad197{}]
Removing Protection
- When protection is removed from the VM, it may fail to complete the task and report: “Failed to detach storage policy from Protected VM.”
- Failover of domains containing VMs with this problem may report the error “VM has non Supported Disk controller.”
Cause
The protection error generally occurs for VMs with disks that are configured with their Virtual Device Node set to “IDE.” However, if protection is initiated while the VM is powered off, the task will succeed. The problem can also occur when powered on VMs with IDE configured disks are unprotected.
Solution
- Go to the VM > Edit settings screen.
- Select the hard disk and check if any of its Virtual Device Nodes are set to IDE.
- If any disks are found to be configured with IDE:
- Power off the VM.
- Return to the VM > Edit settings screen.
- Select the hard disk and change its Virtual Device Node to SCSI.
- Before committing the change, verify SCSI mode is compatible with the VM.
- Apply this change to all applicable hard disks that are set to IDE.
- Start Protection.