VMware snapshots plays important role for VM backup. It is recommended to remove old snapshots as they consume space and may create problems if somebody revert the VM with old snapshot. If you have handsome amount of Virtual Machines, then it will be difficult and time consuming for you to manage those snapshots manually.
In this article, we will be generating a report of VMs, having snapshots. To prepare that report we'll be using vSphere PowerCLI to connect with vCenter center and then use "Get-VM" and "Get-Snapshot" cmdlets.
Note: To perform below operations, you will need to install VMware vSphere PowerCLI on your machine.
1. Open vSphere PowerCLI.
2. Connect to vCenter Server.
3. Prepare list of VMs having snapshot.
Format-List will provide below properties:
Here we have all the properties of a snapshot. Now we can format our report to display required infomation.
In this article, we will be generating a report of VMs, having snapshots. To prepare that report we'll be using vSphere PowerCLI to connect with vCenter center and then use "Get-VM" and "Get-Snapshot" cmdlets.
Note: To perform below operations, you will need to install VMware vSphere PowerCLI on your machine.
1. Open vSphere PowerCLI.
2. Connect to vCenter Server.
3. Prepare list of VMs having snapshot.
Get-VM | Get-Snapshot | format-list
Format-List will provide below properties:
- Description
- Created
- Quiesced
- PowerState
- VM
- VMId
- Parent
- ParentSnapshotId
- ParentSnapshot
- Children
- SizeMB
- IsCurrent
- IsReplaySupported
- ExtensionData
- Id
- Name
- Uid
Here we have all the properties of a snapshot. Now we can format our report to display required infomation.
Get-VM | Get-Snapshot | format-list VM, Created, SizeMBIf you want to redirect the output into any text file then it can be redirected like this:
Get-VM | Get-Snapshot | format-list | out-file d:\snapshot_report.txtHope this article provided you a quick and easy way to list the snapshot reports for your enviroment. :)
I would like to read something more on this topic or related topics.
ReplyDelete