:::: MENU ::::
Posty z tagiem: VM

Manage VM snapshots with PowerCLI

Install PowerCLI module:

# Install-Module VMware.PowerCLI -Scope CurrentUser

Connect to vCenter server:

# Connect-VIServer vcenter.web.url

Create snapshot:

# Get-VM vmname | New-Snapshot -Name SnapshotName -Description YourString

List all snapshots:

# Get-VM vmname | Get-Snapshot | Format-List name,created

Restore from snapshot:

# Set-VM vmname -Snapshot SnapshotName

Delete single snapshot:

# Get-VM vmname | Get-Snapshot -Name SnapshotName | Remove-Snapshot

Delete all snapshots:

# Get-VM -Name vmname | Get-Snapshot | Remove-Snapshot -RemoveChildren