Jump to: navigation, search

Difference between revisions of "Trove/volume-data-snapshot-design"

(Configuration)
(Database)
Line 44: Line 44:
  
 
=== Database ===
 
=== Database ===
Data snapshot table:
+
No changes
  - id: UUID (string)
 
  - instance_id: UUID (string) (i guess it could be optional)
 
  - volume_id: UUID (string)
 
  - datastore: UUID (string)
 
  - datastore_manager: String
 
  - datastore_version: UUID (string)
 
  - created: timestamp
 
  - deleted: timestamp
 
 
-------------------------------------------------------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------------------------------------------------------
  

Revision as of 10:18, 8 April 2014

Data volume snapshot

Description

Volumes Snapshots

This introduction provides a high level overview of the two basic resources offered by the OpenStack Block Storage service. The first is Volumes and the second is Snapshots which are derived from Volumes.

Volumes

Volumes are allocated block storage resources that can be attached to instances as secondary storage or they can be used as the root store to boot instances. Volumes are persistent R/W Block Storage devices most commonly attached to the Compute node via iSCSI.

Snapshots

A Snapshot in OpenStack Block Storage is a read-only point in time copy of a Volume. The Snapshot can be created from a Volume that is currently in use (via the use of '--force True') or in an available state. The Snapshot can then be used to create a new volume via create from snapshot.

Justification/Benefits

Justification

Data could be backued in two ways:
  1.  :Standart backup strategies (innobackupex, nodetoolsnapshot) + Swift container (already implemented).
  2.  :Snapshot of the attached block storage (not implemented).
Basically, its the another way of backupin' data through standard OpenStack capabilities.

Benefits

Generic way to backup the data. This feature is not the datastore-type/version specific.

Impacts

Changes the behavior to the backups made by Trove, it impacts at already implemented backuping process through native database tools (mysqldump, nodetool, etc.) and the Swift as storage container service. Changes are backward compatible.


Configuration

Configuration parameters are guest specific.
backup_agent - SwiftBackupAgent, CinderBackupAgent
Name Type Default Available variants
backup_agent String trove.guestagent.backup.backupagent.CinderAgent trove.guestagent.backup.backupagent.SwiftAgent
storage_strategy String Swift Cinder

Database

No changes


Public API

Core API extension

API call HTTP method Route
Create data snapshot POST /{tenant_id}/instances/{instance_id}/snapshots/create
Apply data snapshot POST /{tenant_id}/instances/{instance_id}/snapshots/apply
List data snapshot GET /{tenant_id}/instances/snapshots
Show data snapshots GET /{tenant_id}/instances/snapshots/{id}
Delete data snapshot POST /{tenant_id}/instances/snapshot/{id}

Create data snapshot


CLI interface
trove data-snapshot-create <instance>
Request body
    "data_snapshot": {
        "instance_id": "UUID"
    }
Response object
    "data_snapshot": {
         "instance_id": "UUID"
         "volume_id": "UUID",
         "size": "100Mb"
         "datastore": "UUID" or "name",
         "datastore_version": "UUID"
         "created": "2011-01-22T13:25:27-06:00"
    }



Apply data snapshot


CLI interface
trove data-snapshot-apply <instance>
Request body
    "data_snapshot": {
        "instance_id": "UUID"
    }
Response object

None


List data snapshot


CLI interface
trove data-snapshot-list
Request body
None
Response object
 [
    "data_snapshot_1": {
         "id": "UUID"
         "instance_id": "UUID"
         "volume_id": "UUID",
    },
    "data_snapshot_2": {
         "id": "UUID"
         "instance_id": "UUID"
         "volume_id": "UUID",
    }
 ]

Show data snapshot


CLI interface:

trove data-snapshot-show <data_snapshot>

Request body
    "data_snapshot": {
        "data_snapshot": "UUID"
    }
Response object
 {
    "data_snapshot_1": {
         "id": "UUID"
         "instance_id": "UUID"
         "volume_id": "UUID",
         "size": "100Mb"
         "datastore": "UUID" or "name",
         "datastore_version": "UUID"
         "created": "2011-01-22T13:25:27-06:00"
    }
 }

Delete data snapshot


CLI interface

trove data-snapshot-delete <data_snapshot>

Request body
    "data_snapshot": {
        "data_snapshot": "UUID"
    }
Response object
None

Internal API


From trove-api to trove-taskamanger

Message: create_data_snapshot
Parameters: instance_id, volume_id
Message type: cast
Message: apply_data_snapshot
Parameters: instance_id, volume_id
Message type: cast
Message: delete_data_snapshot
Parameters: instance_id, volume_id
Message type: cast

From trove-taskamanger to trove-guestagent

Message: apply_data_snapshot
Parameters: device_path (where the volume mounted)
Message type: cast

Guest Agent


Changes are backward compatible. Changes will be available for all datastores. This method of the backuping is generic for the all datastores types/versions.