- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Multiple vm snapshot creation and deletion
HI,
I'm looking for simple powercli script to create and delete list of vms snapshots.
please provide if someone have this script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have any powercli/powershell experience?
Here is a link to the cmdlet reference :
vSphere 6.0 Documentation Center
I suggest coming up with some pseudo code first, and we can then help you with the final details.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Good news for you is, there is no high level scripting is required to achieve what you want.. ![]()
Here are some cool and easy to operate stuff about multiple VMs snapshot creation..
http://www.techiessphere.com/2017/02/taking-multiple-vms-snapshot-vmware.html
http://www.techiessphere.com/2017/02/multiple-virtual-machines-snapshot-import-csv.html
To delete the VMs, you may use below command on POwerCLI:
get-vm | Get-Snapshot | where {$_.name -match "newsnapshotclitest"}| Remove-Snapshot
(This command will delete all snapshot matching the name "newsnapshotclitest" from all VMs, so use it carefully after understanding it well and testing it on test environment first).
Thanks,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in addition to my reply above, I would recommend to read the below KB for snapshot removal task.. Its explained in detail..
http://www.techiessphere.com/2017/03/removing-snapshot-of-multiple-virtual-machines-vmware.html
Thanks,
Amit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Discussion moved from VMware ESXi 6 to VMware PowerCLI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there,
Please try use this commands, it worked for me.
To get snapshots for multiple VMs use this:
Get-VM -Name VM1,VM2,VM3 | New-Snapshot -Name SnapshotNameHere - Description SnapshotDescriptionHere
To delete snapshot for multiple VMs use this
G-VM -Name VM1,VM2,VM3, | Get-Snapshot | Remove-Snapshot
Note: reference VM1,VM2,VM3 to your VMs
Hope that helps