Openstack cinder manager volumes

Source: Internet
Author: User

Migrate (migrate) Volume

$ cinder migrate volumeID destinationHost –force-host-copy=True|False

Destinationhost target host

-Force-host-copy forced migration

Create volume

Create only volume

$ cinder create –display-name myvo1 10

Myvo1 is the name displayed after creation

10 is to create a volume with a size of 10 Gb.

Create a volume with an image attached. The instance can be directly started from this volume next time.

$ cinder create 10 –display-name mybootvolume –image-id $image_id

The size of 10 volume cannot be smaller than the minimum size of the image;

Adding volumes to an instance is equivalent to adding a hard disk to the instance)

$ nova volume-attach $instance_ID $volumes_ID /dev/vdb

/Dev/vdb: the device that is mounted to the instance. To use this space, you need to partition and format it and then mount it.

Tip: Set automatic mounting upon startup!

View volume

$ cinder show $volume_ID

Change (resize) volume size:

NOTE: If it has been attached to an instance, You Need To unmount it first;

$ nova volume-detach $instance_ID $volume_ID
$ cinder extend $volume_ID 20

20 is the size you set for volume;

Delete volume

$ cinder delete $volume_ID

Transfer (transfer) Volumes

The Administrator creates a transfer-volume, which can be used by other users;

Transfer-volume is implemented by using commands such as cinder transfer *. The admin contributes a large volume of volume and then authorizes the volume through created_id and key_id;

Create a volume transfer request (request)

First, check which volume is provided by an admin;

$ cinder list
$ cinder transfer-create $volume_id

You can append this option to add the name-display_name mytrvolume.

+------------+--------------------------------------+
|  Property  |                Value                 |
+------------+--------------------------------------+
|  auth_key  |           f4f2af3413c661e4           |
| created_at |      2013-12-27T02:23:08.679777      |
|     id     | 6df5c9d8-7f27-4846-88f6-a30b287040dd |
|    name    |                 None                 |
| volume_id  | 548a428a-439b-4191-b679-c58f227ad4e0 |
+------------+--------------------------------------+

!!! Note the auth_key and ID fields.

$ cinder list
| 548a428a-439b-4191-b679-c58f227ad4e0 | awaiting-transfer | myvo5 |20| None | false |

Note awaiting-transfer waiting for transfer

$ cinder transfer-list

+ -------------------------- + ----------- + -------------------------------------- + ------ +
| ID | volume ID | Name |
+ -------------------------- + -------------------------------------------------- + ------ +
| 6df5c9d8-7f27-4846-88f6-a30b287040dd | 548a428a-439b-4191-b679-c58f227ad4e0 | none |
+ -------------------------- + ----------- + -------------------------------------- + ------ +

$ cinder transfer-show $transfer-volumes-id

Authorize volume to be transferred

$ cinder transfer-accept $transfer-volume-id $key-id
# cinder transfer-accept 6df5c9d8-7f27-4846-88f6-a30b287040dd f4f2af3413c661e4

+ ----------- + -------------------------------------- +
| Property | value |
+ ----------- + -------------------------------------- +
| ID | 6df5c9d8-7f27-4846-88f6-a30b287040dd |
| Name | none |
| Volume_id | 548a428a-439b-4191-b679-c58f227ad4e0 |
+ ----------- + -------------------------------------- +

+ ----------- + -------------------------------------- +
| Property | value |
+ ----------- + -------------------------------------- +
| ID | 6df5c9d8-7f27-4846-88f6-a30b287040dd |
| Name | none |
| Volume_id | 548a428a-439b-4191-b679-c58f227ad4e0 |
+ ----------- + -------------------------------------- +

Delete transfer-volume

$ Cinder ttansfer-delete $ transfer-volume-ID

Compare the differences between transfer-volume and normal volume:

 

| Metadata | {} |

========================================================== ==========

| Metadata | {u'readonly': u'false '}

This article is from the "Siberian wolf" blog, please be sure to keep this source http://kernal.blog.51cto.com/8136890/1530214

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.