Introduction

This feature adds the ability to create a new instance from a VM backup for dummy, NAS and Veeam backup providers. It works even if the original instance used to create the backup was expunged or unmanaged. There are two parts to this functionality:

  1. Saving all configuration details that the VM had at the time of taking the backup. And using them to create an instance from backup.
  2. Enabling a user to expunge/unmanage an instance that has backups.

Currently, it is not possible to expunge a VM with backups because the backup offering cannot be removed while backups exist. This feature addresses that gap.

The process flow is as follows:

  1. A user selects a backup and clicks the "Create Instance from Backup" button.
  2. The user can choose to create the instance straightaway (all configuration details are fetched from the backup metadata) or they can choose to configure some details details themselves with some restrictions.
  3. A new instance is created with the intended configurations.
  4. The instance is started to allocate volumes, then stopped for restore.
  5. For NAS provider, backed-up data is copied to the new instance's volumes using existing restore functionality.
  6. For Veeam, a command is sent to the Veeam server to restore the backup to the new instance location.
  7. After restore, the instance is started and ready for use.

Part 1 : Creating Instance from Backup

Saving Instance Details / Properties

The following details are needed for creating the new Instance:

  1. Hypervisor Type
  2. Template ID or ISO ID
  3. Service Offering UUID
  4. UUIDs of the Networks to attach
  5. IP and MAC Address configurations for each network
  6. Disk Offering ID, Volume Sizes, Min IOPS, Max IOPS for all data volumes

The rest of the Instance properties are not stored and retrieved from backup. Users have to set them explicitly if needed.

Applying Configuration Details

Some properties are not fetched from backup but still needs special handling.

New API

A new api createVmFromBackup is added.

The CreateVmFromBackup API needs parameters similar to DeployVmCmd because it internally creates a new VM instance. However, some of these parameters, like serviceOfferingId and templateId, are mandatory in DeployVmCmd, but in the context of creating a VM from a backup, they can be derived from the backup metadata. To avoid modifying DeployVmCmd and breaking backward compatibility, a new abstract base class was introduced which consolidates common parameters used in both APIs.

This abstraction ensures:

ParameterTypeRequiredDescription
backupidUUIDYesBackup ID to restore from
preserveipBooleanNoUse original IP/MAC. Applicable only if the original Instance is expunged
zoneidUUIDYesZone to deploy the instance
datadiskdetailsListYesDisk details for data volumes (Disk offering, size, minIops, maxIops)
serviceofferingidUUIDNoOptional override
templateidUUIDNoOptional override
Other parameters are similar
to deployVmCmd
 
---

Multiple Data Volume Support

The existing DeployVmCmd only supports creating a single data volume during instance deployment. However, backups can contain multiple data volumes, and to restore such backups, the CreateVmFromBackup API needs to support the creation of multiple data volumes.

To enable this, a new parameter named dataDiskDetails has been added to BaseDeployVirtualMachineCmd. This enhancement allows both CreateVmFromBackupCmd and DeployVmCmd to support multiple data volumes.

The instance orchestration framework has been updated to support creating and attaching multiple data volumes as part of the VM creation process.

Although this functionality is technically available in DeployVmCmd, it has not been integrated into the UI.

UI Changes


Part 2 : Support for Expunging Instances that has Backups

Currently, backup offering can not be removed from an Instance which has backups. This has been changed so that backup offering can be removed and the VM can be expunged even with backups

Framework Level Changes

Backup Usage Tracking

Backup usage tracking has undergone major changes to support the new flexibility around backup offerings.

The backup and recovery infrastructure retrieves usage metrics (backup size, number of backups, retention) from all providers. These metrics were previously returned consolidated for all backups per VM.

All current backup providers — NASDummyNetworker, and Veeam — have been updated to return usage metrics per (VMId, Backup Offering) tuple.

Usage is also tracked for backups of Expunged Instances. Pre-requisite for this is that the Database entry for the expunged VM is present. It is made sure that the db entry for expunged Instances with Backups are not auto-purged by the system itself. Users should make sure not to manually purge DB entries for such VMs.

Usage Tracking Lifecycle Changes

NAS Plugin Changes

Veeam Plugin Changes