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

What are the common commands in ceph-rbd

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

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you what ceph-rbd commands are commonly used, I hope you will gain something after reading this article, let's discuss it together!

1. List the images under the pool

# rbd ls [- l]

The-l parameter, like ls-l, lists more detailed information, including the size of the mirror, snapshots, etc.

two。 Create a mirror image

# rbd create-image-format 2

-s # the size of the image is usually 2 in MB,-image-format, otherwise the image cannot be cloned

3. Delete a mirror image

# rbd rm

If a mirror has a snapshot, there will be an error when deleting it. You need to delete the snapshot first.

4. Modify the image size

# rbd resize-s

5. Copy a mirror image

# rbd cp

6. Import a mirror

# rbd import-image-format 2

This command can be used to import a file saved on the local hard disk into ceph, such as the virtual hard disk that causes the virtual machine.

7. Export a mirror image

# rbd export

This command can be used to export images saved in ceph to a local file

8. Clone hard disk

# rbd clone

9. Take a snapshot

# rbd snap create

For example, rbd snap create testpool/testimg@snap1 means to create a snapshot called snap1 for the testpool/testimg image.

10. Snapshot protection / de-protection

# rbd snap protect

Protect snapshots. Only snapshots under protection can be used to clone new mirrors.

# rbd snap unprotect

Only snapshots that are not protected can be deleted

11. Delete a snapshot

# rbd snap rm

twelve。 The state when a mirror is rolled back to a snapshot

# rbd snap rollback ``13. Delete all snapshots of a mirror ```# rbd snap purge ```14. List the snapshots of a mirror ```# rbd snap ls ```15. Format conversion ```# qemu-img convert-f vpc tedt.vhd-O raw rbd:/ disk1``16. Flatten the clone hard disk and re-copy ```# rbd flatten ``17. View rbd information ```# rbd info poolname/ rbdimg```18. Check the actual rbd occupancy size ```# rbd diff poolname/rbdimg | awk'{SUM + = $2} END {print SUM/1024/1024 "MB"} '````after reading this article, I believe you have a certain understanding of "what are the common ceph-rbd commands?" if you want to know more about it, welcome to follow the industry information channel, thank you for reading!

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