VMware Cloud Community
cragdoo
Enthusiast
Enthusiast
Jump to solution

Script Required - Snapshot creation , keep for 24hrs , deleted then repeat

Looking for a script that will peform the following functions

1) Create a Snapshot of VM

2) Keep the snapshot of the VM for a period of 24Hrs (or any definable time)

3) Delete the snapshot .....rinse and repeat

Sort of a 24hour 'backup'. One of our finance VMs needs to be able to roll back quickly to the previous days config

Any takers/helpers

Thanks in advance

0 Kudos
1 Solution

Accepted Solutions
timparkinsonShe
Enthusiast
Enthusiast
Jump to solution

At its very simplest you could do something in powershell, and schedule to run every 24hours on your virtual center machine:

#Add PowerCLI

Add-PSSnapin -Name "VMware.VimAutomation.Core"

http://Reflection.Assembly::LoadWithPartialName("vmware.vim")

$VCServer = "VCServer"

$VMName = "FinanceVM"

$SnapName = "NightlyBackupSnap"

$VM = Get-VM -Name $VMName

Remove-Snapshot -Snapshot (Get-Snapshot -Name $SnapName -VM $VM) -Confirm:$False

New-Snapshot -VM $VM -Name $SnapName -Quiesce:$True -Confirm:$False

View solution in original post

0 Kudos
2 Replies
timparkinsonShe
Enthusiast
Enthusiast
Jump to solution

At its very simplest you could do something in powershell, and schedule to run every 24hours on your virtual center machine:

#Add PowerCLI

Add-PSSnapin -Name "VMware.VimAutomation.Core"

http://Reflection.Assembly::LoadWithPartialName("vmware.vim")

$VCServer = "VCServer"

$VMName = "FinanceVM"

$SnapName = "NightlyBackupSnap"

$VM = Get-VM -Name $VMName

Remove-Snapshot -Snapshot (Get-Snapshot -Name $SnapName -VM $VM) -Confirm:$False

New-Snapshot -VM $VM -Name $SnapName -Quiesce:$True -Confirm:$False

0 Kudos
cragdoo
Enthusiast
Enthusiast
Jump to solution

was kind of thinking along those lines , but brain not fully functioning today ,,, many thanks

0 Kudos