]>
git.proxmox.com Git - ceph.git/blob - ceph/src/ceph-crush-location.in
3 # Generate a CRUSH location for the given entity
5 # The CRUSH location consists of a list of key=value pairs, separated
6 # by spaces, all on a single line. This describes where in CRUSH
7 # hierarhcy this entity should be placed.
10 # --cluster <clustername> name of the cluster (see /etc/ceph/$cluster.conf)
11 # --type <osd|mds|client> daemon/entity type
12 # --id <id> id (osd number, mds name, client name)
15 # if we start up as ./ceph-crush-location, assume everything else is
16 # in the current directory too.
17 if [ `dirname $0` = "." ] && [ $PWD != "/usr/bin" ]; then
26 ETCDIR
=@sysconfdir@
/ceph
30 echo "usage: $0 [--cluster <cluster>] --id <id> --type <osd|mds|client>"
37 while [ $# -ge 1 ]; do
55 echo "unrecognized option '$1'"
61 if [ -z "$type" ]; then
62 echo "must specify entity type"
67 echo "must specify id"
71 # try a generic location
72 location
="$($BINDIR/ceph-conf --cluster=${cluster:-ceph} --name=$type.$id --lookup crush_location || :)"
73 if [ -n "$location" ]; then
78 # spit out something generic
79 echo "host=$(hostname -s) root=default"