When attempting to clone virtual machines with custom vVol storage policies containing replication configurations, the operation fails with the error: "An error occurred while saving the snapshot: Invalid policy specified for virtual disk."
This error occurs during the snapshot creation phase of the cloning process. Manual snapshots with the same policy work correctly, but the automatic snapshot created during the cloning operation fails.
If the VVOL Storage policy where replication is disabled, cloning works fine.
In order to clone a VM the vSphere needs to take a temporary snapshot of the VM, clone the new VM from this temporary snapshot and then deletes the snapshot.
In case of the vVols the snapshot of the virtual disk of a VM is offloaded onto the array. Snapshot of a disk involves two phases prepare and snapshot.
In the first phase which is the "prepare" phase, the vSphere informs the array about the impending snapshot, the array can take necessary steps and prepare of the actual snapshot.
The "prepareToSnapshot" is the VASA API which vSphere invokes on the arrray/VP for this purpose.
From the vmware.log of the VM TestVM
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - SnapshotVMX_TakeSnapshot start: 'clone-temp-3441962486', deviceState=0, lazy=0, quiesced=1, forceNative=0, tryNative=1, saveAllocMaps=0
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - 2103076:VVOLLIB : VVolLib_IsVectoredSnapSupported:14277: VVolLib_IsVectoredSnapSupported: vvolVectoredSnapEnabled: 1
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05)+ vmx -
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - VVolObjNotifySnapshotPrepare: Changing state to VEC_SNAP_PREPARE_IN_PROG.
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - OBJLIB-VVOLOBJ :VVolObjNotifySnapshotPrepare: Building in-mem cache
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Er(02) vmx - 2103076:VVOLLIB : VVolLibExecuteVasaTask:3708: Task of type 0x5ca1ab1f queued (retval: The VVol task will complete asynchronously)
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Er(02) vmx - DISKLIB-LIB_CREATE : DiskLib_NotifySnapshotPrepare: FiltLib failed to notify snapshot prepare: Operation completes asynchronously
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - DISKLIB-CBT :ChangeTrackerESX_CreateMirror: Created mirror node /vmfs/devices/svm/####-####-cbtmirror.
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) worker-2103088 - 2103088:VVOLLIB : VVolLib_IpcStorageFaultToVVolLibError:765: Storage Fault INVALID_PROFILE (21): InvalidProfile /
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Er(02) worker-2103088 - 2103088:VVOLLIB : VVolLibExecuteVasaTaskCB:3588: Request of type 0x5ca1ab1f failed: failed with error (24) The VVol storage profile is invalid
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - OBJLIB-VVOLOBJ : VVolObjPrepareSnapshotCB: Could not snapshot the object 'naa.#################'.
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - DISKLIB-VMFS : VmfsExtentCommonPrepareSnapCB: Failed prepare snapshot phase bf=
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Er(02) vmx - DISKLIB-LINK : DiskLinkPrepareNativeSnapCBInt: Failed to prepare native snapshot of '/vmfs/volumes/vvol:########/naa.##########/TestVM.vmdk': Invalid policy specified for virtual disk
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - SNAPSHOT: SnapshotPrepareTakeDoneCB: Failed to prepare disk /vmfs/volumes/vvol:########/naa.########/TestVM-000001.vmdk.> YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - SNAPSHOT: SnapshotPrepareTakeDoneCB: Prepare phase complete (Invalid policy specified for virtual disk).
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - SnapshotVMXPrepareTakeDoneCB: Prepare phase failed: Invalid policy specified for virtual disk (5).
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - SnapshotVMXTakeSnapshotComplete: Done with snapshot 'clone-temp-3441962486': 0
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - DISKLIB-CBT : ChangeTrackerESX_DestroyMirror: Destroyed mirror node ####-####-cbtmirror. SrcFd: /vmfs/volumes/vvol:############/naa.############/TestVM-ctk.vmdk, DestFd: /vmfs/volumes/vvol:########/naa.########/TestVM-ctk-mirror.vmdk.
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(05) vmx - SnapshotVMXTakeSnapshotComplete: Snapshot 0 failed: Invalid policy specified for virtual disk (5).
The logs show a critical error from the PowerStore VASA provider during the "prepareToSnapshotVirtualVolume" operation
From the /var/run/log/vvold.log
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(166) VVold[2101499]: [Originator@6876 sub=Default IpcCtx=2105050-3] Came to SI::PrepareToSnapshotVirtualVolume: container #########-####### srcVVol naa.########### snapType SnapshotReadWrite dstProfile (NULL)
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> In(166) VVold[2101499]: [Originator@6876 sub=Default IpcCtx=2105050-3] VasaOp::PrepareToSnapshotVirtualVolume [#342991]: ===> Issuing 'prepareToSnapshotVirtualVolume' to VP [PowerStore VASA provider - san:Connected (Outstanding 0/24)]
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Er(163) VVold[2101499]: [Originator@6876 sub=Default IpcCtx=2105050-3] VasaOp::IsSuccessful [#342991]: prepareToSnapshotVirtualVolume transient failure: 21 (INVALID_PROFILE / InvalidProfile / )
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Wa(164) VVold[2101499]: [Originator@6876 sub=Default IpcCtx=2105050-3] VasaOp[#342991] ===> Transient failure prepareToSnapshotVirtualVolume VP (PowerStore VASA provider - san01-ernie) retry=false, batchOp=false container=####-####-####-##### timeElapsed=96 msecs (#outstanding 0)
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Er(163) VVold[2101499]: [Originator@6876 sub=Default IpcCtx=2105050-3] VasaOp[#342991] ===> FINAL FAILURE prepareToSnapshotVirtualVolume, error (INVALID_PROFILE / InvalidProfile / ) VP (PowerStore VASA provider - san) Container (#####-####-###-########) timeElapsed=96 msecs (#outstanding 0)
YYYY-MM-DDTHH:MM:SS.###<Time_Zone> Er(163) VVold[2101499]: [Originator@6876 sub=IpcSvc IpcCtx=2105050-3] HandleRequest: Error handling function PrepareToSnapshotVirtualVolume: InvalidProfile /
The VASA provider has a limitation where it cannot properly handle snapshot requests during clone operations for VMs with replication-enabled storage policies.
To clone powered-on VMs, vSphere needs to take a quiesced snapshot, which is failing due to the array's limitations and checks.
The PowerStore array does not support snapshot replication, which appears to be the reason for the snapshot failure.
This aligns with the fact that when the policy where replication is disabled is applied, the clone succeeds.
Please engage with Dell PowerStore support.
We can use one of the following workarounds to clone the VM:
Power off the VM before cloning
Temporarily modify the storage policy