]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-nbd: provide a way to map snapshots by id
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Mon, 31 Oct 2022 06:08:18 +0000 (11:38 +0530)
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>
Thu, 10 Nov 2022 13:58:24 +0000 (19:28 +0530)
commit75226f1be27cfde36370f4b4253b28fa7954a65f
tree7e18654b881c790bdecdf2658f0e0c643a4cbd80
parent528a5fb617e082803f0b805ae9395fec00d47c2a
rbd-nbd: provide a way to map snapshots by id

Currently we don't have a way to map arbitrary snapshots,
this commit provides --snap-id option to all such snapshots

$ rbd --cluster=site-a snap ls pool1/test_image --all --format=json --pretty-format
[
    {
        "id": 4,
        "name": ".mirror.primary.c6fe94fd-3f9b-4ce0-aecc-e9d07472fd46.528a3f48-1b5c-4abb-9089-5a454328aeb3",
        "size": 1073741824,
        "protected": "false",
        "timestamp": "Thu Oct 27 22:09:12 2022",
        "namespace": {
            "type": "mirror",
            "state": "primary",
            "mirror_peer_uuids": [
                "3e99dc15-78ca-46bd-8934-93d8063c0081"
            ],
            "complete": true
        }
    }
]

$ rbd-nbd --cluster=site-a map --snap-id=4 pool1/test_image
/dev/nbd0

$ rbd-nbd list-mapped
id      pool   namespace  image       snap  device     cookie
511989  pool1             test_image  @4    /dev/nbd0  68de2ef3-1d22-43b9-8318-03f3d31ec8b5
513439  pool1             test_image  @5    /dev/nbd1  f3222c04-4048-4c61-a0b1-28536c4a29a7

Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
doc/man/8/rbd-nbd.rst
src/tools/rbd_nbd/rbd-nbd.cc