Error: "Failed because padding is too short or too long" during snapshot consolidation of a Virtual Machine with encryption enabled
search cancel

Error: "Failed because padding is too short or too long" during snapshot consolidation of a Virtual Machine with encryption enabled

book

Article ID: 423703

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • The 'Consolidate' task for a Virtual Machine fails with error:

    "An error occurred while consolidating disks: Unable to save snapshot file. Checkpoint operation not supported for PCI Plugin."

  • On ESXi host, in /var/run/log/hostd.log:

    YYYY-MM-DD <Time> In(166) Hostd[2103533] [Originator@6876 sub=Vmsvc.vm:/vmfs/volumes/<Datastore-UUID>/<VM-name>/<VM-name>.vmx opID=esxui-####-#### sid=######## user=root] State Transition (VM_STATE_ON -> VM_STATE_CONSOLIDATE_ALL_DISKS)

    YYYY-MM-DD <Time> Db(167) Hostd[2103535] [Originator@6876 sub=Vigor.Vmsvc.vm:/vmfs/volumes/<Datastore-UUID>/<VM-name>/<VM-name>.vmx] Consolidate Disks message: An error occurred while consolidating disks: Unable to save snapshot file.
    YYYY-MM-DD <Time> In(166) Hostd[2103546] [Originator@6876 sub=Vimsvc.ha-eventmgr] Event 133136 : Virtual machine <VM-Name> disks consolidation failed on <ESXI-FQDN> in cluster <ESXI-FQDN> in ha-datacenter.

  • The Virtual Machine logs in /vmfs/volumes/<datastore-UUID>/VM-Name/vmware.log has the following entries:

    YYYY-MM-DD <Time> In(05) vmx ######-######-auto-####-h5:####-##-##-#### SnapshotVMX_Consolidate: Starting online snapshot consolidate operation.
    YYYY-MM-DD <Time> In(05) vmx ######-######-auto-####-h5:####-##-##-#### Vix: [mainDispatch.c:4211]: VMAutomation_ReportPowerOpFinished: statevar=3, new AppState=1880, success=1 additionalError=0
    YYYY-MM-DD <Time> In(05) vmx ######-######-auto-####-h5:####-##-##-#### Turning on snapshot info cache. VM=<VM-name>.vmx.
    YYYY-MM-DD <Time> Er(02) vmx ######-######-auto-####-h5:####-##-##-#### DecryptWithPadding: Failed because padding is too short or too long
    YYYY-MM-DD <Time> Er(02) vmx ######-######-auto-####-h5:####-##-##-#### DecryptWithPadding: Failed because padding is too short or too long
    YYYY-MM-DD <Time> In(05) vmx ######-######-auto-####-h5:####-##-##-#### DISKLIB-VMFS: "vsan://<UUID>/<VM-ID>" : open successful (1114117) size = 0, hd = 0. Type 20

  • The Backups on the Virtual Machine may encounter failures.

Environment

VMware vSphere ESXi 8.x

Cause

This issue occurs when a VM is encrypted while a backup or snapshot task is in progress, leading to a discrepancy in key-value pairs.

Resolution

To resolve this issue,  affected VM files have to be decrypted or encryption has to be disabled before attempting to consolidate the disks by following the steps below:

To Decrypt the VM:

  1. Decrypt the VM: Remove the encryption from the virtual machine. This allows the system to resolve padding and key-value pair discrepancies. Refer: Decrypt an Encrypted Virtual Machine or Virtual Disk
  2. Run Consolidation: Perform the disk consolidation task. After decryption, the consolidation should complete without the "Unable to save snapshot file" error.
  3. Re-encrypt (Optional): Once the consolidation and snapshots are successful, re-encrypt the virtual machine. Refer: Encrypt an Existing Virtual Machine or Virtual Disk

Note: If vTPM device is configured on the Virtual Machine, remove the device and then perform the backup.

Additional Information

Decrypt an Encrypted Virtual Machine or Virtual Disk