When updating to Ceph Nautilus (OpenStack Train) or later releases from
a pre-Nautilus release, msgr2 will not be enabled without manual
intervention (e.g. running `juju ssh ceph-mon/leader 'sudo ceph mon
enable-msgr2'`).
Leaving msgr2 disabled (i.e. using msgr1 only) isn't an issue for normal
operations; Ceph will simply show a warning in `sudo ceph status` that
this is the case. However, Ceph Nautilus and later releases default to
msgr2, meaning that new ceph-mon units will attempt to communicate with
the existing cluster using msgr2.
This commit enables msgr2 on package upgrades on all Ceph releases
including and after Nautilus.
Closes-Bug: #1840701
Change-Id: Ib90cd03b16f2062fa6c6a43d242d51306ae8ca95
Instead of deferring the upgrading of packages
when doing a release upgrade, do them immediately
and only defer daemon restarts. This is to avoid
any api incompatibilities between newer mons and
older clients.
Change-Id: Idf77871561fa14ad61e0c7901eeb333254e37012
Closes-Bug: #1897594
This patch add the concept of a watchdog to the upgrade_monitor so that
the charm can achieve two objectives of 1. Waiting for much longer, but
2. detecting whether the previous node has died / gone away. This is
needed for 'large' OSDs where the time to upgrade a node may exceed the
current limit of 10 minutes, but also not to wait for 30 minutes on a
dead previous node. The watchdog implements two timeouts and an
addition 'alive' key from the previous node to indicate that it is still
running. Otherwise, functionality is identical.
Change-Id: Ia450e936c2096f092af3be5a369b7abaf5023b16
Related-Bug: #1762852
From luminous to mimic, the ceph-mgr isn't restarted, leaving it at
luminous, rather than mimic. This change ensures that the ceph-mgr is
restarted when the version is luminous or later.
Change-Id: I2844736af2de27ce071db859311ac99b9b3057ad
Related-Bug: #1849874
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.
Change-Id: Id257b597368aff252ce7120b9dbc02f21a41e629
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
When upgrading to Luminous, ensure that the ceph-mgr daemons
are bootstrapped *once* all ceph-mons have been upgraded.
This ensures that the call to create the required keyring
supports the new profile for the mgr daemon.
Change-Id: Iff04c493a642cc5475eb31653064c2bab1210539
Closes-Bug: 1742408
Under Python 3, its not possible to compare a float with an object
of type str or NoneType; ensure that these conditions are handled
in the conditional which waits for the previous unit in the cluster
to complete upgrade before the current unit commences.
This change also includes a minor change to the way time span
assessed in unit tests for this function.
Change-Id: I34e3be4c55976d562497257626a339c72efabbad
Closes-Bug: 1742079
The monitor bootstrap code uses the ceph-mon systemd unit (instead
of the ceph-mon@ systemd unit); ensure that the monitor upgrade
code uses ceph-mon as well otherwise ceph-mon daemons are not
restarted during a managed upgrade.
Change-Id: I6ca7c5c7ca8cf3a62a5ee3209f14c059c0eec9be
Closes-Bug: 1742082
Ensure that the directory in /var/lib/ceph/mon for the local
mon unit is user writable, ensuring that ceph-mon daemons
>= Luminous are able to start.
Closes-Bug: 1742083
Change-Id: I9cac4bd258b7038738a693329588420696eac703
Infernalis release of Ceph switched to running the ceph daemons
under the ceph:ceph user instead of root:root. The upgrade OSD
logic does not take this into conideration and blindly runs the
recursive chown for whatever the current user is expected to be
when the upgrade is run.
This is problematic in production clusters with large numbers of
objects stored across 10 or more OSDs as this will cause a walk
of all the inodes under /var/lib/ceph unnecessarily. This change
ensures that the chown is only done when the upgrade target is
Jewel (Ubuntu Cloud Archives do not contain Infernalis release).
Change-Id: Id4bd48ebb90928b989df718404263e40f926c201
Partial-Bug: #1657527
When upgrading mon and osd units, ensure that symlinks are followed
to ensure that directory based OSD's are upgraded correctly (which
are typically a symlink from /var/lib/ceph/osd/X -> actual_dir).
Change-Id: I7656bbc633b9706bd406dbca0f11fe6108916a02
Partial-Bug: 1611082
Misc updates to use of status_set, and ensure that
the new version of ceph is correctly logged by passing down
to upgrade_{mon,osd}.
Change-Id: If094eacbc8cab598a0913bf1f93e5a6de88203d7