:::: MENU ::::
Posty w kategorii: VMware

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

Modifying ESXi I/O queue for ALUA enabled storage

esxcli system settings kernel set -s terminateVMonPDL -v Yes
esxcli system settings advanced set -o "/Disk/AutoremoveOnPDL" -i 1
das.maskCleanShutdownEnabled = True
esxcli system module parameters set -m iscsi_vmk -p iscsivmk_LunQDepth=255
esxcli iscsi adapter param set –A vmhbaXX –k LoginTimeout –v 5


How to move vCenter Server to another Datacenter

  • make a clone of the vCenter VM, export it and import into the target Datacenter storage
  • edit the properties of the new VM so it’s MAC address is the same as the old VM (only if using DHCP)
  • shutdown vCenter from web interface
  • with vSphere client connected to the source host, shutdown the Guest OS of the old VM
  • with vSphere client connected to the destination host, register and power-up the new VM