]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
updated osdmaptool's usage and added documentation
authorVedant Nanda <vedant15114@iiitd.ac.in>
Wed, 15 Mar 2017 10:44:23 +0000 (16:14 +0530)
committerVedant Nanda <vedant15114@iiitd.ac.in>
Mon, 11 Dec 2017 18:27:03 +0000 (23:57 +0530)
Fixes: http://tracker.ceph.com/issues/3214
Signed-off-by: Vedant Nanda <vedant15114@iiitd.ac.in>
doc/man/8/osdmaptool.rst
src/test/cli/osdmaptool/help.t
src/test/cli/osdmaptool/missing-argument.t
src/tools/osdmaptool.cc

index f58d29cdd382b6518cfae9605f033c58af86280c..0b615450c94be14f49c152594ae22099573a556d 100644 (file)
@@ -29,6 +29,11 @@ Options
    will simply make the tool print a plaintext dump of the map, after
    any modifications are made.
 
+.. option:: --dump <format>
+
+   displays the map in plain text when <format> is 'plain', 'json' if specified
+   format is not supported. This is an alternative to the print option.
+
 .. option:: --clobber
 
    will allow osdmaptool to overwrite mapfilename if changes are made.
@@ -42,22 +47,75 @@ Options
    will extract the CRUSH map from the OSD map and write it to
    mapfile.
 
-.. option:: --createsimple numosd [--pgbits bitsperosd]
+.. option:: --createsimple numosd [--pg-bits bitsperosd] [--pgp-bits bits]
 
    will create a relatively generic OSD map with the numosd devices.
-   If --pgbits is specified, the initial placement group counts will
+   If --pg-bits is specified, the initial placement group counts will
    be set with bitsperosd bits per OSD. That is, the pg_num map
    attribute will be set to numosd shifted by bitsperosd.
+   If --pgp-bits is specified, then the pgp_num map attribute will
+   be set to numosd shifted by bits. 
+
+.. option:: --create-from-conf
 
-.. option:: --test-map-pgs [--pool poolid]
+   creates an osd map with default configurations.
+
+.. option:: --test-map-pgs [--pool poolid] [--range-first <first> --range-last <last>]
 
    will print out the mappings from placement groups to OSDs.
+   If range is specified, then it iterates from first to last in the directory 
+   specified by argument to osdmaptool.
+   Eg: **osdmaptool --test-map-pgs --range-first 0 --range-last 2 osdmap_dir**.
+   This will iterate through the files named 0,1,2 in osdmap_dir.
+
+.. option:: --test-map-pgs-dump [--pool poolid] [--range-first <first> --range-last <last>]
 
-.. option:: --test-map-pgs-dump [--pool poolid]
+   will print out the summary of all placement groups and the mappings from them to the mapped OSDs.
+   If range is specified, then it iterates from first to last in the directory
+   specified by argument to osdmaptool.
+   Eg: **osdmaptool --test-map-pgs-dump --range-first 0 --range-last 2 osdmap_dir**.
+   This will iterate through the files named 0,1,2 in osdmap_dir.
+
+.. option:: --test-map-pgs-dump-all [--pool poolid] [--range-first <first> --range-last <last>]
 
    will print out the summary of all placement groups and the mappings
-   from them to the mapped OSDs.
+   from them to all the OSDs.
+   If range is specified, then it iterates from first to last in the directory
+   specified by argument to osdmaptool.
+   Eg: **osdmaptool --test-map-pgs-dump-all --range-first 0 --range-last 2 osdmap_dir**.
+   This will iterate through the files named 0,1,2 in osdmap_dir.
+
+.. option:: --test-random
+
+   does a random mapping of placement groups to the OSDs.
+
+.. option:: --test-map-pg <pgid>
+
+   map a particular placement group(specified by pgid) to the OSDs.
+
+.. option:: --test-map-object <objectname> [--pool <poolid>]
+
+   map a particular placement group(specified by objectname) to the OSDs.
+
+.. option:: --test-crush [--range-first <first> --range-last <last>]
+
+   map placement groups to acting OSDs.
+   If range is specified, then it iterates from first to last in the directory
+   specified by argument to osdmaptool.
+   Eg: **osdmaptool --test-crush --range-first 0 --range-last 2 osdmap_dir**.
+   This will iterate through the files named 0,1,2 in osdmap_dir.
+
+.. option:: --mark-up-in
+
+   mark osds up and in (but do not persist).
+
+.. option:: --tree
+
+   Displays a hierarchical tree of the map.
+
+.. option:: --clear-temp
 
