Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How openstack manages volumes

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "openstack how to manage volumes", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how openstack manages volumes" this article.

A volume is a removable block storage device, similar to a USB hardware driver. You can add a volume to a CVM instance. Create and manage volumes using a combination of nova and cinder client commands.

Migration Volum

As an administrator, you can migrate a volume from one place to another, and its migration is transparent to users. You can only migrate volumes that do not have snapshots and are not attached to the CVM instance.

Volume migration uses the cinder migrate command, as follows:

Cinder migrate volumeID destinationHost-- force-host-copy True | False

When force-host-copy is True, perform a general host-based migration mechanism to bypass any driver optimization.

Note: if the volume has a snapshot, the specified target host cannot accept the volume. If the user is not an administrator, the migration fails.

Create a volume

This example creates a volume called my-new-volume based on a mirror.

1. List the mirrors and remember the volume ID to use

two。 List the available space and record the ID to be used

3. Create a volume with 8 gibibytes (GiB) space

Cinder create 8-display-name my-new-volume-image-id 397e713c-b95b-4186-ad46-6126863ea0a9-availability-zone nova

4. Verify that the creation is successful

If the creation is successful, it is the status is available. If its status is error, it is possible that the quota has been exceeded.

Create a volume based on the specified volume type

Cinder supports three ways to specify the volume type when creating a volume

1.volume_type . Add the-- volume-type parameter specified by the command

2.cinder_img_volume_type (via glance image metadata). Reference a mirror that contains the cinder_img_volume_type attribute

3.default_volume_type (via cinder.conf). Set the default value in the profile.

Volume_type

Add the-- volume-type parameter to specify when using the create command

Cinder create-name-volume-type cinder_img_volume_type

If glance image has the cinder_img_volume_type attribute, cinder uses this parameter to specify the volume type when creating the volume.

Select a mirror with cinder_img_volume_type attributes and reference it to create a volume

Glance image-listglance image-show a8701119-ca8d-4957-846c-9f4d27f251facinder create-- name test-- image-id a8701119-ca8d-4957-846c-9f4d27f251fa 1default_volume_type

If the above situation is not satisfied, Cinder is defined using the default _ volume_ type value in cinder. Confession when creating the volume.

For example, the cinder.conf file is configured as follows

[default] default_volume_type = lvmdriver-1 add volumes to the CVM instance

1. To add a volume to a CVM, you need to specify the CVM ID and volume ID

Nova volume-attach 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 573e024d-5235-49ce-8332-be1576d323f8 / dev/vdb

two。 View volume information

Cinder show 573e024d-5235-49ce-8332-be1576d323f8

The output shows that this volume is added to the ID 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 CVM, and the free space is nova and bootable.

Resize Volum

1. To resize the volume, first remove it from the cloud host. To remove the volume of a CVM, you need to transfer the CVM ID and volume ID

Nova volume-detach 84c6e57d-a6b1-44b6-81eb-fcb36afd31b5 573e024d-5235-49ce-8332-be1576d323f8

The command nova volume-detach does not output information.

two。 List Volum

Cinder list

You can see that the status of the volume is now available.

3. Resizing the volume requires passing the volume ID and the adjusted value (the adjusted data is larger than the old one)

Cinder extend 573e024d-5235-49ce-8332-be1576d323f8 10

Note: when you extend a LVM volume with a snapshot, the volume will be invalidated. It will not be automatically reactivated unless the auto_activation_volume_list parameter is defined in lvm.conf.

Delete Volum

1. To delete a volume, you must remove it from the CVM instance. How to remove the volume look at the previous steps

Delete volume transferable volume name or ID

Cinder delete my-new-volume

two。 Listing the volume again, you can see that the deleted volume has a status of deleting

Cinder list

When the volume is deleted successfully, the execution of cinder list will not appear again

Transfer volume

Use the cinder transfer command to transfer ownership of the volume to someone else. The donor (original owner) of the volume creates a transfer request and then transfers the ID and authorizes the key to the recipient. The volume receiver needs to use ID and key to receive.

Note: the transfer steps of the volume apply to tenants in the same cloud (tenants)

Create a transfer request

1. Log in as a volume donor and list the available volumes:

two。 Log in as a volume donor and create a transfer authorization code for the volume you want to transfer

Cinder transfer-create volumeID

3. The status of the volume to be transferred must be available, or the request will be denied. If the transfer request is valid in the database (no expiration or deletion), the volume is set to the awaiting-transfer state

Cinder transfer-create a1cdace0-08e4-4dc7-b9dc-457e9bcfe25f

Remarks: 1. You can specify the name of the volume transfer through the-- display-name displayName parameter. The 2.auth_key property is displayed only when cinder transfer-create VOLUME_ID is executed, but not when executing the cinder transfer-show TRANSFER_ID command.

4. Send the volume transferred ID and authorized KEY to the new owner (if sent by mail)

5. Check the volume transferred by the waiter.

Cinder transfer-list when the volume is received, transfer-list will not find the volume to be transferred to receive a volume transfer request

1. The volume receiver must first obtain the volume transfer ID and the authorized key from the volume transferor

two。 Execute receive request

Cinder transfer-accept transferID authKey

For example:

Delete a volume transfer

1. List available volumes to see their status

two。 View Volume transfer ID

3. Execute the volume delete command

Cinder transfer-delete transferID

For example

4. Verify the result of the operation

Volume management and de-management

A snapshot is the time version point of a volume. Administrators can manage and manage volumes.

Manage Snapshot

Snapshot management using the cinder snapshot-manage command

Cinder snapshot-manage VOLUME_ID IDENTIFIER-id-type ID-TYPE-name NAME-description DESCRIPTION-metadata METADATA

Parameter resolution:

VOLUME_ID: the ID of the parent volume of the snapshot, which is managed by the block storage service.

IDENTIFIER: the identifier, name, or ID of the snapshot

-- id-type: the type of identifier provided by the backend device. Usually source-name or source-id. The default is source-name.

-- name: the name of the snapshot. Default is empty.

-- description: description of the snapshot. Default is empty.

-- metadata: metadata for key-value pairs. Default is empty.

The following example creates a volume named my-volume-id named my-snapshot-id snapshot

Cinder snapshot-manage my-volume-id my-snapshot-id goes to snapshot management

Delete snapshots using the cinder snapshot-unmanage command

Cinder snapshot-umanage SNAPSHOT

SNAPSHOT: the name of the snapshot or ID

For example

Cinder snapshot-unmanage my-snapshot-id above is all the content of the article "how openstack manages volumes". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report