Jump to: navigation, search

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

(Created page with "Allow user to perform volume snapshot Description ----------------------------------------------------------------------------------------------------------------------------...")
 
Line 1: Line 1:
Allow user to perform volume snapshot
+
== Data volume snapshot ==
  
Description
+
=== 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
+
==== 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.
  
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.
+
==== 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.
  
Justification/Benefits:
+
==== 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.
 
-------------------------------------------------------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------------------------------------------------------
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.
+
=== Justification/Benefits ===
 +
:Data could be backued in two ways:
 +
# :Standart backup strategies (innobackupex, nodetoolsnapshot) + Swift container (already implemented).
 +
# :Snapshot of the attached block storage (not implemented).
 +
:Basically, its the another way of backupin' data through standard OpenStack capabilities.
 
-------------------------------------------------------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------------------------------------------------------
  
Impacts
+
=== Impacts ===
 
 
Configuration
 
 
-------------------------------------------------------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------------------------------------------------------
None, yet.
+
==== Configuration ====
 +
:None, yet.
 
-------------------------------------------------------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------------------------------------------------------
  
Database
+
=== Database ===
-------------------------------------------------------------------------------------------------------------------------------------
 
 
Volume snapshot table:
 
Volume snapshot table:
 
   - id: UUID (string)
 
   - id: UUID (string)
Line 44: Line 37:
 
-------------------------------------------------------------------------------------------------------------------------------------
 
-------------------------------------------------------------------------------------------------------------------------------------
  
Public API
+
=== Public API ===
-------------------------------------------------------------------------------------------------------------------------------------
+
----------------------------
 
+
==== Create data snapshot ====
______________________
+
----------------------------
  
Create data snapshot
+
===== :CLI interface: =====
______________________
+
:
 +
:''trove data-snapshot-create <instance>''
  
CLI interface:
+
==== HTTP Method ====
 +
:POST
 +
''/{tenant_id}/instances/{instance_id}/create_snapshot''
  
trove data-snapshot-create <instance>
+
==== Request body ====
 +
:None
  
HTTP POST:
+
==== Response object ====
/{tenant_id}/instances/{instance_id}/create_snapshot
+
{
 
+
    "data_snapshot": {
Request body:
+
          "instance_id": "UUID"
 
+
          "volume_id": "UUID",
"body": {}
+
          "size": "100Mb"
 
+
          "datastore": "UUID" or "name",
Response object:
+
          "datastore_version": "UUID"
 
+
          "created": "2011-01-22T13:25:27-06:00"
"volume_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
+
---------------------------
____________________
+
==== Apply data snapshot ====
 +
---------------------------
  
CLI interface:
+
===== CLI interface =====
  
trove data-snapshot-apply <instance>
+
:''trove data-snapshot-apply <instance>''
  
HTTP POST:
+
===== HTTP Method =====
/{tenant_id}/instances/{instance_id}/apply_snapshot
+
:POST
 +
''/{tenant_id}/instances/{instance_id}/apply_snapshot''
  
 
Request body:
 
Request body:
Line 91: Line 83:
 
}
 
}
  
Response object:
+
===== Response object =====
  
 
None
 
None
  
__________________
+
------------------------
 +
==== List data snapshot ====
 +
------------------------
  
List data snapshot
+
===== CLI interface =====
__________________
 
  
CLI interface:
+
:''trove data-snapshot-list''
  
trove data-snapshot-list
+
===== HTTP Method =====
 +
:GET
 +
''/{tenant_id}/instances/snapshot''
  
HTTP GET:
+
===== Request body =====
/{tenant_id}/instances/snapshot
 
  
Request body:
+
{
 
+
    "body": {
"body": {
+
        "data_snapshot": "UUID"
    "data_snapshot": "UUID"
+
    }
 
}
 
}
  
Response object:
+
===== Response object =====
  
 
[
 
[
Line 128: Line 122:
 
]
 
]
  
_____________________
+
--------------------------
 
+
==== Show data snapshot ====
Show data snapshot
+
--------------------------
_____________________
 
 
 
CLI interface:
 
  
trove data-snapshot-show <data_snapshot>
+
===== CLI interface: =====
  
HTTP GET:
+
''trove data-snapshot-show <data_snapshot>''
/{tenant_id}/instances/snapshot/{id}
 
  
Request body:
+
===== HTTP Method =====
 +
:GET
 +
''/{tenant_id}/instances/snapshot/{id}''
  
"body": {}
+
===== Request body =====
 +
:None
  
Response object:
+
===== Response object =====
  
 +
{
 
     "data_snapshot_1": {
 
     "data_snapshot_1": {
 
           "id": "UUID"
 
           "id": "UUID"
Line 154: Line 148:
 
           "datastore_version": "UUID"
 
           "datastore_version": "UUID"
 
           "created": "2011-01-22T13:25:27-06:00"
 
           "created": "2011-01-22T13:25:27-06:00"
     },
+
     }
 +
}
  
 
_____________________
 
_____________________

Revision as of 13:58, 7 March 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

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.

Impacts


Configuration

None, yet.

Database

Volume snapshot table:

  - id: UUID (string)
  - instance_id: UUID (string) (i guess it could be optional)
  - volume_id: UUID (string)
  - datastore: UUID (string)
  - datastore_version: UUID (string)
  - created: Time
  - deleted: Time

Public API


Create data snapshot


:CLI interface:
trove data-snapshot-create <instance>

HTTP Method

POST

/{tenant_id}/instances/{instance_id}/create_snapshot

Request body

None

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>
HTTP Method
POST

/{tenant_id}/instances/{instance_id}/apply_snapshot

Request body:

"body": {

    "data_snapshot": "UUID"

}

Response object

None


List data snapshot


CLI interface
trove data-snapshot-list
HTTP Method
GET

/{tenant_id}/instances/snapshot

Request body

{

    "body": {
        "data_snapshot": "UUID"
    }

}

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>

HTTP Method
GET

/{tenant_id}/instances/snapshot/{id}

Request body
None
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>

HTTP POST: /{tenant_id}/instances/snapshot/{id}

Request body:

"body": {}

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


Guest Agent


From trove-taskamanger to trove-guestagent:

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