How to Backup VMware ESX Servers

Posted on 3:20 PM by Bharathvn

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 ..tar

    # tar –xvf esx1-backup.datestamp.tar

  5. Reboot.