How To Backup ESXi Configuration – The Missing Piece

by bunchc on May 6, 2010

This came up on #VMware on Freenode this weekend. Basically the concern was “How do I Backup my ESXi USB Key?” Other than ripping the USB key out of a production machine… how was the user to do this? Well, vMA and the vCLI provide a method for this:

Backing up your ESXi Configuration:

To backup your ESXi configuration you’ll be using the vicfg-cfgbackup.pl command as follows:

  • Download either the vMA or vCLI
  • Launch vicfg-cfgbackup.pl:
    C:\Program Files\VMware\VMware vSphere CLI\bin>vicfg-cfgbackup.pl –save –server 192.168.15.253 –username root –password password backup.bak
  • Note: The backup will be stored relative to your user “AppData” path:
    C:\Users\Username\AppData\Local\VirtualStore\

Restoring your ESXi Configuration:

Restoring your ESXi config can be done after you have the host up and responding over the network again by using the following:

C:\Program Files\VMware\VMware vSphere CLI\bin>vicfg-cfgbackup.pl –load –server 192.168.15.253 –username root –password password backup.bak

Note: You will be asked to reboot the host on restore.

Backing  up multiple hosts! – There is a script to backup multiple ESXi hosts on the VMware communities site here. Also in PowerCLI here!

