Automation

 View Only
  • 1.  Checking snapshot creation

    Posted May 30, 2017 04:10 PM

    A PowerCLI script include a statemet like:

    get-vm $myvm | new-snapshot -name $mysnapshotname -Description $mysnapshotdescription

    How can i check that the snapshot was created correctly and that I can trust it?

    Regards

    marius



  • 2.  RE: Checking snapshot creation
    Best Answer

    Posted May 30, 2017 04:58 PM

    The New-Snapshot cmdlet will return a Snapshot object when all went well.

    If that object is not returned, something went wrong.

    Besides reverting to a snapshot, there are not really any other methods of testing the consistency of the snapshot that was taken.



  • 3.  RE: Checking snapshot creation

    Posted May 31, 2017 07:58 AM

    Many thanks.

    Let me ask a further clarification: how can I inspect the returned object?

    I made a test writing:

    $mysnapshot = new-snapshot -VM $myvm -name $mysnapshotname -Description $mysnapshotdescription

    $mysnapshot | get-member

    but it doest not work...

    Regards

    marius



  • 4.  RE: Checking snapshot creation

    Posted May 31, 2017 08:00 AM

    What exactly does not work?

    Don't you get any output from the Get-Member?

    Is $mysnapshot empty?