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.
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
=======
# 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
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]
$ 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
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]
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;
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);
}