Create snapshot

 
MethodURIDescription
POST/v2/{tenant_id}/snapshots​{?snapshot,​volume_id,​force,​display_name,​display_description}

Creates a snapshot, which is a point-in-time copy of a volume. You can create a volume from the snapshot.

Normal response codes: 202

 Request

This table shows the URI parameters for the create snapshot request:

NameTypeDescription

{tenant_id}

​String

The unique identifier of the tenant or account.

This table shows the query parameters for the create snapshot request:

NameTypeDescription

snapshot

​String

(Required)

A partial representation of a snapshot used in the creation process.

volume_id

​String

(Required)

To create a snapshot from an existing volume, specify the ID of the existing volume.

force

​Boolean

(Optional)

[True/False] Indicate whether to snapshot, even if the volume is attached. Default==False.

display_name

​String

(Optional)

Name of the snapshot. Default==None.

display_description

​String

(Optional)

Description of snapshot. Default==None.

 

Example 3.15. Create snapshot: XML request

<?xml version="1.0" encoding="UTF-8"?>
<snapshot
    xmlns="http://docs.openstack.org/openstack-block-storage/2.0/content"
    name="snap-001" description="Daily backup"
    volume_id="5aa119a8-d25b-45a7-8d1b-88e127885635" force="true"/>

 

Example 3.16. Create snapshot: JSON request

{
    "snapshot": {
        "name": "snap-001",
        "description": "Daily backup",
        "volume_id": "5aa119a8-d25b-45a7-8d1b-88e127885635",
        "force": true
     }
}

This operation does not require a request body.

 Response

 

Example 3.17. Create snapshot: XML response

<?xml version='1.0' encoding='UTF-8'?>
<snapshot status="creating" description="Daily backup"
    created_at="2013-02-25T03:56:53.081642"
    volume_id="5aa119a8-d25b-45a7-8d1b-88e127885635" size="1"
    id="ffa9bc5e-1172-4021-acaf-cdcd78a9584d" name="snap-001">
    <metadata/>
</snapshot>

 

Example 3.18. Create snapshot: JSON response

{
   "snapshot":{
      "status":"creating",
      "description":"Daily backup",
      "created_at":"2013-02-25T03:56:53.081642",
      "metadata":{

      },
      "volume_id":"5aa119a8-d25b-45a7-8d1b-88e127885635",
      "size":1,
      "id":"ffa9bc5e-1172-4021-acaf-cdcd78a9584d",
      "name":"snap-001"
   }
}

This operation does not return a response body.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page