Before Host Profiles there was vicfg-cfgbackup.pl

This last weekend I was reminded of a RCLI command that creates a backup of your ESXi Host configuration.  A client had an ESXi host where the USB drive failed.  The system didn’t entirely crash, it pinged so HA didn’t kick-in however hostd and vpxa weren’t responding so management from vCenter was impossible. Performing a reboot of the host proved it was a USB failure when it failed to boot.

So, HA kicked in finally when the host was powered off – however the remaining hosts in their cluster did not have adequate resources to power everything back on.  We needed to get this failed ESX host back online and quick!

Brought in new USB stick with fresh ESXi 4.0 installed, plugged in and powered up.  In the TUI configured the Management Port IP address/gateway/DNS, etc.    But now what, all of the (NFS) Datastores, vSwitch configuration and advanced settings were toast…and they didn’t have Enterprise Plus.

Say Hello to vicfg-cfgbackup.pl — a RCLI command which could be found in the vMA.  This utility will allow you to create a backup and restore a full ESXi configuration.  Luckily we had this (backup) command running on a nightly basis so we knew the configuration was complete.  A simply command and the host was online.

Seeing that ESX is going to be phased out, this RCLI command is a valid alternative for those ESXi users that do not have Enterprise Plus licensing.

The commands vicfg-cfgbackup.pl (esxcfg-cfgbackup.pl) allow you to backup and restore the configuration of your ESXi host.

To backup the host you would run the command.

vicfg-cfgbackup.pl –server <server_name> -s <backup_file_name>

To restore your backup configuration to your host you would run. This will cause the host to reboot once the process is complete. NOTE: The host must be in Maintenance Mode for this to work. The backup configuration must also match the patch level of the ESXi install. You can add a -f to force if needed.

vicfg-cfgbackup.pl –server <server_name> -l <backup_file_name>


Created on October 12, 2009 by Rick Scherer

Posted under Backup & Recovery, ESXi 3.5 Tips, vSphere.

This blog has 21,505 views.

Tags: , , , , ,

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

8 Comments so far

  1. Tom
    1:30 pm on October 12th, 2009

    Is vicfg-cfgbackup.pl only usable with 4i??
    What about regular ESX 4??
    It would be so nice to be able to use this with any ESX version.
    Thank you, Tom

  2. Rick Scherer
    2:18 pm on October 12th, 2009

    This is not supported on ESX, only ESXi.

    I’ve tested with ESXi 3.5 and 4.0

    Don’t worry too much about ESX though, it will be phased out in future releases. Better start learning RCLI :)

  3. Vladan
    10:30 am on October 16th, 2009

    To monitor the Server hardware the ESXi is not ideal since the usual monitoring application which come with the server work only with ESX and not ESXi. They using the Redhat Console to install the monitoring agents. (That’s the case for Fujitsu servers)

    I guess that they will adapt to ESXi sooner or later.

    Great tip Rick..

  4. Rick Scherer
    10:47 am on October 16th, 2009

    Vladan,

    Most major vendors are now embedding their agents within ESXi (downloadable from the vendor) which allows ESXi to interact with underlying hardware. Another option is CIM.

  5. Doug
    11:35 am on February 12th, 2010

    Is there anything that will restore my ESXi 3.5 configuration after I have flashed my embedded host to ESXi 4.0?

    Thanks,
    Doug

  6. Rick Scherer
    6:54 pm on February 18th, 2010

    Doug,

    You may be able to reinstall ESXi 3.5 using the ESXi Installable media. If not, you’ll need to have it reflashed (mounting device to another machine and using DD to write the ESXi 3.5 image to it).

    However you will need to rebuild the config from scratch unless you have a vicfg-cfgbackup file.

  7. alojamento web
    4:00 am on July 22nd, 2010

    Hi,
    I need to upgrade the EXsi host from version 3.5 to version 4.1. I am planning to run this backup script. Is there any risk of loosing data making this upgrade?
    Regards

  8. Doug C
    10:45 am on August 16th, 2010

    Our experience shows that this will not restore your ESXi 3.5 embedded configuration to a newly-flashed ESXi 4.0 embedded. I think my colleague here said that it won’t even work from 4.0 to 4.1. We have used it successfully within the same point release, however.

Leave a Comment

Name (required)

Email (required)

Website

Comments

More Blog Post