From 622748ae15e9e7dec4b104fd14f481ff8749040a Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Sun, 28 Feb 2016 21:27:50 -0500 Subject: [PATCH] rbd: deprecate image format 1 The rbd cli will warn about the deprecation when attempting to create image format 1 images. librbd will log an error message when opening a format 1 RBD image. Signed-off-by: Jason Dillaman --- PendingReleaseNotes | 4 ++++ doc/man/8/rbd.rst | 6 +++--- src/librbd/image/OpenRequest.cc | 3 +++ src/test/cli/rbd/help.t | 4 ++-- src/tools/rbd/ArgumentTypes.cc | 3 ++- src/tools/rbd/Utils.cc | 3 +++ 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/PendingReleaseNotes b/PendingReleaseNotes index c4140307b7030..127aa44bc8a50 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -12,6 +12,10 @@ v10.0.0 limit max waiting time of monitor election process, which was previously restricted by 'mon_lease'. +* The rbd legacy image format (version 1) is deprecated with the Jewel release. + Attempting to create a new version 1 RBD image will result in a warning. + Future releases of Ceph will remove support for version 1 RBD images. + v9.3.0 ====== * Some symbols wrongly exposed by librados in v9.1.0 and v9.2.0 were removed. diff --git a/doc/man/8/rbd.rst b/doc/man/8/rbd.rst index 633d89a4651c1..a3594c0b9ea5c 100644 --- a/doc/man/8/rbd.rst +++ b/doc/man/8/rbd.rst @@ -56,9 +56,9 @@ Parameters Specifies which object layout to use. The default is 1. - * format 1 - Use the original format for a new rbd image. This format is - understood by all versions of librbd and the kernel rbd module, but - does not support newer features like cloning. + * format 1 - (deprecated) Use the original format for a new rbd image. This + format is understood by all versions of librbd and the kernel rbd module, + but does not support newer features like cloning. * format 2 - Use the second rbd format, which is supported by librbd and kernel since version 3.11 (except for striping). This adds diff --git a/src/librbd/image/OpenRequest.cc b/src/librbd/image/OpenRequest.cc index 68abbba620abb..47001c4c27047 100644 --- a/src/librbd/image/OpenRequest.cc +++ b/src/librbd/image/OpenRequest.cc @@ -78,6 +78,9 @@ Context *OpenRequest::handle_v1_detect_header(int *result) { } send_close_image(*result); } else { + lderr(cct) << "RBD image format 1 is deprecated. " + << "Please copy this image to image format 2." << dendl; + m_image_ctx->old_format = true; m_image_ctx->header_oid = util::old_header_name(m_image_ctx->name); send_register_watch(); diff --git a/src/test/cli/rbd/help.t b/src/test/cli/rbd/help.t index 800fc45a5f5c2..bc759f4a3148e 100644 --- a/src/test/cli/rbd/help.t +++ b/src/test/cli/rbd/help.t @@ -228,7 +228,7 @@ Optional arguments -p [ --pool ] arg pool name --image arg image name - --image-format arg image format [1 or 2] + --image-format arg image format [1 (deprecated) or 2] --new-format use image format 2 (deprecated) --order arg object order [12 <= order <= 25] @@ -473,7 +473,7 @@ --path arg import file (or '-' for stdin) --dest-pool arg destination pool name --dest arg destination image name - --image-format arg image format [1 or 2] + --image-format arg image format [1 (deprecated) or 2] --new-format use image format 2 (deprecated) --order arg object order [12 <= order <= 25] diff --git a/src/tools/rbd/ArgumentTypes.cc b/src/tools/rbd/ArgumentTypes.cc index 698a643a7fc24..6439173211a35 100644 --- a/src/tools/rbd/ArgumentTypes.cc +++ b/src/tools/rbd/ArgumentTypes.cc @@ -209,7 +209,8 @@ void add_create_image_options(po::options_description *opt, // TODO get default image format from conf if (include_format) { opt->add_options() - (IMAGE_FORMAT.c_str(), po::value(), "image format [1 or 2]") + (IMAGE_FORMAT.c_str(), po::value(), + "image format [1 (deprecated) or 2]") (IMAGE_NEW_FORMAT.c_str(), po::value()->zero_tokens(), "use image format 2\n(deprecated)"); diff --git a/src/tools/rbd/Utils.cc b/src/tools/rbd/Utils.cc index c4fbee457f564..49571f446e805 100644 --- a/src/tools/rbd/Utils.cc +++ b/src/tools/rbd/Utils.cc @@ -390,6 +390,9 @@ int get_image_options(const boost::program_options::variables_map &vm, } else { format = g_conf->rbd_default_format; } + if (format == 1) { + std::cerr << "rbd: image format 1 is deprecated" << std::endl; + } if (features_specified && features != 0) { if (format_specified && format == 1) {