The way to create checkpoint when VM has shared disk is different.
1.Create VM Group
New-VMGroup -Name "Group1" -GroupType VMCollectionType
2.Add VM to above created VM group
$VM1=Get-VM -Name "MyVM1"
Add-VMGroupMember -Name "Group1" -VM $VM1
NOTE: With these commands, just have one VM group in system
3.Create checkpoint:
$collectionSnapshotService = Get-WmiObject -Namespace Root\Virtualization\v2 Msvm_CollectionSnapshotService
$Collection = Get-WmiObject -Namespace Root\Virtualization\v2 Msvm_VirtualSystemCollection
$collectionSnapshotService.CreateSnapshot($Collection , $null, 32768)
4.Apply checkpoint (try when VM is off, faced some issues when VM is ON):
$collectionSnapshotService = Get-WmiObject -Namespace Root\Virtualization\v2 Msvm_CollectionSnapshotService
$Collection = Get-WmiObject -Namespace Root\Virtualization\v2 Msvm_VirtualSystemCollection
$collectionSnapshotService.ApplySnapshot($Collection)
5.Delete the checkpoint:
$collectionSnapshotService = Get-WmiObject -Namespace Root\Virtualization\v2 Msvm_CollectionSnapshotService
$Collection = Get-WmiObject -Namespace Root\Virtualization\v2 Msvm_SnapshotCollection|? "CollectionID" -eq "9aafffbe-4645-4247-99e9-95caf81796b2"
$collectionSnapshotService .DestroySnapshot($Collection)
- Remove vm from vmgroup
$VM1=Get-VM -Name "MyVM1"
Remove-VMGroupMember -Name "Group1" -VM $VM1
7.Delete VM Group
Remove-VMGroup -Name "Group1"
I hope it is helpful for you.