Dump the osd map as a tree with one line per osd containing weight
and state. ::
- $ ceph osd crush add <id> <name> <weight> [<loc1> [<loc2> ...]]
+ $ ceph osd crush set <id> <name> <weight> [<loc1> [<loc2> ...]]
-Add a new item with the given id/name/weight at the specified
+Add or move a new item (osd) with the given id/name/weight at the specified
location. ::
$ ceph osd crush remove <id>
Remove an existing item from the crush map. ::
+ $ ceph osd crush move <id> <loc1> [<loc2> ...]
+
+Move an existing bucket from one position in the hierarchy to another. ::
+
$ ceph osd crush reweight <name> <weight>
Set the weight of the item given by ``<name>`` to ``<weight>``. ::
Adding a new device (OSD) to the map
====================================
-Adding new devices can be done via the monitor. The general form is::
+.. _adjusting-crush-set:
+
+Adding new devices or moving existing devices to new positions in the
+CRUSH hierarchy can be done via the monitor. The general form is::
$ ceph osd crush set <id> <name> <weight> [<loc> [<lo2> ...]]
location is always sufficient, and also safe in that existing
branches (and devices) won't be moved around.
-For example, if the new OSD id is ``123``, we want a weight of ``1.0``
-and the new device is on host ``hostfoo`` and rack ``rackbar``::
+For example, if the OSD id is ``123``, we want a weight of ``1.0`` and
+the device is on host ``hostfoo`` and rack ``rackbar``::
$ ceph osd crush set 123 osd.123 1.0 pool=default rack=rackbar host=hostfoo
-will add it to the hierarchy. The rack ``rackbar`` and host
-``hostfoo`` will be added as needed, as long as the pool ``default``
-exists (as it does in the default Ceph CRUSH map generated during
-cluster creation).
+will add it to the hierarchy, or move it from its previous position.
+The rack ``rackbar`` and host ``hostfoo`` will be added as needed, as
+long as the pool ``default`` exists (as it does in the default Ceph
+CRUSH map generated during cluster creation).
Note that if I later add another device in the same host but specify a
different pool or rack::
location (rack ``rackbar`` and pool ``default``).
+Moving a bucket to a different position in the hierarchy
+========================================================
+
+To move an existing bucket to a different position in the hierarchy,
+identify the bucket to move by name and specify the new location in
+the same fashion as with ``osd crush set ...``::
+
+ $ ceph osd crush move <bucket name> [<loc> [<loc2> ...]]
+
+where
+
+ * ``name`` is the name of the bucket to move. (To move a device,
+ see :ref:`adjusting-crush-set`.)
+ * ``loc`` is a list of ``what=where`` pairs indicating where the bucket should
+ be moved. See :ref:`adjusting-crush-set`.
+
+
Adjusting the CRUSH weight
==========================