Commit Graph

30666 Commits

Author SHA1 Message Date
Loic Dachary
a71025d336 ceph-disk: implement --sysconfdir as /etc/ceph
Replace hardcoded /etc/ceph with the SYSCONFDIR global variable and
implement the --sysconfdir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
ca713f48ae ceph-disk: implement --statedir as /var/lib/ceph
Replace hardcoded /var/lib/ceph with the STATEDIR global variable and
implement the --statedir option to override the default value.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
51ee3c0477 ceph-disk: add copyright notice
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
306b099ab0 ceph-disk: create the data directory if it does not exist
Instead of failing if the OSD data directory does not exist, create
it. Only do so if the data directory is not enforced to be a device via
the use of the --data-dev flag. The directory is not recursively created.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:41 +01:00
Loic Dachary
0fcc081858 ceph-disk: run ceph-osd when --mark-init=none
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
e773b68f4c ceph-disk: implement --mark-init=none
It is meant to be used when preparing and activating a directory that is
not to be used with init. No file is created to identify the init
system, no symbolic link is made to the directory in /var/lib/ceph
and the init scripts are not called.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
b65eb377f5 ceph-disk: fsid is a known configuration option
Use get_conf_with_default instead of get_conf because fsid is a known
ceph configuration option. It allows overriding via CEPH_ARGS which is
convenient for testing. Only options that are not found in config_opts.h
are fetch via get_conf.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
97f516a1dd ceph-disk: use CalledProcessError.returncode
CalledProcessError has no errno data member

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
d09af0fa50 ceph-disk: display the command output on OSD creation failure
The string form of a CalledProcessError instance does not include the
output datamember. Add it to the Error exception for debug purposes.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
2b935bbf60 ceph-disk: which() uses PATH first
Instead of relying on a hardcoded set of if paths. Although this has the
potential of changing the location of the binary being used by ceph-disk
on an existing installation, it is currently only used for sgdisk. It
could be disruptive for someone using a modified version of sgdisk but
the odds of this happening are very low.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
ad6b4b4b08 ceph-disk: add --prepend-to-path to control execution
/usr/bin is hardcoded in front of some ceph programs which makes it
impossible to control where they are located via the PATH.

The hardcoded path cannot be removed altogether because it will most
likely lead to unexpected and difficult to diagnose problems for
existing installations where the PATH finds the program elsewhere.

The --prepend-to-path flag is added and defaults to /usr/bin : it prepends
to the PATH environment variable. The hardcoded path is removed
and the PATH will be used: since /usr/bin is searched first, the
legacy behavior will not change.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
908348b804 ceph-disk: make exception handling terse in main_activate_journal
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
55ca7bb2da ceph-disk: do not hide main_activate() exceptions
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
324804a81c ceph-disk: fix activate() indent
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
de0050596b ceph-disk: remove noop try:
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Loic Dachary
b82ccfbfa7 ceph-disk: fix Error() messages formatting
Mainly using % instead of ,

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-03 16:30:40 +01:00
Sage Weil
6b8d4188db init-ceph: pass config file path when adjust crush position
Fixes: #6591
Reported-by: Sean Noonan <sean.noonan@twosigma.com>
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-02 16:52:14 -08:00
Sage Weil
806c0cb3b2 Merge pull request #1012 from dachary/wip-mon-mkfs
unit tests for ceph-mon --mkfs
2014-01-02 14:09:51 -08:00
Sage Weil
53a4a88f95 Merge pull request #1029 from ceph/wip-6914
Wip 6914

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-02 14:07:55 -08:00
Sage Weil
1f47a5b12e Merge pull request #1035 from ceph/port/bitsandints
endianess and integer types

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-02 13:52:40 -08:00
Sage Weil
4843f89e40 Merge pull request #1036 from dachary/wip-7085
ceph-disk: cannot run unit tests
2014-01-02 13:49:19 -08:00
Loic Dachary
2ba6930d62 ceph-disk: cannot run unit tests
Because ceph-disk relies on hardcoded paths. The corresponding test will
be added back when ceph-disk can run from sources.

Fixes: #7085

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-02 22:45:28 +01:00
Sage Weil
24417f9999 test/cli-integration/rbd: silence stderr
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-02 13:35:18 -08:00
Noah Watkins
8220549315 inttypes: detect and define missing integer types
Working around missing integer types is pretty easy. For example, the
__u32 family are Linux-specific types, and using these in Ceph
internally is fine because we can typedef them.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-02 11:03:48 -08:00
Noah Watkins
8f91cace8f endian: check byte order on OSX
Defines CEPH_[BIG|LITTLE]_ENDIAN to use, as BYTE_ORDER etc macros may be
different names on different platforms.

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
2014-01-02 11:03:39 -08:00
Sage Weil
46a5674b14 doc/release-notes: fix bobtail version
The tunables were mostly supported by later argonaut point releases,
but not officially.  Let's stick with bobtail though!

Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-02 08:36:47 -08:00
Loic Dachary
f6bbcf4367 mon: tests for ceph-mon --mkfs
* auth none must not require a keyring
* --key can be used as an alternative to --keyring
* --mkfs is idempotent
* the --mon-data directory is created if it does not exist
* auth ceph requires --keyring

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-02 10:21:32 +01:00
Sage Weil
40018fcc84 Merge pull request #1027 from jdurgin/wip-unprotect-error
librbd: better error when unprotect fails on unprotected snap

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-01 18:48:33 -08:00
Sage Weil
4fe0b1bbe7 Merge pull request #1010 from dachary/wip-mon-keyring
implement --key as an alternative to --keyring when ceph-mon --mkfs

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-01 18:47:57 -08:00
Sage Weil
e74ab284c6 Merge pull request #1031 from dachary/wip-parse-args
CEPH_ARGS should trim whitespaces

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-01 18:04:31 -08:00
Sage Weil
af27f07086 Merge pull request #1030 from dachary/wip-crush-location
osdc: = is not a delimiter in --crush-location

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-01 18:03:13 -08:00
Sage Weil
906f973e26 Merge pull request #1020 from dachary/wip-ceph-disk-override
ceph-disk: prepare --data-dir must not override files

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-01 18:00:43 -08:00
Sage Weil
41987db876 doc/release-notes: v0.74
Signed-off-by: Sage Weil <sage@inktank.com>
2014-01-01 17:58:30 -08:00
Loic Dachary
43465d479f Merge pull request #950 from ceph/wip-pg-stat
update pg stats when they are queried; share peer_info on query too

