[ceph-users] Move rdb based image from one pool to another

Jason Dillaman jdillama at redhat.com
Wed Nov 7 11:41:27 PST 2018


If your CLI supports "--export-format 2", you can just do "rbd export
--export-format 2 vms/vm-102-disk2 - | rbd import --export-format 2 -
vdisks/vm-102-disk-2" (you need to specify the data format on import
otherwise it will assume it's copying a raw image).
On Wed, Nov 7, 2018 at 2:38 PM Uwe Sauter <uwe.sauter.de at gmail.com> wrote:
>
> I've been reading a bit and trying around but it seems I'm not quite where I want to be.
>
> I want to migrate from pool "vms" to pool "vdisks".
>
> # ceph osd pool ls
> vms
> vdisks
>
> # rbd ls vms
> vm-101-disk-1
> vm-101-disk-2
> vm-102-disk-1
> vm-102-disk-2
>
> # rbd snap ls vms/vm-102-disk-2
> SNAPID NAME     SIZE TIMESTAMP
>      81 SL6_81 100GiB Thu Aug 23 11:57:05 2018
>      92 SL6_82 100GiB Fri Oct 12 13:27:53 2018
>
> # rbd export --export-format 2 vms/vm-102-disk-2 - | rbd import - vdisks/vm-102-disk-2
> Exporting image: 100% complete...done.
> Importing image: 100% complete...done.
>
> # rbd snap ls vdisks/vm-102-disk-2
> (no output)
>
> # rbd export-diff --whole-object vms/vm-102-disk-2 - | rbd import-diff - vdisks/vm-102-disk-2
> Exporting image: 100% complete...done.
> Importing image diff: 100% complete...done.
>
> # rbd snap ls vdisks/vm-102-disk-2
> (still no output)
>
> It looks like the current content is copied but not the snapshots.
>
> What am I doing wrong? Any help is appreciated.
>
> Thanks,
>
>         Uwe
>
>
>
> Am 07.11.18 um 14:39 schrieb Uwe Sauter:
> > I'm still on luminous (12.2.8). I'll have a look on the commands. Thanks.
> >
> > Am 07.11.18 um 14:31 schrieb Jason Dillaman:
> >> With the Mimic release, you can use "rbd deep-copy" to transfer the
> >> images (and associated snapshots) to a new pool. Prior to that, you
> >> could use "rbd export-diff" / "rbd import-diff" to manually transfer
> >> an image and its associated snapshots.
> >> On Wed, Nov 7, 2018 at 7:11 AM Uwe Sauter <uwe.sauter.de at gmail.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> I have several VM images sitting in a Ceph pool which are snapshotted. Is there a way to move such images from one pool to another
> >>> and perserve the snapshots?
> >>>
> >>> Regards,
> >>>
> >>>          Uwe
> >>> _______________________________________________
> >>> ceph-users mailing list
> >>> ceph-users at lists.ceph.com
> >>> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
> >>
> >>
> >>
> >



-- 
Jason


More information about the ceph-users mailing list