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>
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>
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>
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>
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>
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>
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>
/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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>