From 5f064a52707af58fd6007734a768899aeb5a32fc Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Tue, 27 Aug 2024 20:34:31 +0200 Subject: [PATCH 1/2] rbd: clarify "rbd {group,} rename" command description Make it clearer that, despite a full image or group spec being taken for source and destination, an image or a group can be renamed only within its pool or namespace. Rename across pools or namespaces within the same pool is unsupported. Fixes: https://tracker.ceph.com/issues/67752 Signed-off-by: Ilya Dryomov --- src/test/cli/rbd/help.t | 10 ++++++---- src/tools/rbd/action/Group.cc | 2 +- src/tools/rbd/action/Rename.cc | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t index bee99c51dd109..13ab555e15dd2 100644 --- a/src/test/cli/rbd/help.t +++ b/src/test/cli/rbd/help.t @@ -51,7 +51,8 @@ group info Show information about a group. group list (group ls) List rbd groups. group remove (group rm) Delete a group. - group rename Rename a group within pool. + group rename Rename a group within its pool or + namespace. group snap create Make a snapshot of a group. group snap info Show information about a group snapshot. group snap list (... ls) List snapshots of a group. @@ -133,7 +134,8 @@ pool init Initialize pool for use by RBD. pool stats Display pool statistics. remove (rm) Delete an image. - rename (mv) Rename image within pool. + rename (mv) Rename an image within its pool or + namespace. resize Resize (expand or shrink) image. snap create (snap add) Create a snapshot. snap limit clear Remove snapshot limit. @@ -1034,7 +1036,7 @@ [--dest-group ] - Rename a group within pool. + Rename a group within its pool or namespace. Positional arguments source group specification @@ -2262,7 +2264,7 @@ [--dest-namespace ] [--dest ] - Rename image within pool. + Rename an image within its pool or namespace. Positional arguments source image specification diff --git a/src/tools/rbd/action/Group.cc b/src/tools/rbd/action/Group.cc index afcc24455f6f5..d97e120d438f7 100644 --- a/src/tools/rbd/action/Group.cc +++ b/src/tools/rbd/action/Group.cc @@ -1046,7 +1046,7 @@ Shell::Action action_list( {"group", "list"}, {"group", "ls"}, "List rbd groups.", "", &get_list_arguments, &execute_list); Shell::Action action_rename( - {"group", "rename"}, {}, "Rename a group within pool.", + {"group", "rename"}, {}, "Rename a group within its pool or namespace.", "", &get_rename_arguments, &execute_rename); Shell::Action action_info( {"group", "info"}, {}, "Show information about a group.", diff --git a/src/tools/rbd/action/Rename.cc b/src/tools/rbd/action/Rename.cc index b4954bcbb90af..db198d656e2b6 100644 --- a/src/tools/rbd/action/Rename.cc +++ b/src/tools/rbd/action/Rename.cc @@ -86,8 +86,8 @@ int execute(const po::variables_map &vm, } Shell::Action action( - {"rename"}, {"mv"}, "Rename image within pool.", "", &get_arguments, - &execute); + {"rename"}, {"mv"}, "Rename an image within its pool or namespace.", "", + &get_arguments, &execute); } // namespace rename } // namespace action From 7e02946a3f60da0dcc99e0b4a4b6b3d359db1c15 Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Fri, 30 Aug 2024 14:00:44 +0200 Subject: [PATCH 2/2] rbd: mention namespace in "rbd mirror pool" command descriptions Commit 5e64748927d0 ("doc/rbd: add namespace information for mirror commands") did this for the man page, update the built-in help as well. The "by default" bit in the description of "rbd mirror pool enable" and "rbd mirror pool disable" commands is specific to pool mode which is in turn specific to journal-based mirroring, so it's removed. Signed-off-by: Ilya Dryomov --- src/test/cli/rbd/help.t | 35 +++++++++++++++--------------- src/tools/rbd/action/MirrorPool.cc | 12 +++++----- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t index 13ab555e15dd2..ff25b5973a400 100644 --- a/src/test/cli/rbd/help.t +++ b/src/test/cli/rbd/help.t @@ -97,13 +97,14 @@ mirroring. mirror image snapshot Create RBD mirroring image snapshot. mirror image status Show RBD mirroring status for an image. - mirror pool demote Demote all primary images in the pool. - mirror pool disable Disable RBD mirroring by default within a - pool. - mirror pool enable Enable RBD mirroring by default within a - pool. - mirror pool info Show information about the pool mirroring - configuration. + mirror pool demote Demote all primary images in a pool or + namespace. + mirror pool disable Disable RBD mirroring in a pool or + namespace. + mirror pool enable Enable RBD mirroring in a pool or + namespace. + mirror pool info Show mirroring configuration for a pool + or namespace. mirror pool peer add Add a mirroring peer to a pool. mirror pool peer bootstrap create Create a peer bootstrap token to import in a remote cluster @@ -111,10 +112,10 @@ from a remote cluster mirror pool peer remove Remove a mirroring peer from a pool. mirror pool peer set Update mirroring peer settings. - mirror pool promote Promote all non-primary images in the - pool. - mirror pool status Show status for all mirrored images in - the pool. + mirror pool promote Promote all non-primary images in a pool + or namespace. + mirror pool status Show status for all mirrored images in a + pool or namespace. mirror snapshot schedule add Add mirror snapshot schedule. mirror snapshot schedule list (... ls) List mirror snapshot schedule. @@ -1804,7 +1805,7 @@ usage: rbd mirror pool demote [--pool ] [--namespace ] - Demote all primary images in the pool. + Demote all primary images in a pool or namespace. Positional arguments pool specification @@ -1818,7 +1819,7 @@ usage: rbd mirror pool disable [--pool ] [--namespace ] - Disable RBD mirroring by default within a pool. + Disable RBD mirroring in a pool or namespace. Positional arguments pool specification @@ -1833,7 +1834,7 @@ [--site-name ] - Enable RBD mirroring by default within a pool. + Enable RBD mirroring in a pool or namespace. Positional arguments pool specification @@ -1850,7 +1851,7 @@ [--format ] [--pretty-format] [--all] - Show information about the pool mirroring configuration. + Show mirroring configuration for a pool or namespace. Positional arguments pool specification @@ -1958,7 +1959,7 @@ [--namespace ] - Promote all non-primary images in the pool. + Promote all non-primary images in a pool or namespace. Positional arguments pool specification @@ -1974,7 +1975,7 @@ [--format ] [--pretty-format] [--verbose] - Show status for all mirrored images in the pool. + Show status for all mirrored images in a pool or namespace. Positional arguments pool specification diff --git a/src/tools/rbd/action/MirrorPool.cc b/src/tools/rbd/action/MirrorPool.cc index 5c58ea8ef7efc..a7877870a04ae 100644 --- a/src/tools/rbd/action/MirrorPool.cc +++ b/src/tools/rbd/action/MirrorPool.cc @@ -1744,27 +1744,27 @@ Shell::Action action_set( Shell::Action action_disable( {"mirror", "pool", "disable"}, {}, - "Disable RBD mirroring by default within a pool.", "", + "Disable RBD mirroring in a pool or namespace.", "", &get_disable_arguments, &execute_disable); Shell::Action action_enable( {"mirror", "pool", "enable"}, {}, - "Enable RBD mirroring by default within a pool.", "", + "Enable RBD mirroring in a pool or namespace.", "", &get_enable_arguments, &execute_enable); Shell::Action action_info( {"mirror", "pool", "info"}, {}, - "Show information about the pool mirroring configuration.", {}, + "Show mirroring configuration for a pool or namespace.", {}, &get_info_arguments, &execute_info); Shell::Action action_status( {"mirror", "pool", "status"}, {}, - "Show status for all mirrored images in the pool.", {}, + "Show status for all mirrored images in a pool or namespace.", {}, &get_status_arguments, &execute_status); Shell::Action action_promote( {"mirror", "pool", "promote"}, {}, - "Promote all non-primary images in the pool.", {}, + "Promote all non-primary images in a pool or namespace.", {}, &get_promote_arguments, &execute_promote); Shell::Action action_demote( {"mirror", "pool", "demote"}, {}, - "Demote all primary images in the pool.", {}, + "Demote all primary images in a pool or namespace.", {}, &get_demote_arguments, &execute_demote); } // namespace mirror_pool