vsphere_static_160x300
Free Business and Tech Magazines and eBooks
Badges

vexpert_logo_100x57

gestaltitbadge

follow-me-twitter

Subscribe to me on FriendFeed

Comments / DISQUS
Feedjit.com

How to Backup VMware ESX Servers

The subject of backing up ESX hosts for disaster recovery comes up from time to time, but not nearly as often as backing up the virtual machines. To be specific, I am talking about backing up the ESX Service Console. Honesty, to reinstall ESX takes such little time there is really no need to keep a full system backup for recovery. There is an advantage to saving key configuration files and folders to quickly re-apply after a re- installation, however. This can be done without installing a backup agent on the ESX Service Console.

This post provides information on what ESX Service Console files and directories to backup, how to use the tar command to create a backup file, and then how to restore from the backup file after a new installation. The material comes from one of the VMware Authorized Consultant (VAC) toolkit documents that I often use for customer documentation deliverables. To give credit where credit is due, the author of the document is listed as “VMware PSO – Practice Development”.

The rest of this post is copied from the VAC toolkit document except for a few format changes.

VMware ESX Server Host Backups

Backing up the VMware ESX Server host is not a recommended practice since a typical ESX build takes minutes from start to finish. Since all critical data is stored on the SAN, it is not necessary to backup the Service Console.

In the event that VMware ESX Server host has a large amount of customization, backups may be conducted of the files and directories. Within the environment there should not be extensive changes to the default environment to warrant the backups.

ESX Files and Directories to Back Up

File Description
/etc/passwd The password file containing the local users for the VMware ESX Server host service console.
/etc/shadow The shadow password file containing local users and encrypted passwords for the VMware ESX Server host service console.
/etc/group The group file for containing local security groups for the VMware ESX Server host service console.
/etc/grub.conf The boot information for the grub boot loader.
/etc/vmware The configuration files for VMware ESX host.
/boot The boot partition for VMware ESX host. It should be noted that these should be default.
/home/ Any user information that is stored on the home directory on the local machine.

To perform the backup, a file can be generated using the following command:

# tar –cvf esx1-backup.datestamp.tar /etc/passwd /etc/shadow /etc/group /etc/grub.conf /etc/pam.d /etc/vmware /boot/ /home/

VMware ESX Server Host Restore

Normally, VMware ESX Server should be reinstalled and connected to the shared storage. If the above steps were conducted, complete restoration can be performed through the following steps:

  1. Re-install ESX with the same partition configuration as the original host.
  2. SFTP files back on.
  3. Remove the /etc/vmware & /boot directories by typing the following commands

    # cd /

    # rm –Rf /etc/vmware

    # rm –Rf /boot

  4. Restore the backup set on the new ESX host. Be sure to overwrite existing files on restore! For example, from the root directory you can issue the following command to restore from the original tarball:

    tar –xvf <esx#-backup>.<date>.tar

    # tar –xvf esx1-backup.datestamp.tar

  5. Reboot.

Related Posts

  • Steffen Özcan
    Hi Rich, nice and simple way to backup a host, thanks for sharing! But what about ESXi? Our hosts have a lot of customization, so we are using Acronis True Image right now to backup our ESX servers. For our new ESXi servers this solution obviously wont work. May you are aware of a working solution for ESXi backups?

    BR
    Steffen
  • Steffen,

    I am not aware of a manual process for backing up ESXi configurations today.

    Have you heard about Veeam's Configurator that is in beta right now? This product works for both ESX and ESXi and is available for download today. Configurator can not only backup your customized networking and storage settings but also distribute those settings to multiple ESX/ESXi hosts. check it out at http://veeam.com/vmware-esx-configure.html
  • Steffen Özcan
    Yes, I heard of Veeam´s Configurator, they have a lot of very useful tools. Unfortunately, the responsibles over here do not want to spend money on such tools, so we´ve been searching for free of charge solutions :/.
    In the meantime, my colleague found a solution using the RCLI and a script named vicfg-cfgbackup.pl. Take a look here --> http://www.vm-help.com/esx/esx3i/esx_3i_rcli/vi... or http://www.vmware.com/pdf/vi3_35/esx_3/r35u2/vi...

    BR
  • Chris
    I've tested the above procedure in our lab on ESX 3.5 update 2 and it fails to restore the host settings. After the reboot the system is stuck in the grub bootloader menu.
    Has anyone else tried the above procedure successfully. It would be nice to have this working to restart our hosts.
    One thing to note, when you issue the commands to remove the directories there are errors that volume is busy.
  • Silvan
    I tried this procedure to restore a ESX 3.5 update 1 whit no luck.
    Same problem as chris.
    Any suggestions ?
    Thanks
  • Chris, Silvan,

    Hmmmm. I wonder if the latest ESX 3.5 updates have changed something that makes this process invalid. I have not tried this myself recently, so I'll double check the latest VAC documentation and do some research. if I find anything I will post a comment back here on this post.
  • tete
    tete
  • Haim Beyhan
    The same problem here. My server is not restarting after restore....
  • mwg
    Speaking as an old Linux guy, I was wondering why you'd want to back up (much less restore) /etc/grub.conf or the files in /boot. A problem in grub.conf is going to prevent the server from booting. It would seem to be much safer to let ESX manage those files, and modify them if necessary with ESX tools like esxcfg-boot.

    I'm a bit of a VMware n00b, though.
  • Woody
    Was there any updates with regards restroing vi3.5?
    Thanks
  • I have not seen any updates from VMware on backing up ESX. In fact,
    VMware seems to support the v12n community's opinion that ESX backups
    are not really needed because the re install is so quick. Installation
    scripts and deployment appliances fill the gap for configuration
    restores. Look to vSphere 4 offers host profiles to support this
    strategy as well.

    If you do go to the trouble of backing up ESX, others have suggested
    not backing up the grub config files.
  • TheAnimaniac
    For host profiles to work you need the most costly Enterprise plus license.
  • bongface
    Veeam works best for me:

    http://www.jhangra.com/blog/2009/07/how-to-inst...

    Try it in a VM first.
blog comments powered by Disqus
Hyper9 Cowabunga
Support VM /ETC
Support VMETC.com

Support VMETC.com

@rbrambley tweets
Advertisements
VMTN Roundtable Podcasts
Subscribe



Add to Google Reader or Homepage
Subscribe in NewsGator Online
Add to netvibes
Add to Plusmo