The cinder.backup.driver Module

Base class for all backup drivers.

class BackupDriver(context, db_driver=None)

Bases: cinder.db.base.Base

backup(backup, volume_file, backup_metadata=False)

Start a backup of a specified volume.

delete(backup)

Delete a saved backup.

export_record(backup)

Export backup record.

Default backup driver implementation. Serialize the backup record describing the backup into a string.

Parameters:backup – backup entry to export

:returns backup_url - a string describing the backup record

get_metadata(volume_id)
import_record(backup_url)

Import and verify backup record.

Default backup driver implementation. De-serialize the backup record into a dictionary, so we can update the database.

Parameters:backup_url – driver specific backup record string

:returns dictionary object with database updates

put_metadata(volume_id, json_metadata)
restore(backup, volume_id, volume_file)

Restore a saved backup.

class BackupDriverWithVerify(context, db_driver=None)

Bases: cinder.backup.driver.BackupDriver

verify(backup)

Verify that the backup exists on the backend.

Verify that the backup is OK, possibly following an import record operation.

Parameters:backup – backup id of the backup to verify
Raises:InvalidBackup, NotImplementedError
class BackupMetadataAPI(context, db_driver=None)

Bases: cinder.db.base.Base

TYPE_TAG_VOL_BASE_META = 'volume-base-metadata'
TYPE_TAG_VOL_GLANCE_META = 'volume-glance-metadata'
TYPE_TAG_VOL_META = 'volume-metadata'
get(volume_id)

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.

put(volume_id, json_metadata)

Restore volume metadata to a volume.

The json container should contain a version that is supported here.

Previous topic

The cinder.backup.chunkeddriver Module

Next topic

The cinder.backup.drivers.ceph Module

This Page