"The attempted operation cannot be performed in the current state" Error When Creating a Virtual Machine Snapshot
search cancel

"The attempted operation cannot be performed in the current state" Error When Creating a Virtual Machine Snapshot

book

Article ID: 316565

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

Symptoms / Introduction:
Attempts to create a snapshot of a virtual machine fail with an error message resembling the following:

  • "The attempted operation cannot be performed in the current state (powered off)"

  • "The attempted operation cannot be performed in the current state (powered on)"

Additionally, when creating a snapshot from the ESXi command line using vmware-cmd The following error is encountered:

vmware-cmd /vmfs/volumes/my-vmfs3/sample-vm-name.vmx createsnapshot sample-name sample-description 0 0 VMControl error -3: Invalid arguments

Environment

VMware vSphere ESXi 6.0
VMware vSphere ESXi 6.7
VMware vSphere ESXi 6.5

Cause

This issue can occur when the .vmsd metadata file contains an invalid or stale snapshot reference. Specifically, if the snapshot.current entry points to a snapshot UID that does not exist, the virtual machine may be unable to process new snapshot requests correctly. This can lead to operational failures, including unexpected VM power-off events during snapshot creation.

Example:
In the following .vmsd file, the snapshot.current value is set to 38, but no snapshot with UID 38 exists:

root@bshp020 my-vm1]# cat sample-vm-name.vmsd
snapshot.lastUID = "39"
snapshot.numSnapshots = "0"
snapshot.current = "38"
snapshot0.uid = "39"
snapshot0.filename = "sample-vm-name-Snapshot39.vmsn"
snapshot0.displayName = "Consolidate Helper"
snapshot0.description = "Helper snapshot for online consolidate."
snapshot0.createTimeHigh = "274900"
snapshot0.createTimeLow = "-753698745"
snapshot0.numDisks = "1"
snapshot0.disk0.fileName = "sample-vm-name.vmdk"
snapshot0.disk0.node = "scsi0:0"
snapshot.needConsolidate = "FALSE"
 

In this scenario, snapshot.current = "38" is referencing a non-existent snapshot UID, resulting in a snapshot creation failure.

Resolution

To resolve this issue, follow one of the appropriate options based on your virtual machine’s snapshot status:

Option 1: No Existing Snapshots

If the virtual machine does not currently have any snapshots:

  1. Delete the .vmsd file from the virtual machine's directory.

  2. The file will be automatically regenerated the next time a snapshot is created or when the virtual machine is powered on.

Option 2: Snapshots Exist

If the virtual machine has existing snapshots:

  1. Manually edit the .vmsd file to update the snapshot.current value to match a valid existing snapshot UID listed in the file.

  2. Once the virtual machine is running:

    • Commit (delete) all existing snapshots.

    • Power off the virtual machine.

    • Delete the .vmsd file.

  3. The .vmsd file will be recreated during the next power-on event or snapshot creation.

Additional Information

  • Ensure that any manual modifications to .vmsd are performed carefully and only after taking appropriate backups.

  • If unsure, consider cloning the VM or copying its configuration files before making changes.