Hi,
I am actually trying to create a Reference Point for my Hyper-V VM for RCT based backup. I am trying to do this by C#.
For ConvertToReferencePoint() to work my Snapshot Type should be recovery.
Which I found out from here: https://video2.skills-academy.com/en-us/windows/win32/hyperv_v2/createsnapshot-msvm-virtualsystemsnapshotservice
For recovery snapshot, we use snapshot type 32768 for CreateSnapshot().
Which I found out from here: https://social.technet.microsoft.com/Forums/ie/en-US/39d8b7f7-8efa-48e5-8750-869d2ca8bf70/what-is-the-hyperv-recovery-snapshot-type?forum=winserverhyperv#:~:text=The%20recovery%20snapshot%20sounds%20like,same%20as%20a%20VM%20checkpoint.
But when I use 32768 in my Snapshot Setting. It gives error.
Log: Checkpoint creation failed for 'Ubuntu1' because an invalid checkpoint type has been specified. (Virtual machine ID 5C773BB5-B630-48B4-AB9E-71C548F3FAE4)
This is what i have so far:
//CreateSnapShot() settings
inParams["AffectedSystem"] = vm.Path.Path;
ManagementObject snapshotSettings = GetObject("Msvm_VirtualSystemSnapshotSettingData",scope);
snapshotSettings["ConsistencyLevel"] = 1;
snapshotSettings["IgnoreNonSnapshottableDisks"] = true;
snapshotSettings["GuestBackupType"] = 1;
inParams["SnapshotSettings"] = snapshotSettings.ToString();
inParams["SnapshotType"] = 32768;
//Invoke Method:
ManagementBaseObject outParams = virtualSystemService.InvokeMethod("CreateSnapshot", inParams, null);
CreateSnapshot() Link: https://video2.skills-academy.com/en-us/windows/win32/hyperv_v2/createsnapshot-msvm-virtualsystemsnapshotservice
Am I missing something?
Thanks,
Mayank Srivastava