locked
(WMI)How to call CreateSnapshot() such that Resulting Snapshot's type is Recovery? RRS feed

  • Question

  • Hi,

    I am trying to create a reference point for my Hyper-V VM to perform a RCT based back-up. I am using C# for this.

    This is what I have so far:

    These are my 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"] = 2;
    

    And then I am calling InvokeMethod for CreateSnapshot:

    ManagementBaseObject outParams = virtualSystemService.InvokeMethod("CreateSnapshot", inParams, null);
    

    After waiting for Job to be completed. My SnapshotType is always Standard. But for ConvertToReferencePoint() to work, SnapshotType should be recovery. Am I missing something?

    Original Question:

    https://stackoverflow.com/questions/64782349/wmi-how-to-call-createsnapshot-such-that-resulting-snapshots-type-is-recovery

    Thanks,

    Mayank Srivastava

    Wednesday, November 11, 2020 9:02 AM

All replies

  • Hi KIRA5000,
    This Visual C# forum mainly discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.
    Thank you for your understanding.
    Best Regards,
    Daniel Zhang


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 12, 2020 7:08 AM