What is the best way to move an rbd image to a different pool. I want to move some 'old' images (some have snapshots) to backup pool. For some there is also a difference in device class.
What is the best way to move an rbd image to a different pool. I want to move some 'old' images (some have snapshots) to backup pool. For some there is also a difference in device class. This is what I found on the mailing list, but it is from 2018. So maybe this is outdated? rbd export --export-format 2 vms/vm-102-disk-2 - | rbd import --export-format 2 - vdisks/vm-102-disk-2
What is the best way to move an rbd image to a different pool. I want to move some 'old' images (some have snapshots) to backup pool. For some there is also a difference in device class.
This is what I found on the mailing list, but it is from 2018. So maybe this is outdated?
rbd export --export-format 2 vms/vm-102-disk-2 - | rbd import --export- format 2 - vdisks/vm-102-disk-2
why this and not eg 'rbd cp'
-----Original Message----- From: Marc <Marc@f1-outsourcing.eu> Sent: 17 February 2021 15:51 To: 'ceph-users@ceph.io' <ceph-users@ceph.io> Subject: [ceph-users] Re: rbd move between pools
What is the best way to move an rbd image to a different pool. I want to move some 'old' images (some have snapshots) to backup pool. For some there is also a difference in device class.
This is what I found on the mailing list, but it is from 2018. So
maybe
this is outdated?
rbd export --export-format 2 vms/vm-102-disk-2 - | rbd import -- export- format 2 - vdisks/vm-102-disk-2
why this and not eg 'rbd cp'
I guess I will have to use the 'rbd deep cp'. It would be nice to have 'rbd mv' so you are sure dest and source are the same, otherwise the command would fail. sha256sum /dev/rbd/rbd/test-copy 49084eb0c282f378b5eac865d71582d46d84b818ce003b7f3abfa6afc397a919 /dev/rbd/rbd/test-copy rbd snap create test-copy@snap1 head -c 3G </dev/urandom > /dev/rbd/rbd/test-copy sha256sum /dev/rbd/rbd/test-copy e16059ccfe2e5bea6e0c1c47b1755457acad1be6ad7162e370f28bb3084dc76d /dev/rbd/rbd/test-copy e16059ccfe2e5bea6e0c1c47b1755457acad1be6ad7162e370f28bb3084dc76d /dev/rbd/rbd.backup/test-copy rbd deep cp rbd/test-copy rbd.backup/test-copy rbd snap protect rbd/test-copy@snap1 rbd clone rbd/test-copy@snap1 rbd/test-copy-clone rbd snap protect rbd.backup/test-copy@snap1 rbd clone rbd.backup/test-copy@snap1 rbd.backup/test-copy-clone rbd map rbd/test-copy-clone sha256sum /dev/rbd/rbd/test-copy-clone sha256sum /dev/rbd/rbd/test-copy-clone 49084eb0c282f378b5eac865d71582d46d84b818ce003b7f3abfa6afc397a919 /dev/rbd/rbd/test-copy-clone sha256sum /dev/rbd/rbd.backup/test-copy-clone 49084eb0c282f378b5eac865d71582d46d84b818ce003b7f3abfa6afc397a919 /dev/rbd/rbd.backup/test-copy-clone
There IS an 'rbd mv', and also 'rbd cp' does the exact copy. Or am I missing something in the question? ср, 17 февр. 2021 г. в 18:55, Marc <Marc@f1-outsourcing.eu>:
-----Original Message----- From: Marc <Marc@f1-outsourcing.eu> Sent: 17 February 2021 15:51 To: 'ceph-users@ceph.io' <ceph-users@ceph.io> Subject: [ceph-users] Re: rbd move between pools
What is the best way to move an rbd image to a different pool. I want to move some 'old' images (some have snapshots) to backup pool. For some there is also a difference in device class.
This is what I found on the mailing list, but it is from 2018. So
maybe
this is outdated?
rbd export --export-format 2 vms/vm-102-disk-2 - | rbd import -- export- format 2 - vdisks/vm-102-disk-2
why this and not eg 'rbd cp'
I guess I will have to use the 'rbd deep cp'. It would be nice to have 'rbd mv' so you are sure dest and source are the same, otherwise the command would fail.
sha256sum /dev/rbd/rbd/test-copy 49084eb0c282f378b5eac865d71582d46d84b818ce003b7f3abfa6afc397a919 /dev/rbd/rbd/test-copy
rbd snap create test-copy@snap1
head -c 3G </dev/urandom > /dev/rbd/rbd/test-copy sha256sum /dev/rbd/rbd/test-copy e16059ccfe2e5bea6e0c1c47b1755457acad1be6ad7162e370f28bb3084dc76d /dev/rbd/rbd/test-copy
e16059ccfe2e5bea6e0c1c47b1755457acad1be6ad7162e370f28bb3084dc76d /dev/rbd/rbd.backup/test-copy
rbd deep cp rbd/test-copy rbd.backup/test-copy
rbd snap protect rbd/test-copy@snap1 rbd clone rbd/test-copy@snap1 rbd/test-copy-clone
rbd snap protect rbd.backup/test-copy@snap1 rbd clone rbd.backup/test-copy@snap1 rbd.backup/test-copy-clone
rbd map rbd/test-copy-clone sha256sum /dev/rbd/rbd/test-copy-clone
sha256sum /dev/rbd/rbd/test-copy-clone 49084eb0c282f378b5eac865d71582d46d84b818ce003b7f3abfa6afc397a919 /dev/rbd/rbd/test-copy-clone sha256sum /dev/rbd/rbd.backup/test-copy-clone 49084eb0c282f378b5eac865d71582d46d84b818ce003b7f3abfa6afc397a919 /dev/rbd/rbd.backup/test-copy-clone _______________________________________________ ceph-users mailing list -- ceph-users@ceph.io To unsubscribe send an email to ceph-users-leave@ceph.io
There IS an 'rbd mv', and also 'rbd cp' does the exact copy. Or am I missing something in the question?
Yes my bad. I am blind sometimes. Since I learned that a mv in cephfs between different data pools, leaves still data in the source pool. Seeing 'deep cp', 'cp' and 'import/export' I thought maybe ask first, before I destroy something.
On Thu, Feb 18, 2021 at 09:34:00AM +0000, Marc wrote:
There IS an 'rbd mv', and also 'rbd cp' does the exact copy. Or am I missing something in the question?
Yes my bad. I am blind sometimes. Since I learned that a mv in cephfs between different data pools, leaves still data in the source pool. Seeing 'deep cp', 'cp' and 'import/export' I thought maybe ask first, before I destroy something.
The `rbd mv` is just an alias for `rbd rename`, so it can be used just to rename an image within a pool. Which I suppose is not what you want. `rbd cp` will copy only one image snapshot (or the image head) to the destination. `rbd deep cp` will copy all image snapshots and the image head. It looks like you want `rbd deep cp` for your task but from your example I am not sure I understand what problems you have with it? The new format 'import/export' can also be used for copying all snapshots. And there is `rbd migration` [1] which among other things may be used as "deep move" between the pools. May be this is what you want? [1] https://docs.ceph.com/en/latest/rbd/rbd-live-migration/ -- Mykola Golub
participants (3)
-
Marc
-
Mykola Golub
-
Vladimir Prokofev