We have given our users privilege to take snapshots. But now it is uncontrollable and people started taking meaningless snapshots and never deleting it.
Due to this we are facing performance issue, Disk space overloaded issue and etc.
I would like to prevent users from taking snapshots beyond certain limit. For example. Users may not be allowed to take more than 3 snapshots .
How to achieve this? ( We are using ESXi 4 and ESXi 4.1 and VMware Vsphere )
If it can't be prevented , atleast is there a mechanism to alert me when user creating more than 3 snapshots?
Firstly I'm not aware of any way to achieve what you're looking for. Secondly VMFS snapshots are really a short term temporary type of snapshot, not only do they cut into performance heavily but they take a long time to remove. As such I think you've caused this problem yourself by assuming users know these things and would use them responsibly. I'd revoke the right and start what will be a long process of removing all the snaps.
What can easily be done in production esx environments when I've had to allow snaps is set an alarm on snap creation, which then kicks off a powershell script to remove snaps on the vm older than 2 days. In your case you could count the snaps and have it send an email (or whatever action you like). This kind of functionality is why the snap alarm was added.
In the short term, I recommend you remove the ability for your users to take snapshots, and have them put in an email/ticket request for a snapshot.
In the long term, I recommend you look into workflow automation that will give you more control over snapshots.
PowerCLI - Create a small script that allows a user to take snapshots, but limits the amount of snapshots. Also, you should absolutely run a scheduled script to clean up snapshots older than 24 hours old. You can also put a GUI on your scripts if your users are scared of the command line.
vCenter Orchestrator - Create easy to use graphical workflows for your users to manage snapshots. Harder to set up, but the possibilities at that point are endless.
I have no experience with snapshot limitations, but VMware document What Is New in VMware vSphere™ 4: Storage has the following entry:
I think you could try working with quotas to achieve what you want.