VMware Cloud Community
vmk2014
Expert
Expert

Alert for Snapshot creation

Hi,

  Is there any way to get alarm generated and send to us that who is trying to create snapshot for a vm and who created, so that we can track the snapshot creator.We are facing performance issue in our VC.Also,i want report for user who created snapshot for VM with size in csv format. Thanks

vm2014

Tags (2)
4 Replies
NealeC
Hot Shot
Hot Shot

Hello vmk2014,

If you want to monitor specific VMs, or a part of the hierarchy that has no snapshots currently you could set up an alarm for snapshot size>0

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=101802...

However I would query what you're really trying to achieve?

Do you not trust people creating snapshots?

If so restrict permissions for your VMs or a sub-tree of the hierarchy to prevent people creating snapshots.

If you are worried about long running/fast growing snapshots it's easy to run a powerCLI query

get-vm | get-snapshot | format-table vm, created, sizegb -autosize

This will show you the size of all snapshots you have and you could schedule that to run.

Regards

Chris

-------------- If you found this or any other answer useful please consider the use of the Helpful or Correct buttons to award points. Chris Neale VCIX6-NV;vExpert2014-17;VCP6-NV;VCP5-DCV;VCP4;VCA-NV;VCA-DCV;VTSP2015;VTSP5;VTSP4 http://www.chrisneale.org http://www.twitter.com/mrcneale
LittleNickey
Enthusiast
Enthusiast

Might this be what you are looking for?

http://www.virtu-al.net/featured-scripts/snapreminder/

You asked for Creator, if above script doesn't do what you want you can find creator via the event with Get-VIEvent:

Get-VIEvent -Entity $VM | ?{$_.FullFormattedMessage -like "Task: Create virtual machine snapshot"} | select FullFormattedMessage, UserName

-- Oskar
vmk2014
Expert
Expert

Thanks Neale for your response.Actually I am looking through power cli script which will trigger alert that someone is trying to create snapshot for a VM.Also,how to restrict creating snapshot for a VM. Thanks

vm2014

Reply
0 Kudos
NealeC
Hot Shot
Hot Shot


There is no native/built-in method to alert when a snapshot is created.

However on the question of how to restrict the ability to create snapshots.

You should remove all but administrator users (and remove your problem user from admins) from the permissions for that VM/VMs or part of the hierarchy and grant the users you want to have access explicitly.

You should give them Virtual Machine User rights only.  They then will not be able to create snapshots.

Virtual Machine User: Grants user access rights exclusively to VMs. The user can power on, power off, and reset the virtual machine, as well as run media from the virtual discs

Regards

Chris

-------------- If you found this or any other answer useful please consider the use of the Helpful or Correct buttons to award points. Chris Neale VCIX6-NV;vExpert2014-17;VCP6-NV;VCP5-DCV;VCP4;VCA-NV;VCA-DCV;VTSP2015;VTSP5;VTSP4 http://www.chrisneale.org http://www.twitter.com/mrcneale