[Edit: Added link to backup multiple ESXi hosts from William in the comments. Thanks William!]
[Edit 2: Added PowerCLI link from NiTRo. Site is in French, PowerCLI is not]

  • http://engineering.ucsb.edu/~duonglt/vmware William Lam

    Here's a script that can be used to help backup and manage multiple ESXi backups: http://communities.vmware.com/docs/DOC-11767

  • http://professionalvmware.com professionalvmware

    Excellent, thank you sir!

  • Artek123

    What information is backed up by this script? Does not include Nic Team failover order and active/stand by configuration?

    Another question is it possible to modify some details in this .bak like hostname, IP and apply to another ESXi host? This would rock as it opens capability if create a template for rapid deployments at remote sites where there is no infrastructure is setup…

  • http://www.hypervisor.fr NiTRo

    And here is the powershell way to do it : http://www.hypervisor.fr/?p=1337

  • http://professionalvmware.com professionalvmware

    Added, Thanks!

  • http://professionalvmware.com professionalvmware

    The script relies on IP connectivity to work, so you would still need to configure the host and get it onto the network first. As for creating and deploying ESXi hosts, once you have the host on the network you can join it to your vCenter and apply a host profile to cover your additional config.

  • Artek123

    Thanks for the details. Host profiles are cost prohibitive for small
    businesses or large number of remote site with single host setup. As
    well remote sites do not have cetral management network. Good example
    would be dealer stores with minimal server infrastructure.

    Assuming IP is configured can customize the backup config and apply to
    another host?

  • http://professionalvmware.com professionalvmware

    Interesting… Looking into that.

  • http://vibram4u.com/ moncler outlet store

    Hhe article’s content rich variety which make us move for our mood after reading this article. surprise, here wslmart.net you will find what you want! Recently, I found some wedsites which commodity is colorful of fashion. Such as xxxxxxxx that worth you to see. Believe me these websites won’t let you down.

  • http://www.air-jordan-19.com air jordan 19

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good ugg boots information we can learn in this forum!

  • http://www.air-jordan-20.com air jordan 20

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good ugg boots information we can learn in this forum!

  • http://www.air-jordan-16.com air jordan 16

    The post about leisure is quiet good. Reduce our work pressure, improve our life mood . I like it very much.I will support it often. These days I want to buy something from these websitesXXXXXX,but I don’t know how to do.I hope you can help me.Thank you very much! Nike Zoom Blur Low

  • Nls73m

    everytime I type the command, the file vicfg-cfgbackup.pl just opens up in notepad.

    I am using esxi 4 U1-208167 (free esxi) and trying to get a copy of my config file in case I need to reinstall esxi. I cannot get this to work. Everytime I type the command, the file “vicfg-cfgbackup.pl” just opens up in notepad on my local pc. Here is the command that I am typing into the dos command prompt when I go to c:Program FilesVMwareVMware vSpehe CLIbin>vicfg-cfgbackup.pl –save –server 192.168.15.253 –username root –password password backup.bak

    I am doing this after I downloaded and installed VMware-vSphere-CLI-4.1.0-254719.exe on my Windows 7 pc. I have tried different variations of above command. Every single time I run the command, the file vicfg-cfgbackup.pl just opens up in notepad in my Windows 7 pc. Don’t understand what I am doing wrong. Please help. All I need to do is make a copy of my esxi host config file to back and be able to restore if needed.

  • http://professionalvmware.com professionalvmware

    When you are running this command, are you running it after executing the vCLI from your start menu?

  • Nls73m

    **SOLVED**

    I needed to add “perl” before the actual command “vicfg-cfgbackup.pl –save –server 192.168.15.253 –username root –password password backup.bak”

    example: perl vicfg-cfgbackup.pl –save –server 192.168.15.253 –username root –password password backup.bak

    none of the docs that ive read tell me to add the word perl. works with it, does not work without it.

    Thank You

  • Tibo

    Here is another useful windows binary to automate this process : http://slymsoft.com/esxi-conf-backup/ 

  • Anonymous

    Please note that there is no need to provide the “-password ” part on the command line; If you omit it the tool will ask you to enter a password in a more secure fashion. It doesn’t print it out and you don’t have to write it out and it won’t show up in a process list.

  • http://professionalvmware.com professionalvmware

    Excellent! Good catch.

  • http://www.demonautomatisering.nl/ Dennis van der Pool

    Backup worked fine.

    Restore failed with message:

    Error connecting to server at ‘https://localhost/sdk/webService’: Perhaps host is not a vCenter or ESX server

    vicfg-cfgbackup.pl –server -l

    works for me

  • Mike Hardy

    This is not working for me, no errors, but no backup either?

  • http://professionalvmware.com professionalvmware

    Have you tried some of the advice from the comments? I wrote the post back on esxi 4.0, things might have changed a bit in different versions.

  • http://professionalvmware.com professionalvmware

    Also, are you specifying a location for the backup file? It may be defaulting to somewhere else unless you are explicitly calling it out.

  • Fmelo

    Restore failed: fault.MismatchedBundle.summary

  • http://professionalvmware.com professionalvmware

    Were you restoring between versions (different builds even)?

  • b18cpowa

    Thank you soooooooooooo much!

  • Pingback: Quickly Backup ESXi Host Configuration with PowerCLI

  • Pingback: More ESXi5 installation steps « The Wiert Corner – irregular stream of stuff

  • Pingback: How To Backup ESXi Configuration | ntanvinh144289

  • Daniel J. García Fidalgo

    There is a free Open Source tool we just launched XSIBackup that allows programming of unatendded backups with automatic space provisioning when the backup disk is full and a complete e-mail report after each backup

    http://33hops.com/xsibackup-vmware-esxi-backup.html

  • Wazi-admin

    use the -f switch to force the restore

  • Wazi-admin

    This can be used to configure multiple VM hosts.
    We have 8 hosts connected to 10 VLANs and 12 Datastores and it’s a pain to do the configs individually.
    So we used this tool.
    BE WARNED however. This tool will restore almost everything including VM configs of VMs that were running at the time of the backup. It will also restore management IP addresses and other VMKernel IPs as well as information on the vCentre that manages the host.
    If you are going to use this tool to replicate configs to other hosts then make sure your source host does not have any VMs on it, nor is it connected to a vCentre. Otherwise you will bring your entire environment down instantly due to conflicting IPs and other configs.

  • Crazy Dave

    I’ve been trying to find out what was wrong with my backup for hours… until I found your page :D no where else does it say the correct place where file is stored. THANKS :D

  • Pingback: Some links on ESXi disaster recovery and configuration backup « The Wiert Corner – irregular stream of stuff

Previous post:

Next post: