DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.

DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
Currently Backups are tightly coupled with Instances. Restore can only be done on the same instance from which the backup was taken. If the instance is deleted, backup is not usable and restoring the full backup or individual volumes lead to random exceptions.
This limitation is mostly because of how CloudStacks Backup and Recovery framework code is written. Backup providers usually don’t care if restore is being done to the same VM from which the backup was taken. So there is an opportunity to enhance the BnR framework so that user can create a new Instance and restore from a backup is done on that instance. This will also be useful in cases where the original instance is expunged or unmanaged but the backup is still present.
Support for Dummy, NAS and Veeam Backup Providers will be provided for this feature.
The above functionality can be extended to allow a backup to be restored to another zone in the same or in a different CloudStack deployment.
Prerequisite: The backup repository need to be connected to both the zones. The backup provider need to be configured as a backup offering in the restore Zone as well.
The restore Zone will not have the backup entry in the backups table. So this will be done in two steps:
backups tableWhen restoring a backup to a new instance, or restoring an expunged instance, the user might want to reuse the state and configuration of the original VM. The metadata can be classified into two types
Volume’s uuid, size, type and path are already stored in the backups table (backed_volumes : Backup.VolumeInfo). Remaining metadata can be added as well at the time of backup. And then during restore the fields can be auto-populated in the deploy VM form. The user can choose to use different settings or use the auto-populated ones.
When restoring to different zone, the database entry might not be present. Most of these settings are irrelevant anyways on a new zone. It can be argued that only the volume uuid, size, type and path are required. A new entry in the backupstable containing the volume metadata can be created by getting the information directly from the backup repository during Import Backup. And then actual restore can be done to a new Instance.
Volume metadata can be queried in Veeam using the /api/v1/vmRestorePoints/{restorePointId}/disks api.
On NAS provider qemu-img info /path/to/disk.qcow2 can be done to get the same.
A new method in the backup provider plugin needs to be written to populate Backup.VolumeInfo from backup external id.
ImportBackup (Only for cross zone restore) :
Parameters
Result: Creates a database entry in the backups table with the backed up volume metadata.
restoreBackupToNewInstance :
Parameters
backupId
zoneId
name
hostId
displayName
accountName
domainId
projectId
networkIds
ip addresses
computeOffering
diskOfferings (for all volumes in the backed up volume list)
Note : Ensure that volume size should not be less than the backed up volume virtual size
Result: A new instance is created with the given config with all data volumes present in the backup.
New columns in the backups table
| Column | Type | Description |
|---|---|---|
| host_name | varchar(255) | last host name of the instance |
| computeoffering_uuid | varchar(40) | compute offering of the instance |
| network_uuids | text | list of attached network uuids |
| ip_addresses | text | list of ip addresses corresponding to the networks. |
In addition, the backed_volumes column will also store the diskoffering_uuid for each volume.