LoginSignup
2
2

More than 5 years have passed since last update.

Openstack - Cinder Snapshot/Restore

Last updated at Posted at 2015-12-09

What's this?

Cinder volume の snapshot 作成、その snapshot から新規 Cinder volume 作成

Initial state

Cinder volume

# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 5175d6be-735c-411e-be21-85015c332d99 | available | admin_vol01  |  1   |     None    |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

Take a snapshot of Cinder

Take a snapshot of Cinder

  • Cinder command
    # cinder snapshot-create --display-name admin_vol01_ss admin_vol01
    +---------------------+--------------------------------------+
    |       Property      |                Value                 |
    +---------------------+--------------------------------------+
    |      created_at     |      2015-02-17T03:35:45.077828      |
    | display_description |                 None                 |
    |     display_name    |            admin_vol01_ss            |
    |          id         | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 |
    |       metadata      |                  {}                  |
    |         size        |                  1                   |
    |        status       |               creating               |
    |      volume_id      | 5175d6be-735c-411e-be21-85015c332d99 |
    +---------------------+--------------------------------------+
  • Nova command
    # nova volume-snapshot-create --display-name admin_vol01_ss admin_vol01
    +---------------------+--------------------------------------+
    |       Property      |                Value                 |
    +---------------------+--------------------------------------+
    |      created_at     |      2015-02-17T03:35:45.077828      |
    | display_description |                 None                 |
    |     display_name    |            admin_vol01_ss            |
    |          id         | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 |
    |       metadata      |                  {}                  |
    |         size        |                  1                   |
    |        status       |               creating               |
    |      volume_id      | 5175d6be-735c-411e-be21-85015c332d99 |
    +---------------------+--------------------------------------+

Check the snapshot of Cinder

  • Cinder command
    # cinder snapshot-list
    +--------------------------------------+--------------------------------------+-----------+----------------+------+
    |                  ID                  |              Volume ID               |   Status  |  Display Name  | Size |
    +--------------------------------------+--------------------------------------+-----------+----------------+------+
    | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 | 5175d6be-735c-411e-be21-85015c332d99 | available | admin_vol01_ss |  1   |
    +--------------------------------------+--------------------------------------+-----------+----------------+------+

    # cinder snapshot-show admin_vol01_ss
    +--------------------------------------------+--------------------------------------+
    |                  Property                  |                Value                 |
    +--------------------------------------------+--------------------------------------+
    |                 created_at                 |      2015-02-17T03:35:45.000000      |
    |            display_description             |                 None                 |
    |                display_name                |            admin_vol01_ss            |
    |                     id                     | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 |
    |                  metadata                  |                  {}                  |
    |  os-extended-snapshot-attributes:progress  |                 100%                 |
    | os-extended-snapshot-attributes:project_id |   a8085d1871f847bdb906ef4a28d1bd48   |
    |                    size                    |                  1                   |
    |                   status                   |              available               |
    |                 volume_id                  | 5175d6be-735c-411e-be21-85015c332d99 |
    +--------------------------------------------+--------------------------------------+
  • Nova command
    # nova volume-snapshot-list
    +--------------------------------------+--------------------------------------+-----------+----------------+------+
    | ID                                   | Volume ID                            | Status    | Display Name   | Size |
    +--------------------------------------+--------------------------------------+-----------+----------------+------+
    | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 | 5175d6be-735c-411e-be21-85015c332d99 | available | admin_vol01_ss | 1    |
    +--------------------------------------+--------------------------------------+-----------+----------------+------+

    # nova volume-snapshot-show admin_vol01_ss
    +--------------------------------------------+--------------------------------------+
    | Property                                   | Value                                |
    +--------------------------------------------+--------------------------------------+
    | created_at                                 | 2015-02-17T03:35:45.000000           |
    | display_description                        | -                                    |
    | display_name                               | admin_vol01_ss                       |
    | id                                         | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 |
    | metadata                                   | {}                                   |
    | os-extended-snapshot-attributes:progress   | 100%                                 |
    | os-extended-snapshot-attributes:project_id | a8085d1871f847bdb906ef4a28d1bd48     |
    | size                                       | 1                                    |
    | status                                     | available                            |
    | volume_id                                  | 5175d6be-735c-411e-be21-85015c332d99 |
    +--------------------------------------------+--------------------------------------+