+   clears pg_temp and primary_temp variables.
 
 Example
 =======
index 8fd313a765add05da214ba4bc2f24ae58956bdc8..e697ba3b71ca437d6502e20e490fadcaabb41f5f 100644 (file)
@@ -1,12 +1,17 @@
 # TODO be user-friendly
   $ osdmaptool --help
-   usage: [--print] [--createsimple <numosd> [--clobber] [--pg_bits <bitsperosd>]] <mapfilename>
+   usage: [--print] <mapfilename>
+     --create-from-conf      creates an osd map with default configurations
+     --createsimple <numosd> [--clobber] [--pg-bits <bitsperosd>] [--pgp-bits <bits>] creates a relatively generic OSD map with <numosd> devices
+     --pgp-bits <bits>       pgp_num map attribute will be shifted by <bits>
+     --pg-bits <bits>        pg_num map attribute will be shifted by <bits>
+     --clobber               allows osdmaptool to overwrite <mapfilename> if it already exists
      --export-crush <file>   write osdmap's crush map to <file>
      --import-crush <file>   replace osdmap's crush map with <file>
-     --test-map-pgs [--pool <poolid>] [--pg_num <pg_num>] map all pgs
-     --test-map-pgs-dump [--pool <poolid>] map all pgs
-     --test-map-pgs-dump-all [--pool <poolid>] map all pgs to osds
      --health                dump health checks
