kvm后端存储ceph使用 rbd cp 镜像并使用uuid方式增加名称长度以及resize扩容镜像
卷拷贝 rbd cp <pool1>/<image1><pool2>/<image2>下面的操作实例:
$ rbd cp volumes/CentOS8.3-2011-mode volumes/CentOS8.3-2011-`uuidgen`
Image copy: 100% complete...done.
root@gm268-5 15:41:35 ~
$
$ rbd ls -p volumes
CentOS8.3-2011-7cbf9bed-763e-4bdf-9ea5-b72aeaba98a9
CentOS8.3-2011-mode
openEuler-imge
openEuler-imge-mode
root@gm268-5 15:42:34 ~
$
$ rbd info volumes/CentOS8.3-2011-7cbf9bed-763e-4bdf-9ea5-b72aeaba98a9
rbd image 'CentOS8.3-2011-7cbf9bed-763e-4bdf-9ea5-b72aeaba98a9':
size 5 GiB in 1280 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 9d8f04d0fcd1b
block_name_prefix: rbd_data.9d8f04d0fcd1b
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Sun Nov 17 15:41:19 2024
access_timestamp: Sun Nov 17 15:41:19 2024
modify_timestamp: Sun Nov 17 15:41:19 2024
卷扩容 rbd resize <pool>/<image> --size 20<GB>
$ rbd resize volumes/CentOS8.3-2011-7cbf9bed-763e-4bdf-9ea5-b72aeaba98a9 --size 1024GB
Resizing image: 100% complete...done.
$ rbd info volumes/CentOS8.3-2011-7cbf9bed-763e-4bdf-9ea5-b72aeaba98a9
rbd image 'CentOS8.3-2011-7cbf9bed-763e-4bdf-9ea5-b72aeaba98a9':
size 1 TiB in 262144 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 9d8f04d0fcd1b
block_name_prefix: rbd_data.9d8f04d0fcd1b
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten
op_features:
flags:
create_timestamp: Sun Nov 17 15:41:19 2024
access_timestamp: Sun Nov 17 15:41:19 2024
modify_timestamp: Sun Nov 17 15:41:19 2024
$ rbd cp volumes/CentOS8.3-2011-mode volumes/CentOS8.3-2011-`date+'%Y-%m-%d'`-`uuidgen`
$ rbd cp volumes/CentOS8.3-2011-mode volumes/CentOS8.3-2011-`date+'%Y-%m-%d'`-`uuidgen`
Image copy: 100% complete...done. $ virsh define gm268-3-vm-1.xml
Domain gm268-3-vm-1 defined from gm268-3-vm-1.xml
root@gm268-3 17:17:30 ~
$ virsh list --all
Id Name State
-------------------------------
- gm268-3-vm-1 shut off
页:
[1]