Restore from a snapshot of Cinder (= Clone from the snapshot)

Initial state

Cinder volume

# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 5175d6be-735c-411e-be21-85015c332d99 | available | admin_vol01  |  1   |     None    |  false   |             |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

Cinder snapshot

# cinder snapshot-list
+--------------------------------------+--------------------------------------+-----------+----------------+------+
|                  ID                  |              Volume ID               |   Status  |  Display Name  | Size |
+--------------------------------------+--------------------------------------+-----------+----------------+------+
| 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 | 5175d6be-735c-411e-be21-85015c332d99 | available | admin_vol01_ss |  1   |
+--------------------------------------+--------------------------------------+-----------+----------------+------+

Restore from a snapshot of cinder

Restore from a snapshot of cinder

# cinder create --display-name admin_vol02_from_ss --snapshot-id 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 1
+---------------------+--------------------------------------+
|       Property      |                Value                 |
+---------------------+--------------------------------------+
|     attachments     |                  []                  |
|  availability_zone  |                 nova                 |
|       bootable      |                false                 |
|      created_at     |      2015-02-17T03:44:26.871112      |
| display_description |                 None                 |
|     display_name    |         admin_vol02_from_ss          |
|      encrypted      |                False                 |
|          id         | 3559c032-6d8c-44fb-98e5-0f08d735b537 |
|       metadata      |                  {}                  |
|         size        |                  1                   |
|     snapshot_id     | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 |
|     source_volid    |                 None                 |
|        status       |               creating               |
|     volume_type     |                 None                 |
+---------------------+--------------------------------------+

Check the cinder volume

# cinder list
+--------------------------------------+-----------+---------------------+------+-------------+----------+-------------+
|                  ID                  |   Status  |     Display Name    | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+---------------------+------+-------------+----------+-------------+
| 3559c032-6d8c-44fb-98e5-0f08d735b537 | available | admin_vol02_from_ss |  1   |     None    |  false   |             |
| 5175d6be-735c-411e-be21-85015c332d99 | available |     admin_vol01     |  1   |     None    |  false   |             |
+--------------------------------------+-----------+---------------------+------+-------------+----------+-------------+

# cinder show admin_vol02_from_ss
+--------------------------------+--------------------------------------+
|            Property            |                Value                 |
+--------------------------------+--------------------------------------+
|          attachments           |                  []                  |
|       availability_zone        |                 nova                 |
|            bootable            |                false                 |
|           created_at           |      2015-02-17T03:44:27.000000      |
|      display_description       |                 None                 |
|          display_name          |         admin_vol02_from_ss          |
|           encrypted            |                False                 |
|               id               | 3559c032-6d8c-44fb-98e5-0f08d735b537 |
|            metadata            |                  {}                  |
|     os-vol-host-attr:host      |                node-17               |
| os-vol-mig-status-attr:migstat |                 None                 |
| os-vol-mig-status-attr:name_id |                 None                 |
|  os-vol-tenant-attr:tenant_id  |   a8085d1871f847bdb906ef4a28d1bd48   |
|              size              |                  1                   |
|          snapshot_id           | 375528d8-7d5e-40a4-a8d6-d4b5e9fad274 |
|          source_volid          |                 None                 |
|             status             |              available               |
|          volume_type           |                 None                 |
+--------------------------------+--------------------------------------+

Environment

  • Openstack : Juno
  • Ceph : Firefly

Reference

Cinder Backup/Restore
Cinder Backup/Restore between AZ
Cinder Backup/Restore between Region
Cinder Snapshot/Restore

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2