Automation

 View Only
  • 1.  check for who created a snapshot

    Posted Nov 03, 2011 03:18 AM

    Hi

    I was wondering how to check for who created a snapshot within pwercli. This is the only item I having an issue doing. I am extremely green in powercli and the only posts I see with it on the internet are way more complicated scripts than my powercli level.

    thanks

    D



  • 2.  RE: check for who created a snapshot

    Posted Nov 03, 2011 06:26 AM

    Unfortunately, the information about the user who created a snapshot is not available in the object returned by Get-Snapshot.

    The information is available (most of the time) in the events produced by the creation of a snapshot though.

    The SnapReminder script from Alan contains a subroutine that scans the events and extracts the information about the user.

    The problem with that subsroutime is the the timestamp.

    There can be a time difference between the timestamp on the snapshot and the timestamp on the corresponding event. The SnapshotExtra function in Alan's script tries to compensate for that time difference, by looking at events that occurred 5 seconds before or after the snapshot timestamp.

    Depending on the load of your vCenter, this will return the correct event (and hence user) that corresponds with the snapshot.