Virtual Machine Backup Overview & Necessity
A virtual machine (VM) is a virtual environment based on computer architectures and provide functionality of a physical computer. It allow users to run an operating system in a single application window, providing a secure sandbox to test programs or access virus-infected data.
Virtual machines are run on hypervisor, and a hypervisor allows one host computer to support multiple guest VMs by virtually sharing its resources. There are mainly 2 types of hypervisors:
Type 1 hypervisor: also known as bare-metal hypervisor, runs directly on the computing hardware. VMware ESXi and Microsoft Hyper-V are the most commonly used type 1 hypervisor.
Type 2 hypervisor: also known as hosted hypervisor, runs on top of the operating system of the host machine. VMware Workstation is the most commonly used type 2 hypervisor.
Whichever host you are running VMs on, there may be data loss caused by virtual server or physical device failures, abnormal shutdown, or other mis-operations. Therefore, it is essential to create virtual machine backup regularly.
By creating VM backups, you can effectively ensure that important data can be restored in time if it is lost. Implementing a good VM backup strategy can enable faster disaster recovery, and keep business continuity.
Virtual Machine Backup vs Snapshot, Are They the Same?
A common myth about VM backup is how it differs from the VM snapshot and whether they can replace each other? To answer this, let's take a closer look at the 2 concepts:
VM snapshots: Snapshots (or checkpoints for Hyper-V) record the state of a VM at a point in time, including all data, memory, devices on the network, network interfaces, and power state. It can roll back the VM to that point in time when problem occurs. However, it relies on pre-existing physical or virtual machine files to restore data.
VM Backups: Backups are complete copies of virtual machines, but independent of the VM. They can be securely stored in the cloud, in a separate location, or offsite. They allow you to recreate VMs without relying on source VMs.
VM snapshot vs VM backup: Simply put, a snapshot can be seen as a means of backup in a broad sense, but it is not a complete replacement for a backup. To better distinguish them, here I list 3 main differences:
|VM snapshot||VM backup|
|Data security||Snapshots depend on the parent disk, and record incremental changes from a point in time. If a VM's parent disk is deleted, you cannot restore it from snapshot||VM backups are independent and not affected by this|
|Backup Speed||Faster||Slower. The more data is backed up, the longer the backup takes|
|Space Taken||Depend on the snapshot number and the data volume has changed||VM backups can take up a lot of your storage space|
Overall, snapshots are very convenient for quick testing and troubleshooting, but cannot be use as a long-term way to protect data from disaster. So they are not recommended for production environments.
Meanwhile, virtual machine backups can be used as a long-term, fixed data protection measure. If there are risks that your VM disks may be deleted or the VM infrastructure may fail, VM backups may be safer.
The following content will focus on the classification and methods of VM backup. In practice, however, you can also combine backups and snapshots as you wish.
Virtual machine backup methods can be divided into many types from different perspectives, which also creates some difficulties for users to understand. But in terms of how it works, you basically only need to consider the following two main types regardless of the hypervisor: file-based backup and image-based backup.
Usually when IT staffs talking about Hyper-V or VMware virtual machine backup, they mean image-based backups. This is due to a lower tolerance for downtime and a higher need for rapid recovery in production environments.
But beyond that, you may need to consider more granular backup categories and needs in order to create a VM backup strategy that better suits your actual needs.
Other common VM backup needs you may consider
👉 Different backup method
◇ Full backup: Complete backup of the operating system, applications, and all data on the virtual machine.
◇ Differential backup: Back up only the data that has changed since the last full backup. Restore requires the full backup which was the differential base, and the last differential backup.
◇ Incremental backup: Back up only the data that has changed from the last backup. Restore requires the full backup which was the incremental base, and all incremental backups.
👉 Backup to different storages
◇ Local backup: Store the VM backup files in the local path of the host.
◇ Remote backup: Store the VM backup files in the remote server, for example, a network share, or cloud.
👉 Different backup frequency
◇ Immediate backup: Backup virtual machine once by manual operation.
◇ Regular backup: Create a backup schedule to perform automatic virtual machine backup.
Next, I will present an image-based virtual machine software that meets all these needs for VMware and Hyper-V.
Image-based virtual machine backup is usually achieved by agentless backup software, which can centralize the backup job in a single console without deploying agent program to each VM.
Therefore, many IT staffs turn to a dedicated virtual backup software. If you use the free version of VMware ESXi, your options for VM backup and restore may be limited by not supporting vStorage APIs. Therefore, you may need to find a backup tool that supports the free ESXi.
Here I introduce you AOMEI Cyber Backup, the free VM backup software that supports both paid and free versions of VMware ESXi. It offers you the following benefits:
✦ Agentless Image Backup: create independent and image-based backup for VMware ESXi and Hyper-V VMs.
✦ Support Free ESXi: support both paid and free versions of VMware ESXi.
✦ Various Backup Methods: Besides full backup, you can perform incremental or differential VM backup to capture only changed data and save storage space.
✦ Automated Hot Backup: auto backup running VMs and notify via email.
✦ Restore from Any Point: Restore a whole VM to usable state from any history backup version.
AOMEI Cyber Backup supports VMware ESXi 6.0 and later versions, as well as Hyper-V in Windows 8/8.1/10/11, Windows Server/Microsoft Hyper-V Server 2012 R2 and later versions.
In next section I will demonstrate how to create an automatic ESXi or Hyper-V VM backup task. You can click the following button to download the free edition.
*You can choose to install this VM backup software on either Windows or Linux system.
3 easy steps to create automatic backup tasks of multiple VMs
1. Bind Devices: Access to AOMEI Cyber Backup web client, navigate to Source Device > VMware/Hyper-V > + Add VMware Device/Hyper-V to add a host. And then click … > Bind Device.
2. Create Backup Task: Navigate to Backup Task > + Create New Task, and then set up Task Name, Backup Type, Device, Target, and Schedule as needed.
- Device: cover multiple VMs (10 on Free Edition) on the host in one backup task.
- Target: You can select to back up to a local path, or to a network path. Used paths will be saved in Favorite Storage for handy selection.
- Schedule: You can choose to perform full, differential or incremental backup, and automate execution daily, weekly or monthly according to the frequency you specified.
3. Start Backup: Click Start Backup and you select Add the schedule and start backup now, or Add the schedule only.
Created backup tasks will be listed and monitored separately, for progress checking and schedule changing.
As said above, there are some native backup options come with the hypervisor. They may be somehow different from backups in a strict sense, but they do provide a degree of data protection.
Next I will use VMware and Hyper-V as examples for a brief explanation. You can click on the anchor text to jump to corresponding part.
As one of the most popular type-1 hypervisor, VMware ESXi offers you some convenient options to save or deploy virtual machine. Here I will introduce 2 frequently used methods:
👉Method 1. Manually download virtual machine disk files from VMware ESXi
1. Access ESXi Web Client, commit all snapshots and power off the virtual machine you want to back up.
2. Turn to Storage page, click Datastore browser on toolbar. Locate the folder of the virtual machine you want to back up, and click Download to download them separately to local.
4. Close Datastore browser window, and you can see the progress in Recent tasks.
👉Method 2. Export the virtual machine as OVF template
1. Access ESXi Web Client, commit all snapshots and power off the virtual machine you want to back up.
2. Go to Virtual Machines page, right-click the virtual machine you want to backup and select Export. Click OK to confirm it.
3. Select Save File option twice to download the .ovf file and .vmdk file. Then click OK to close the window.
When it’s done, you can click download button on toolbar to find where these files are stored.
The backup options in VMware Workstation are similar to ESXi, and you can find an additional feature - VM cloning. Let's take a look at them:
In this section, I will demonstrate how to use these ways to backup VMware Workstation VMs.
👉Method 1: Manually copy virtual machine disk files
1. Launch VMware Workstation, move the cursor to the name of the VM you want to backup. There will be a box showing the folder path where the virtual disk files and configuration files of this system are stored.
2. Come to the folder, and then copy all files or the whole folder to the destination location where you want to store the backup.
👉Method 2: Export virtual machine to OVF template
1. Launch VMware Workstation, select the target VM, and click File on the toolbar, select Export to OVF…
2. Select a path where you want to save the OVF template file in the pop-up window, and then click Save.
3. Wait for the Export process. The more software you installed in this system, the more time this process will cost.
When it’s accomplished, you will find 3 files in destination location. The manifest file ends with .mf, the OVF file which provides a complete specification of the virtual machine, and the virtual disk file ends with .vmdk.
Tip: You can also backup VMware Workstation VM by manually copy disk files or clone.
👉Method 3: Clone your virtual machine
1. Launch VMware Workstation, select the VM you want to clone.
Then click VM button on toolbar, and select Manage > Clone… to open Clone Virtual Machine Wizard. Click Next in the pop-up window.
2. Designate Clone Source. You can choose to Clone from the current state in the virtual machine, or from an existing snapshot (powered off only). If you select the upper one, workstation will create a snapshot before cloning it; if you don’t have a usable snapshot, the second choice will be unselectable.
3. Click Next to continue, and designate Clone Type. You can create a linked clone, or create a full clone.
4. Provide the name and storage path of your clone. Then click Finish.
Although with different hypervisor, the way Hyper-V virtual machines are backed up is also similar to VMware:
👉Method 1: Export Hyper-V VM via Hyper-V Manager
1. Launch Hyper-V Manager. Right-click the VM you want to backup, select Export…
2. Click Browse to specify where you want to save the files in the pop-up window.
3. Wait for the Export progress to complete. The more software you installed in this system, the more time this process will cost. When it's done, you will find 3 folders in the destination location - the VHD files, VM configuration files, and the snapshots.
👉Method 2. Backup VMs using Windows Server Backup
You can also use the built-in backup utility Windows Server Backup for Hyper-V VMs. Try following steps:
1. Launch Server Manager. Click Manage -> Add Roles -> Features -> Next -> Role-based or feature-based installation -> Next. Select the Server from the server pool and proceed to Features page, find and check Windows Server Backup in Features list to install.
2. Then you can click Tools and access Windows Server Backup. Choose Backup Schedule or Backup Once according to your needs. Here take Backup Once as an example.
3. Follow the Backup Once Wizard to make your choice. In Select Backup Configuration page, you can select Custom to choose a specific folder or files. Then click Next.
4. Click Add items to select the Hyper-V VM you want to back up, and specify a Destination Type and in the next step. You can choose backup Hyper-V to local drive or network share.
5. After selecting a Destination location, you can confirm the settings and click Backup to start.
Virtual machine backup is one of the most basic measures to ensure VM data security. In this article, I introduced what is virtual machine backup, how can you pick a VM backup solution properly, and how to create backups for VMware and Hyper-V VMs.
Besides, as another failsafe measure, please note that VMware snapshots cannot be used as backups, or you may result in data loss.