How to Backup ESXi VMs in 3 steps
Whether it’s an individual or company, it is recommended that anyone who has VMs backs them up regularly. VMware ESXi is the most commonly used platform for hosting virtual machines on a Windows computer. Backing up your ESXi VMs is one way to ensure that at any time there’s a data loss case, you can fall back to safety and still have access to your VMs. There are different ways to back up EXSi VMs, and that’s what this article tries to explain.
VMware ESXi VM Backup Overview
ESXi is a type-1 hypervisor developed by VMware for hosting and deploying virtual machines. It literally serves as an “Operating System” for virtual machines to run. You can host more than three VMs on an ESXi host. Your VMs on an ESXi host have their data and configuration details stored in VMDK format (as VMDK files).
If the VMDK file gets corrupted, deleted, or tampered with, you will be unable to access your virtual machines on the ESXi host. Thus, it is important to always make a backup of your VM files, either you do it individually for each VM or collectively by backing up the VMDK file. Data loss is almost imperative, so securing your VM files should be one of your priorities.
Backup options for VMware ESXi
You can either choose to use the proprietary backup utility offered by VMware via its VCenter platform to back up your VM data and host configuration or look to a third-party backup software to help out. Alternatively, you can download the VMs’ VMDK files and export them to another storage location to serve as backup copies of the VMs.
However, using a third-party software program looks to be the best way to go about backing up your VMware ESXi hosts and VM data. These programs offer a more intuitive interface, along with many handy features and tools for VM backup and recovery. For a newbie, using a software program is easier and more understandable; notwithstanding, even professionals use programs.
How to Backup VMware ESXi Virtual Machines
Out of the many possible ways to back up your ESXi VMs, we have outlined the best three methods to do that. These methods are effective and pretty easy to practice – ensure to pay attention to every detail explained below.
Method 1: Download and Backup the VMDK File
All information about the data stored in your ESXi VMs – including the configuration data – are saved into an image file in VMDK format. VMDK is a file container format for VMware that stores every necessary information about your virtual machines deployed on an ESXi server. So manually downloading the VMDK file and saving it elsewhere can serve as a backup.
- Access the ESXi Web Client or log into your VCenter
- Find the VM you need to back up its data and configuration and select it
- (If you’re using VCenter) Right-click on the VM and select “Edit Settings”
- Check the Hard Drive tab for the VMDK file of that VM
- You can download it from here.
Note: The VMware ESXi Web Client lets you VMDK files and VMX configuration files from the datastore. To restore this backup, re-upload the downloaded files and launch a new VM to run with the uploaded data on the same original host server or a new one. VMware VCenter also has a “Copy” option to simply copy VMDK files to another storage.
Method 2: Export the Virtual Machine to OVF Template
The Open Virtualization Format (OVF) file format offers wide support for sharing and managing VM files. Some IT guys use the OVF template to create new virtual machines. OVF files are archived, so they are smaller in size and faster to download. When you export a VM’s data as OVF, everything about the VM will be included in the exported file.
The OVF Template is supported by VMware ESXi and XenServer platforms. So, you can back up your VM from ESXi and export it to XenServer without facing compatibility issues. Typically, the OVF format contains metadata info, configuration data file, and the XML file stored in vCenter. Below is a guide to help you work around this backup method.
- Log in to your VMware vCenter and select the VM you want to export its data.
- Right-click on the virtual machine and select Template from the menu options
- Choose the “Export OVF Template” option
- Name the task and click OK.
- The VM files will be downloaded to your machine
>Method 3: Backup and Recover VMware ESXi Virtual Machines with DiskInternals VMFS Recovery
Backing up and recovering VMware ESXi virtual machines (VMs) is a crucial aspect of maintaining a virtual environment. DiskInternals VMFS Recovery is a tool designed to recover data from VMFS-formatted drives. Here's a step-by-step guide on how to backup and recover VMware ESXi VMs using DiskInternals VMFS Recovery:
1. Backup VMware ESXi VMs:
The first step is to ensure your VMs are regularly backed up. This isn't done with DiskInternals VMFS Recovery – this tool is for recovery. For backups, you can use VMware's native tools or third-party solutions.
Using VMware's native tools:
- Connect to the ESXi host using the VMware vSphere Client.
- Locate the VM you wish to backup in the inventory.
- Right-click on the VM and select
- Give the snapshot a name and description.
OKto create the snapshot.
- Once the snapshot is created, you can use the datastore browser to download the VM's files to a safe location.
2. Recover VMware ESXi VMs using DiskInternals VMFS Recovery:
Pre-requisite: Before proceeding, make sure the VMware ESXi server is running, and you have access to the VMFS datastore where the VM data resides.
1. Install and Launch DiskInternals VMFS Recovery:
- Download the tool from the official website.
- Follow the installation instructions to install it on your Windows machine.
2. Scan VMFS Datastore:
- Launch DiskInternals VMFS Recovery.
- The tool will automatically detect and display all the hard drives available.
- Choose the drive that represents your VMFS datastore.
- Right-click on it and select
Recovery, depending on your needs.
3. Locate and Restore VMs:
- The tool will start scanning the selected drive for VM data.
- Once the scan completes, navigate through the folders to find your VM files (VMDK files).
- Select the necessary VMDK files or any other files you wish to recover.
- Right-click on the selected files and choose
4. Specify Recovery Destination:
- Choose a destination on your local machine or another storage device to save the recovered files.
- Make sure there's enough free space at the destination.
5. Restore VM on ESXi:
- After recovering the VM files, you can upload them back to your ESXi server using the VMware vSphere Client's datastore browser.
- Once uploaded, you can add the VM to the inventory and power it on.
Note: The success of the recovery process depends on various factors like the extent of the damage, overwrite operations, and more. Always make sure you have good backups in place to minimize data loss scenarios. If critical data is at stake, it might be wise to consult with a professional or the software's support team.
How to Backup VMware ESXi Host Configuration?
Backing up your ESXi host configuration saves you the time and energy to reconfigure a new host if need be. More so, backing up your ESXi host is not much of a big deal, there are three different methods to go about this, and the methods are safe to practice – however, a bit advanced and require familiarity with CLI interfaces.
Using ESXi Command Line
- Firstly, you have to enable Secure Shell (SSH) so you can connect to your ESXi host
- ESXi host configurations are actually saved hourly to the /bootblank/state.tgz file, hence, you need to sync your current ESXi host configuration with the persistent storage (the /bootblank/state.tgz file). The command to trigger this synchronization is:
- # vim-cmd hostsvc/firmware/sync_config
- Then, after the synching, proceed to back up the ESXi host configuration using this command:
- # vim-cmd hostsvc/firmware/backup_config
Note: this command will output a URL, which you’re to copy into a web browser to download the backed-up ESXi host configuration. In the provided URL, replace the “*” with your host’s ESXi host IP before running it on a web browser to download the content.
Using VMware Power CLI
- Download and install the VMware Power CLI module, launch it as an Admin, and run this code to connect your ESXi host:
- Connect-VIServer ESXi_IP_address -user user_name -password your_password
- (replace the bolded words with the actual details)
- To backup your ESXi VM after the server has been connected, run this command:
- vicfg-cfgbackup --server=ESXi_host_IP_address --username=root -s output_file_name
- (remember to replace the bolded words too)
These commands will back up your VM in tgz format and save it in your indicated output directory.
Using vSphere CLI
- Install and set up the vSphere CLI, then run it as an Administrator.
- Enter this command to backup your ESXi VM:
- vicfg-cfgbackup --server= ESXi_host_IP_address --username=root -s output_file_name
- If you’re using Windows OS, run CMD as an Admin and navigate to C:\Program Files\VMware\VMware vSphere CLI\bin
(Note: the 64-bit version installs in C:\Program Files, while the 32-bit version installs in C:\Program Files (x86)).
- When in the CLI folder, run the backup command:
vicfg-cfgbackup.pl --server=ESXi_host_IP_address --username=root -s output_file_name
Backing up your ESXi host configuration and VM data is very essential for every IT admin and there are different ways to go about this. Using VMware Backup and DiskInternas VMFS Recovery software is one of the most intuitive ways to achieve seamless ESXi VM backup and recovery.