Core backup driver interface.
All backup drivers should support this interface as a bare minimum.
Bases: CinderInterface
Backup driver required interface.
Start a backup of a specified volume.
If backup[‘parent_id’] is given, then an incremental backup should be performed.
If the parent backup is of different size, a full backup should be performed to ensure all data is included.
backup – The backup information.
volume_file – The volume or file to write the backup to.
backup_metadata – Whether to include volume metadata in the backup.
The variable structure of backup in the following format:
{
'id': id,
'availability_zone': availability_zone,
'service': driver_name,
'user_id': context.user_id,
'project_id': context.project_id,
'display_name': name,
'display_description': description,
'volume_id': volume_id,
'status': fields.BackupStatus.CREATING,
'container': container,
'parent_id': parent_id,
'size': size,
'host': host,
'snapshot_id': snapshot_id,
'data_timestamp': data_timestamp,
}
service: backup driver parent_id: parent backup id size: equal to volume size data_timestamp: backup creation time
Method for checking if backup backend is successfully installed.
Depends on storage backend limitations and driver implementation this method could check if all needed config options are configurated well or try to connect to the storage to verify driver can do it without any issues.
None
Delete a backup from the backup store.
backup – The backup to be deleted.
Export driver specific backup record information.
If backup backend needs additional driver specific information to import backup record back into the system it must override this method and return it as a dictionary so it can be serialized into a string.
Default backup driver implementation has no extra information.
backup – backup object to export
driver_info - dictionary with extra information
Get volume metadata.
Returns a json-encoded dict containing all metadata and the restore version i.e. the version used to decide what actually gets restored from this container when doing a backup restore.
Typically best to use py:class:BackupMetadataAPI for this.
volume_id – The ID of the volume.
json-encoded dict of metadata.
Import driver specific backup record information.
If backup backend needs additional driver specific information to import backup record back into the system it must override this method since it will be called with the extra information that was provided by export_record when exporting the backup.
Default backup driver implementation does nothing since it didn’t export any specific data in export_record.
backup – backup object to export
driver_info – dictionary with driver specific backup record information
None
Set volume metadata.
Typically best to use py:class:BackupMetadataAPI for this.
volume_id – The ID of the volume.
json_metadata – The json-encoded dict of metadata.
Restore volume from a backup.
backup – The backup information.
volume_id – The volume to be restored.
volume_file – The volume or file to read the data from.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.