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
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
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
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
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
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