How to backup esxi using powercli?


Let’s discuss few important things before we actually talk about how to backup esxi

  1. First and foremost decide which remote tool you are comfortable for managing esxi remotely
  2. I love powershell, so it will be powercli for me
    • Backup consideration
      • Backup configuration for esxi host can be done locally or remotely using the script below
      • But restore always has to happen from remote location
      • When you restore host target host must be in maintenance mode (How to do that, see below or here)
  3. Now used case
    • Assuming we two esxi host viz pzesxi-07 and pzesxi-09
    • To backup pzesxi-07, we will backup it using powercli client present on vCenter01 -in Step-01 as shown below
    • To backup pzesxi-09, we will backup it using powercli client present on vCenter01 in Step-01 as shown below
      • Restore Hosts
        • log in to vCenter01, open powercli
        • Put one host into maintenance mode e.g. pzesxi-07 using command below in restore steps
        • Restore configuration
        • Remove host pzesxi-07 from maintenance mode
        • Put second host into maintenance mode e.g. pzesxi-09
        • Restore configuration
        • Remove host pzesxi-09 from maintenance mode

Here are the Commands below

Get-VMHost pzesxi-07 | set-VMHostFirmware –backupconfiguration –Destinationpath c:\ESXibackup\pzesxi-07

Get-VMHost pzesxi-09 | set-VMHostFirmware –backupconfiguration –Destinationpath c:\ESXibackup\pzesxi-09

Restore steps for pzesxi-07

Login to vCenter01 and open powercli

set-VMHost -vmhost pzesxi-07.pzwaredu.com -State "maintenance"

Set-VMHostFirmware -vmhost 192.168.1.46 -Restore -SourcePath c:\ESXibackup\pzesxi-07\configBundle-pzesxi-07.pzwaredu.com.tgz

Remember host’s restarts without any warning after you complete the above step

Source:http://deinoscloud.wordpress.com & http://www.virtu-al.net/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s