Reviewed-by: Loic Dachary <loic@dachary.org>
2014-01-01 17:03:44 -08:00
Loic Dachary
229740f422 ceph-conf: display arguments when an option cannot be parsed
unable to parse option: ''

Is difficult to figure out. It is much better if shown in the context in
which it was found:

   ceph-conf --help ''
   unable to parse option: ''
   args: '--help' ''

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-01 21:23:55 +01:00
Loic Dachary
07f5399408 common: CEPH_ARGS should trim whitespaces
CEPH_ARGS when parsed by env_to_vec did not trim trailing and leading
whitespaces: they would unexpectedly be parsed as empty arguments and
lead to confusing errors such as :

    CEPH_ARGS=' --id 3' ceph-conf --lookup mon-data
    unable to parse option: ''

The parsing code is replaced with str_vec(). It also resolves the
problem of the hard limit to 1000 characters imposed by the static
buffer that would silently truncate any CEPH_ARGS content.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-01 21:23:18 +01:00
Sage Weil
b729ed64fc Merge pull request #1028 from ceph/wip-empty-rbd-ls
rbd: return 0 and an empty list when pool is entirely empty

Reviewed-by: Sage Weil <sage@inktank.com>
2014-01-01 11:41:05 -08:00
Loic Dachary
40059e12af Merge pull request #1025 from pyKun/fix_typos
Fix typos in erasure code documents

Reviewed-by: Loic Dachary <loic@dachary.org>
2014-01-01 07:18:40 -08:00
Loic Dachary
2b848a91d9 osdc: = is not a delimiter in --crush-location
When parsing the crush location

     --crush-location 'root=default host=hostA'

it must create the vector

     [ 'root=default', 'host=hostA' ]

but the default list of separators of get_str_vec includes = which will
create

     [ 'root', 'default', 'host', 'hostA' ]

instead. Set the list of delimiters to exclude = instead.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-01 15:32:35 +01:00
Loic Dachary
7dfe550ce1 ceph-disk: prepare --data-dir must not override files
ceph-disk does nothing when given a device that is already prepared. If
given a directory that already contains a successfully prepared OSD, it
will however override it.

Instead of overriding the files in the osd data directory, return
immediately if the magic file exists. Make it so the magic file is
created last to accurately reflect the success of the OSD preparation.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-01 11:48:24 +01:00
Loic Dachary
4c8a313443 mon: implement --key for --mkfs
Allow --key to be used as an alternative to --keyring when ceph-mon
--mkfs runs. The key is wrapped inline into

     [mon.]
	key = AQDUS79S0AF9FRAA2cgRLFscVce0gROn/s9WMg==
	caps mon = "allow *"

and parsed with KeyRing::decode_plaintext which is made public.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-01 11:07:42 +01:00
Loic Dachary
ab6203f3f6 mon: fix indentation
Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-01 11:07:42 +01:00
Loic Dachary
e946df139e mon: do not use the keyring if auth = none
The Monitor::is_keyring_required() predicate is defined to be used in
the mkfs code path and not require the keyring to be set unless it is
actually going to be used.

If authentication is turned on later on existing monitors, the keyring
files will have to be set by an external tool in the mon data directory
and the mon restarted.

Signed-off-by: Loic Dachary <loic@dachary.org>
2014-01-01 11:07:42 +01:00
Gary Lowell
fe3fd5fb4a Merge branch 'next' 2014-01-01 07:53:37 +00:00
Yan, Zheng
f12abbf655 mds: don't allow changing layout for non-regular file
layout is meaningless for non-regular file. using non-default layout
may make backtrace less efficiency.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2014-01-01 11:19:00 +08:00
Yan, Zheng
f292992b82 mds: always store backtrace xattr in the default pool
when creating file in non-default pool, we need to store a backtrace
in the default pool in addition to the specified pool. Otherwise the
'lookup-by-ino' function will consider backtrace for file is missing.

Fixes: #6914
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
2014-01-01 11:08:12 +08:00
Sage Weil
cae663af40 osd/ReplicatedPG: improve debug output from check_local
This will help with #6685

Signed-off-by: Sage Weil <sage@inktank.com>
2013-12-31 17:21:49 -08:00
Loic Dachary
ac15f1ad25 Merge pull request #1011 from dachary/wip-mon-daemonize
do not daemonize ceph-mon when not necessary

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-31 17:12:39 -08:00
Josh Durgin
ac547a5b7d rbd: return 0 and an empty list when pool is entirely empty
rbd_list will return -ENOENT when no rbd_directory object
exists. Handle this in the cli tool and interpret it as success with
an empty list.

Add this to the release notes since it changes command line behavior.

Fixes: #6693
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-31 17:02:28 -08:00
Josh Durgin
e91fb91065 librbd: better error when unprotect fails on unprotected snap
This will show up on the command line and logs, making it more
clear than EINVAL.

Fixes #6851 and #4045
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2013-12-31 16:26:07 -08:00