ESXi

 View Only
  • 1.  Daily snapshot removal

    Posted Oct 27, 2010 04:15 PM

    I can see where I can schedule the daily snapshots but I want to keep only one? How do I remove snapshots that are older then 1 day



  • 2.  RE: Daily snapshot removal

    Posted Oct 27, 2010 04:45 PM

    If you are using vCLI, then just edit this script to fit your environment and save it as a .ps1 file --> then set a Windows scheduled task to run it every night.

    The scheduled task must call powershell, so it would look something like this :

    C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\VMware\Infrastructure\vSphere PowerCli\vim.psc1" "& "C:\Scripts\RemoveSnap1.ps1" yourventersever

    good luck!

    edit: that is actually NOT the scheduled task, but the .bat file used by the scheduled task to kick off the removal process.. my apologies on that..



  • 3.  RE: Daily snapshot removal

    Posted Oct 27, 2010 05:21 PM

    Thank you. this might work. what If i have other snapshots that were created by backup software or other manual snapshots that I want to keep?

    it will remove those too, correct?

    Any way to specify only snapshots to be removed that were created by schedule?

    or is there any other way to accomplish this?



  • 4.  RE: Daily snapshot removal

    Posted Oct 27, 2010 05:29 PM

    Hi max!

    Yes, this will remove all snapshots no matter if they were scheduled or kicked off manually.

    Unfortunately, we cannot pick and choose our snapshot removal with this script (or I have not found a way). I just tell my developers that we keep 3 days worth of snapshots and thats it. Perhaps there is someone out there that will allow us to run this on a datacneter with conditions (scheduled versus manual or backup), but I have not found it yet. Please let me know if you do.

    Cheers! Hope it helps..



  • 5.  RE: Daily snapshot removal

    Posted Oct 27, 2010 05:51 PM

    Do you know the way to copy all snapshots to a different datastore before removing them?



  • 6.  RE: Daily snapshot removal

    Posted Oct 27, 2010 07:49 PM

    Could you just create a scheduled task to remove the old snapshot then just create a new snapshot? so you only have 1 active snapshot at a time?



  • 7.  RE: Daily snapshot removal

    Posted Oct 27, 2010 08:13 PM

    i would but i do not see the schedule task in vcenter to remove the old snapshot... this would be the ideal way...

    i am on 4.0

    Is it available in 4.1?



  • 8.  RE: Daily snapshot removal

    Posted Oct 27, 2010 08:21 PM

    Could you just create a scheduled task to remove the old snapshot then just create a new snapshot? so you only have 1 active snapshot at a time?

    If I could I would.. 4.0 doesnt have that option.. hence the script..



  • 9.  RE: Daily snapshot removal

    Posted Oct 27, 2010 08:26 PM

    Your right 4.1 doesn't either you would have thought you could have schedule that. Please submit an ER if you could.