VMware Cloud Community
Highspeedlane
Contributor
Contributor
Jump to solution

Help with ESXi config backup and restore

We have vSphere ESXi 4.1 (no vCenter) and are trying to test a back up and restore of the hypervisor configuration settings before going on the do an upgrade to Update 1.

Using Virtual Machine Assistant, we can successfully export a .tgz file of the ESXi config settings with the following command (from a previous post on this topic):

vicfg-cfgbackup --server <server> -s configBundle-ESXix.x.x.x.tgz

The config file is sent to /home/vi-admin. The problem is when I try to restore the config file to the ESXi server. I am in vMA and logged in as vi-admin. Then type vifp addserver <server>. Then verify target server is added by typing vifp listservers. I verify I can run vSphere CLI commands without authentication by typing vicfg-nics -l. So far so good. Then when I try to restore the ESXi with the config file using the below command, I get a "command not found" error

vicfg-cfgbackup --server <server> -| configBundle-ESXix.x.x.x.tgz

The process for creating backups and executing restores to an ESXi server seem fairly convoluted and not straight forward for someone at my level of experience. Essentially what I need to be able to do is verify there is a process to recover from an ESXi failure by restoring its original configurations. Is there an easy, dumbed down process for this?

Thanks in advance.

0 Kudos
1 Solution

Accepted Solutions
ThomasMc
Enthusiast
Enthusiast
Jump to solution

Is that a pipe in your command? | it should be l as in L for load

also since your introducing vifp you could do

vifptarget -s esxi1

enter credentials

and then fire your command minus the --server part as you set this with vifptarget

"vicfg-cfgbackup -l configBundle-ESXix.x.x.x.tgz"

Thomas McConnell vPadawan

View solution in original post

0 Kudos
9 Replies
krishnaprasad
Hot Shot
Hot Shot
Jump to solution

Hello, Here is the documentation available for the backup and restore operations. http://www.vmware.com/pdf/vsphere4/r41/vsp4_41_vcli_inst_script.pdf

I had tried it using vCLI ( vSphere Command Line Interface ) and it worked fine.  Do you execute the command from VMA for restore?

Thanks,

Krishnaprasad

0 Kudos
ThomasMc
Enthusiast
Enthusiast
Jump to solution

Is that a pipe in your command? | it should be l as in L for load

also since your introducing vifp you could do

vifptarget -s esxi1

enter credentials

and then fire your command minus the --server part as you set this with vifptarget

"vicfg-cfgbackup -l configBundle-ESXix.x.x.x.tgz"

Thomas McConnell vPadawan
0 Kudos
Highspeedlane
Contributor
Contributor
Jump to solution

Thanks, I was misinterpreting a lower case "L" for a pipe.

But...since my vMA install is a virtual machine of the ESXi host I want to restore, I have to use something like PowerCLI. I have PowerCLI on a Windows workstation with script execution set to remotesigned so it will run scripts, but when I input any of the commands I use in vMA, I receive the error message "command not recognized".

I am able to connect to the ESXi host as root, but beyond that I'm not getting too far. This looks like the last hurdle I have to figure out to get a test restore operation completed.

Is there something obvious I'm missing with PowerCLI? Thanks again for the help.

0 Kudos
ThomasMc
Enthusiast
Enthusiast
Jump to solution

You'll be wanting to install vSphere CLI to use the same commands or look over Alans site for the PowerCLI way

http://www.virtu-al.net/2011/02/23/backing-up-the-esxi-system-image/

Thomas McConnell vPadawan
0 Kudos
bulletprooffool
Champion
Champion
Jump to solution

You'll be looking for these 2 cmdlets:

Get-VMHostFirmware
Set-VMHostFirmware

http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Get-VMHostFirmware.html

http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Set-VMHostFirmware.html

Pretty easy to use

good luck

One day I will virtualise myself . . .
0 Kudos
enesem
Contributor
Contributor
Jump to solution

I use a product called Shadow Protect from Storage craft.

I'll make a backup, then when I want to restore, I will boot a new VM from the Shadow Protect recovery ISO, then restore from within the VM.

It's really quick easy and has saved me on many occasions, for example when my snapshot chain is too big, or if I have to resize a disk.

NM

0 Kudos
Highspeedlane
Contributor
Contributor
Jump to solution

Thanks for all the help to all. Here's where I'm still getting stuck. The following command in PowerCLI (version 4.0) works great to download a copy of the ESXi 4.1 config file to a local Windows workstation:

> set-vmhostfirmware -vmhost <hostname> -backupconfiguration -destinationpath <path>

Voila, the config file backs up and is in the specified local folder. The problem occurs when I want then take this config file (.tgz) and restore it to the ESXi host.

According to the PowerCLI help, the '-restore' switch has to be accompanied by a perameter that specifies a URL "retrieved via get-vmhostfirmware". The switch 'sourcepath' to point to a local folder isn't recognized.

There is indeed several web URLs the host has apparently created on port 443 such as https://<hostname>/tmp/, https://<hostname>/uploads/ , and https://<hostname>/downloads/ but I have no idea how I'm supposed to use these in conjunction with the set-vmhostfirmware command to restore a config file, nor how to get any files into these mysterious web URL. If you browse to them they just show up as a blank page.

Does this make sense to anyone? It would seem if I can backup the config file to a local folder, it should be just as easy to reverse the process, but it's not ending up working that way. Again thanks for all the advice and your assistance is greatly appreciated.

0 Kudos
Highspeedlane
Contributor
Contributor
Jump to solution

Okay, got it to work.

What I ended up doing was installing PowerCLI 4.0 Update 1.

When I tried to install PowerCLI 4.1 it failed (Windows XP SP3) and I don't remember the error message but I then went back to version 4.0. With version 4.0, (we have ESXi 4.1) it created and downloaded the config file, but failed to upload it. I had no problem with this using 4.0 U1.

Thanks to all who helped contribute. This topic can be closed.

0 Kudos
bulletprooffool
Champion
Champion
Jump to solution

Great news - to close a topic / thread, simply click 'Answered' or 'Answer' on an applicable post.

this helps future people with similar problems identify which threads have solutions, when searching old threads.

One day I will virtualise myself . . .
0 Kudos