+     --test-map-pgs [--pool <poolid>] [--pg_num <pg_num>] [--range-first <first> --range-last <last>] map all pgs
+     --test-map-pgs-dump [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs
+     --test-map-pgs-dump-all [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs to osds
      --mark-up-in            mark osds up and in (but do not persist)
      --mark-out <osdid>      mark an osd as out (but do not persist)
      --with-default-pool     include default pool when creating map
@@ -23,4 +28,7 @@
                              max deviation from target [default: .01]
      --upmap-pool <poolname> restrict upmap balancing to 1 or more pools
      --upmap-save            write modified OSDMap with upmap changes
+     --dump <format>         displays the map in plain text when <format> is 'plain', 'json' if specified format is not supported
+     --tree                  displays a tree of the map
+     --test-crush [--range-first <first> --range-last <last>] map pgs to acting osds
   [1]
index db1745bd857d56e9c1bb406e5a92151f399fc960..ebd3ce10c0d784907f37eed0bb8df2be49313f21 100644 (file)
@@ -1,12 +1,17 @@
   $ osdmaptool
   osdmaptool: must specify osdmap filename
-   usage: [--print] [--createsimple <numosd> [--clobber] [--pg_bits <bitsperosd>]] <mapfilename>
+   usage: [--print] <mapfilename>
+     --create-from-conf      creates an osd map with default configurations
+     --createsimple <numosd> [--clobber] [--pg-bits <bitsperosd>] [--pgp-bits <bits>] creates a relatively generic OSD map with <numosd> devices
+     --pgp-bits <bits>       pgp_num map attribute will be shifted by <bits>
+     --pg-bits <bits>        pg_num map attribute will be shifted by <bits>
+     --clobber               allows osdmaptool to overwrite <mapfilename> if it already exists
      --export-crush <file>   write osdmap's crush map to <file>
      --import-crush <file>   replace osdmap's crush map with <file>
-     --test-map-pgs [--pool <poolid>] [--pg_num <pg_num>] map all pgs
-     --test-map-pgs-dump [--pool <poolid>] map all pgs
-     --test-map-pgs-dump-all [--pool <poolid>] map all pgs to osds
      --health                dump health checks
+     --test-map-pgs [--pool <poolid>] [--pg_num <pg_num>] [--range-first <first> --range-last <last>] map all pgs
+     --test-map-pgs-dump [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs
+     --test-map-pgs-dump-all [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs to osds
      --mark-up-in            mark osds up and in (but do not persist)
      --mark-out <osdid>      mark an osd as out (but do not persist)
      --with-default-pool     include default pool when creating map
@@ -23,4 +28,7 @@
                              max deviation from target [default: .01]
      --upmap-pool <poolname> restrict upmap balancing to 1 or more pools
      --upmap-save            write modified OSDMap with upmap changes
+     --dump <format>         displays the map in plain text when <format> is 'plain', 'json' if specified format is not supported
+     --tree                  displays a tree of the map
+     --test-crush [--range-first <first> --range-last <last>] map pgs to acting osds
   [1]
index e89f23eacb8ae5a522a314e51f6e1e7b63121e41..eef846982d1db5c8bd9bae87a659acb08b5cbb2d 100644 (file)
 
 void usage()
 {
-  cout << " usage: [--print] [--createsimple <numosd> [--clobber] [--pg_bits <bitsperosd>]] <mapfilename>" << std::endl;
+  cout << " usage: [--print] <mapfilename>" << std::endl;
+  cout << "   --create-from-conf      creates an osd map with default configurations" << std::endl;
+  cout << "   --createsimple <numosd> [--clobber] [--pg-bits <bitsperosd>] [--pgp-bits <bits>] creates a relatively generic OSD map with <numosd> devices" << std::endl;
+  cout << "   --pgp-bits <bits>       pgp_num map attribute will be shifted by <bits>" << std::endl;
+  cout << "   --pg-bits <bits>        pg_num map attribute will be shifted by <bits>" << std::endl;
+  cout << "   --clobber               allows osdmaptool to overwrite <mapfilename> if it already exists" << std::endl;
   cout << "   --export-crush <file>   write osdmap's crush map to <file>" << std::endl;
   cout << "   --import-crush <file>   replace osdmap's crush map with <file>" << std::endl;
-  cout << "   --test-map-pgs [--pool <poolid>] [--pg_num <pg_num>] map all pgs" << std::endl;
-  cout << "   --test-map-pgs-dump [--pool <poolid>] map all pgs" << std::endl;
-  cout << "   --test-map-pgs-dump-all [--pool <poolid>] map all pgs to osds" << std::endl;
   cout << "   --health                dump health checks" << std::endl;
+  cout << "   --test-map-pgs [--pool <poolid>] [--pg_num <pg_num>] [--range-first <first> --range-last <last>] map all pgs" << std::endl;
+  cout << "   --test-map-pgs-dump [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs" << std::endl;
+  cout << "   --test-map-pgs-dump-all [--pool <poolid>] [--range-first <first> --range-last <last>] map all pgs to osds" << std::endl;
   cout << "   --mark-up-in            mark osds up and in (but do not persist)" << std::endl;
   cout << "   --mark-out <osdid>      mark an osd as out (but do not persist)" << std::endl;
   cout << "   --with-default-pool     include default pool when creating map" << std::endl;
@@ -50,6 +55,9 @@ void usage()
   cout << "                           max deviation from target [default: .01]" << std::endl;
   cout << "   --upmap-pool <poolname> restrict upmap balancing to 1 or more pools" << std::endl;
   cout << "   --upmap-save            write modified OSDMap with upmap changes" << std::endl;
+  cout << "   --dump <format>         displays the map in plain text when <format> is 'plain', 'json' if specified format is not supported" << std::endl;
+  cout << "   --tree                  displays a tree of the map" << std::endl;
+  cout << "   --test-crush [--range-first <first> --range-last <last>] map pgs to acting osds" << std::endl;
   exit(1);
 }