ceph: accept osd.* as a valid name

This will be used for 'ceph tell osd.* ...'

Signed-off-by: Sage Weil <sage@inktank.com>
ceph: filter out empty lines from osdids()

Signed-off-by: Sage Weil <sage@inktank.com>
mon: fix read of format_version out of leveldb

The get_version(string, string) is the wrong method; it combines the two
args into a key that is nested inside prefix (so it's prefix/a/b), but we
want perfix/format_version.  Add a method to grab an int for this
particular combo and use that.

This fixes an infinite loop when we actually trigger this code.

Bug introduced by f43c974571beac0c8e54fa699bfa96a1befaf56c.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph: only use readline when in interactive mode

A mere

  import readline

line is dumping this to stdout on CentOS 6.3:

  00000000  1b 5b 3f 31 30 33 34 68  .[?1034h

That confuses non-terminals that read from stdout, so only import when we
are in the interactive mode.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Dan Mick <dan.mick@inktank.com>
global: create /var/run/ceph on daemon startup

This handles cases where the daemon is started without the benefit of
sysvinit or upstart (as with teuthology or ceph-fuse).

Signed-off-by: Sage Weil <sage@inktank.com>
init-ceph: look to ceph.conf instead of hard-coding /var/run/ceph

It could be elsewhere!

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: fix handling for osd_command dne/down cases

Generalize the map check machinery that the pool dne check uses to also
get the latest map for OSD down/dne checks.  This is better semantics, but
more important fixes the more immediate bug of returning the error code
to the caller from the osd_command -> _submit_command (that is ignored by
pretty much any caller) and then never triggering the callback.

Fixes: #5331
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd image_read.sh: wait for rbd sysfs files to appear

Poll until they are available for chmoding.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
vstart.sh: set run_dir to out

This avoids annoying errors about creating /var/run/ceph from
init-ceph.

Fixes: #4036
Signed-off-by: Sage Weil <sage@inktank.com>
Merge pull request #351 from ceph/wip-var-run

Reviewed-by: Dan Mick <dan.mick@inktank.com>
Merge remote-tracking branch 'gh/next'
ceph: implement 'ceph tell osd.* ...'

Send the command to each target.  Do this in series, for now.  Error out if
any one fails.

Later, we should do them in parallel.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonClient: send commands to a specific monitor

This implementation is limited: we direct our command by reopening
a session with the specific monitor.  If there is more than one of these
queued we will fail to reach either.

Signed-off-by: Sage Weil <sage@inktank.com>
config: fix run_dir typo

From 654299108bfb11e7dce45f54946d1505f71d2de8.

Signed-off-by: Sage Weil <sage@inktank.com>
ceph, mon/OSDMonitor: fix up osd crush commands for <osd.N> or <N>

The new parsing code had been trying to allow flexibility for the
'old form' commands (where id could be different from N in osd.N),
but also accept 'new form' commands.  The new rule is that where
there's an OSD specified in the osd crush command, it is of type
CephOsdName, which can be an id *or* 'osd.<id>', but not both.

Pass CephOsdName as int64_t 'id' for convenience in mon code

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
OSDMonitor: osd id when id already exists needs to come to stdout too

Found by qa/workunits/mon/osd.sh

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Clean up CrushWrapper methods that take string: no c_str() necessary

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
ceph-disk: extra dash in error message

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Update README dependency lists

Signed-off-by: Dan Mick <dan.mick@inktank.com>
add apt-get update to installation instructions

Without apt-get update the repository added to the sources.list is not taken into consideration and an older version of ceph-deploy is going to be installed.

Signed-off-by: Loic Dachary <loic@dachary.org>