3

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?

Samselvaprabu
  • 1,311
  • 5
  • 13
  • 26

4 Answers4

4

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.

Chopper3
  • 100,240
  • 9
  • 106
  • 238
  • Thanks for useful information. I think some way must be there. If not preventing if it alerts me that's also would do half good thing than nothing. I have edited my question accordingly – Samselvaprabu Jan 04 '12 at 09:12
  • Ok, understood but what I'm saying is that you really don't *want* them to have 3 snaps at all if you can. – Chopper3 Jan 04 '12 at 10:29
  • I will explain the case . Our VMs are build machines. So in my project release 1 , I would have used vs2008 , Silverlight some old version. And i would take snapshot. Then for next release softwares will be changed Vs2010 , silverlight latest version and etc. Some times after a year customers would come back to us and ask for patch. Our only survival point is go to version 1 snapshot. I can never remove it. But if it cross more than 3 snaps , it is better to have new VM. – Samselvaprabu Jan 04 '12 at 10:33
  • 1
    Why don't you just either backup or clone the VMs rather than snapping? if you have to do snaps from within ESX/i then consider getting a SAN that supports snaps and VAAI and let that offload the work for you. – Chopper3 Jan 04 '12 at 10:44
  • If i clone VM , I may need more space. Isn't it? For ex. Our VMs are 20 GB in size. for 3 snaps if i take 3 clones , won't it be a overloading? – Samselvaprabu Jan 04 '12 at 11:07
  • Yes but the snaps take up space too, and slow the VMs down a hell of a lot. You could just backup the machines using the VDR which deduplicates for you, just an idea. – Chopper3 Jan 04 '12 at 11:09
  • performance degredation isn't that bad(especiallly in this use case). In vsphere 4.X the biggest problem was when you went to delete or commit a snapshot and it failed. There was no way to get notified. Vsphere 5 fixes some of this. I think you are asking for trouble if you are keeping running machine snapshots around for a year. I concur with chopper3 that you should come up with a strategy around cloning the VMs. This could end up benig cheaper for you since the old VMs could be migrated to a cheaper storage solution (sata drives etc.) – Jim B Jan 04 '12 at 15:06
2

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.

Jim B
  • 23,938
  • 4
  • 35
  • 58
2

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.

JakeRobinson
  • 2,886
  • 17
  • 26
0

I have no experience with snapshot limitations, but VMware document What Is New in VMware vSphere™ 4: Storage has the following entry:

Improved Storage Resources Control

As the scope of storage resources have increased significantly with large deployments of virtualization environments, so has the need for greater automation and control of these resources. In the vSphere release, vCenter has been enhanced with several new storage specific capabilities to help the virtual administrator manage these environments with a higher degree of control. These enhancements provide administrators with proactive alerts and alarms to address issues before they interrupt the availability of applications running on those resources. vCenter allows setting permissions and quota limits on datastores, as well as per VM.

I think you could try working with quotas to achieve what you want.

Paweł Brodacki
  • 6,451
  • 19
  • 23