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>
--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)
--mark-up <osdid> mark an osd as up (but do not persist)
--mark-in <osdid> mark an osd as in (but do not persist)
--with-default-pool include default pool when creating map
--clear-temp clear pg_temp and primary_temp
--clean-temps clean pg_temps
--test-random do random placements
--test-map-pg <pgid> map a pgid to osds
--test-map-object <objectname> [--pool <poolid>] map an object to osds
--upmap-cleanup <file> clean up pg_upmap[_items] entries, writing
commands to <file> [default: - for stdout]
--upmap <file> calculate pg upmap entries to balance pg layout
writing commands to <file> [default: - for stdout]
--upmap-max <max-count> set max upmap entries to calculate [default: 10]
--upmap-deviation <max-deviation>
max deviation from target [default: 5]
--upmap-pool <poolname> restrict upmap balancing to 1 or more pools
--upmap-active Act like an active balancer, keep applying changes until balanced
--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
--adjust-crush-weight <osdid:weight>[,<osdid:weight>,<...>] change <osdid> CRUSH <weight> (but do not persist)
--save write modified osdmap with upmap or crush-adjust changes
--read <file> calculate pg upmap entries to balance pg primaries
--read-pool <poolname> specify which pool the read balancer should adjust
--vstart prefix upmap and read output with './bin/'
Options (29)
| Option | Description | Source |
|---|---|---|
--create-from-conf | creates an osd map with default configurations. | help + man |
--pgp-bits bits | pgp_num map attribute will be shifted by <bits> | help |
--pg-bits bits | pg_num map attribute will be shifted by <bits> | help |
--clobber | will allow osdmaptool to overwrite mapfilename if changes are made. | help + man |
--export-crush file | will extract the CRUSH map from the OSD map and write it to mapfile. | help + man |
--import-crush file | will load the CRUSH map from mapfile and embed it in the OSD map. | help + man |
--health | dump health checks | help + man |
--mark-up-in | mark osds up and in (but do not persist). | help + man |
--mark-out osdid | mark an osd as out (but do not persist) | help + man |
--mark-up osdid | mark an osd as up (but do not persist) | help + man |
--mark-in osdid | mark an osd as in (but do not persist) | help + man |
--with-default-pool | include default pool when creating map | help + man |
--clear-temp | clears pg_temp and primary_temp variables. | help + man |
--clean-temps | clean pg_temps. | help + man |
--test-random | does a random mapping of placement groups to the OSDs. | help + man |
--test-map-pg pgid | map a particular placement group(specified by pgid) to the OSDs. | help + man |
--upmap-cleanup file | clean up pg_upmap[_items] entries, writing commands to <file> [default: - for stdout] | help + man |
--upmap file | calculate pg upmap entries to balance pg layout writing commands to <file> [default: - for stdout] | help + man |
--upmap-deviation max-deviation | max deviation from target [default: 5] | help + man |
--upmap-active | Act like an active balancer, keep applying changes until balanced | help + man |
--dump format | displays the map in plain text when <format> is 'plain', 'json' if specified format is not supported. | help + man |
--tree | Displays a hierarchical tree of the map. | help + man |
--save | write modified osdmap with upmap or crush-adjust changes | help + man |
--read file | calculate pg upmap entries to balance pg primaries | help + man |
--read-pool poolname | specify which pool the read balancer should adjust | help + man |
--vstart | prefix upmap and read output with './bin/' | help + man |
--print | will simply make the tool print a plaintext dump of the map, after any modifications are made. (in the manual page but not in --help) | man |
--upmap-max max-optimizations | set max upmap entries to calculate [default: 10] (in the manual page but not in --help) | man |
--upmap-pool poolname | restrict upmap balancing to 1 pool or the option can be repeated for multiple pools (in the manual page but not in --help) | man |
Examples (6) from the manual page, untested
osdmaptool --createsimple 16 osdmap --clobber
To create a simple map with 16 devices:osdmaptool --print osdmap
To view the result:osdmaptool osdmap --test-map-pgs-dump --pool 1
To view the mappings of placement groups for pool 1:#osd count first primary c wt wt
In a less-balanced cluster, we could have following output for the statistics of placement group distribution, whose standard deviation is 1.41421:osdmaptool --upmap upmaps.out --upmap-active --upmap-deviation 6 --upmap-max 11 osdmap
To simulate the active balancer in upmap mode:osdmaptool osdmap --read read.out --read-pool <pool name>
To simulate the active balancer in read mode, first make sure capacity is balanced by running the balancer in upmap mode.