The new python3-ceph-common deb package (introduced in ceph octopus)
adds a new ceph directory (a parent package in python terms) in
/usr/lib/python3/dist-packages/ceph/. This results in a conflict with
charm-ceph-xyz/lib/ceph/ on imports. For example, with the current
import of ceph.utils in ceph-osd/hooks/ceph_hooks.py, Python finds no
utils.py in /usr/lib/python3/dist-packages/ceph/ and then stops
searching. Therefore, rename ceph to charms_ceph to avoid the
conflict.
Change-Id: I6eaf03e291f65125269b1836dd2636806f9945e1
The charms.ceph utils.py library defines a constant based
on the running OS version. This change updates where the
version is read, allowing it to be nicely mocked.
Change-Id: Ibd65526cad0812f93963bd82619fcd27e055f6f3
Closes-Bug: #1861659
This bug handles OSError when trying to read from CDrom devices with no
disc in the is_pristine_disk function which makes the run-action
list-disks to fail.
Change-Id: I951897a699305604821f2c910ee9ea91582c4e40
Closes-Bug: #1833857
Co-authored-by: Stamatis Katsaounis <skatsaounis@admin.grnet.gr>
Signed-off-by: Alexandros Soumplis <soumplis@admin.grnet.gr>
Bug/1770740 surfaced an issue where get_upgrade_position() returns None
but the calling function expects and exception to the thrown if the
"None" condition exists. This just fixes the code so that the Traceback
is stopped and the appropriate error/message is logged for the
condition.
Change-Id: I16539b2bc35104eed54033bebb1154cad8a5cf0f
Partial-Bug: #1770740
This method should be call after the quorum has been done. The right
pattern would be:
ceph.wait_quorum()
ceph.create_keyrings()
Change-Id: I6c754cb2d1de57a59416e96aa6ab5cfcaec5df44
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
These methods combine to provide a mechanism to wait for the mgr
daemon to be available before performing commands that rely on the
daemon being available; e.g. the adding a mgr module like pg-autotune.
Change-Id: I6255a2e947053a6f8d545aa3f6be1a8330d8bd57
straw2 has been the default CRUSH algorithm since hammer
and Ubuntu Xenial ships with Jewel, meaning that straw2
is the default in all current LTS releases.
Change-Id: I6fa4072eb33d763aca5721ee9fdd30b60d468a44
Closes-Bug: #1836092
For Nautilus the Ceph monitors automatically create the admin and
bootstrap keyrings as part of cluster formation so the charm just
needs to retrieve the admin keyring after the monitors have been
bootstrapped.
As the bootstrap process is two quite distinct steps, this change
refactors the bootstrap_monitor_cluster function into two discrete
functions - one to create and start the ceph monitor, and a second
to create the ceph keyrings on the local filesystem.
As the osd-bootstrap keyring is not actually created on disk from
Nautilus onwards, the 'is_bootstrapped' function now looks for the
client.admin keyring across all Ceph releases - this should be
backwards compatible.
This change also adds the standing data for upgrade paths to
Nautilus, however this is as yet untested.
Change-Id: I2dfab7404b72e314625ea554ee64595c5e26f3c6
The charm was checking for the zeroth value of the return value of
list_logical_volumes. However, if no logical volumes are found it
returns an empty list.
This change validates that the list has an entry.
Change-Id: I75a6b1dda15dd7c2cece8cfe97b28317b3d5162b
Partial-Bug: #1819382
dirs_need_ownership_update detects when OSD directories require an
ownership change from root to ceph. However if an OSD directory exists,
but the OSD is not yet mounted, then the directory is expected to be
owned by root.
This may happen if an OSD is stopped or the OSD is no longer in use,
including on reboot when the OSD may not yet be started before hooks
run.
Change-Id: If9d7e5bcfc0b1f152643a14432e76572ac14a812
Partial-Bug: #1779828
To support automation of pool creation on a secondary Ceph cluster
in a RBD Mirror setup the actor will require additional information
about pools on the source cluster.
Change-Id: Id88d268d42da6e453879f850ae76575ac3b0adbf
Later ceph versions allow the crush_rule to be changed on a pool;
add this key with type str to the list of supported keys for
the pool broker.
Change-Id: I2c405f9a4956ff1ccf1edb7372a9bb11e1e591a4
tox: Remove cleanup of Python object files as this breaks
in the upstream gate.
tox: While at it migrate from os-testr to stestr.
Change-Id: I1bad5311ed034188a78dc67b493c22bff7ce4f7d
If an older version of ceph-osd is deployed and then
upgraded to a version that keeps track of bootstrapped
OSDs, then the list of osd-devices never gets updated
with the pre-existing devices.
This change allows us to add existing, mounted Ceph
OSDs to the osd-devices entry in the local KV storage.
Change-Id: I940b108d914b39b55013a4617c3d17ff7122df60
Closes-Bug: #1814597
Add a standalone udevadm_settle that can be called alone. This is
to enable it to be called by the ceph-osd charm. I think the
subprocess calls should be switched to check_call in the longer
term but that may be a disruptive change if udevadm does not
always return 0 so I propose to leave them as they are for the
moment.
Change-Id: Iec5932a4d819ad87e54c2af391abe1befe84f164
Partial-Bug: #1812925
Allow an optional name to be passed when generating radosgw keys;
this supports use of per-unit cephx keys in the ceph-radosgw charm.
Change-Id: I7ac4d23a91fa654b62afb62c389a8f9823ef2e05
Closes-Bug: 1808140
When creating a new encrypted disk, ensure that
we zero the first region to ensure that pvcreate
won't stumble on random artifacts
Closes-Bug: #1783427
Change-Id: Iac45e9c00d093befb893c61a3c3aee70ac4b851a
python-ceph does not exist under Py3; any dependency on underlying
Python modules is expressed as package dependencies from ceph-*
packages.
python-pyudev is used by ceph.utils and needs to be installed
prior to using pyudev (which is typically done using a bash based
install hook - see ceph-osd for examples).
Change-Id: Id653345fd951a2eb044a6f88d03409a4d4b69b83
Tracking directory backed OSDs in the kv store allows
us to bootstrap further relations based on bootstrapped
OSD counts.
Change-Id: I1a28a28dbd325dd7ffd74940a07be9908d74689c
Closes-Bug: #1802134
Fully support multi-tier hierarchy within the Ceph OSD tree; this
change refactors the get_osd_tree function to simply filter for
nodes of type 'host' which was in effect what the original code
did, but in a more efficient manner.
This change includes a set of test data taken directly from
the bug report.
Change-Id: I4734a5f6279c02f13bc4eafec15851968881dd5a
Closes-Bug: 1788722
Provide UCA mappings and upgrade path for Ceph Mimic release,
enabling upgrades on Bionic from Luminous to Mimic.
Change-Id: I73a283b86dec6a84c2a5bdfb6be5a7d263aaf070
This is a followup patch for the previous commits that are
addressing issues with bcache based configuration.
Providing dname path for ceph-disk is unsafe, the prepare command
uses gdisk which breaks the dname symlinks.
Change-Id: Id3f360c90d40b77720d7bc7c1bf94b79f71b6827
Closes-Bug: 1790186
Signed-off-by: Gabor Meszaros <gabor.meszaros@canonical.com>
This patch looks for multiple nodes in the OSD tree with type root and
iterates through all root parent node children to allow for upgrading ceph-osd
cluster/devices when running both a "default" and an "ssd" pool of OSD hosts,
for instance.
Closes-Bug: #1788722
Change-Id: I69d653f9f3ea4ee8469f3d7323ee68435ba22099
When checking for holders on a block device, ensure that any
by-uuid or by-dname provided paths are resolved to the underlying
block device when searching for holders.
Change-Id: If0e1fbc62bfe7d0f9e21db9bfdeee761060de846
Closes-Bug: 1782439
Ensure that local configuration files are used for all
settings, instead of mon set configuration which requires
access to the mon cluster which may not be running at the
point in time that configuration is required.
Change-Id: I1fa80c78d6e6e501848d14098fe88d0df4f9e8bc
This is motivated by the fact that:
* the ntp/chrony package is already a dependency of the ceph-mon/osd
package
* NTP will be managed by operators through the NTP charm
It is thus useless to keep that package mentioned here.
Change-Id: Iddb7ffcc7ab7a74700855b950f619208511c2fab
Closes-Bug: #1780690
With BlueStore there are no file system mounts so having a simple check
for a LUKS header presence is good enough to avoid osdizing a used dev
which does not have an LVM super block indicating that a device is in
use.
Partial-Bug: #1781453
Change-Id: Idb98690f0bf11e6932fbe8c2930bb314b0dd3c48
Ensure that the default permissions for clients include the
'osd blacklist' command; This ensures that in the event of
a client crashing (due to power outage or segfault), the
client and re-connect and write to any devices on reboot.
Change-Id: I0b43dece4e1c56fb838b0147bfb75fb9906e6657
Closes-Bug: 1773449