Tuesday, October 27, 2009

VMware ESX Server Host Backups / Restore

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.

No comments:

Quote of the Day