Commit Graph

44 Commits

Author SHA1 Message Date
Corey Bryant fcfa499f11 Rename lib/ceph to lib/charms_ceph
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-osd/lib/ceph/. For example, with the current import of
ceph.utils in hooks/ceph_hooks.py, Python finds no utils.py in
/usr/lib/python3/dist-packages/ceph/ and then stops searching.
Therefore, rename lib/ceph to lib/charms_ceph to avoid the conflict.

Depends-On: https://review.opendev.org/#/c/709226
Change-Id: I13ae7c048d8f1eef2ea64b13ae14b51dbfaaf3cd
2020-02-24 15:21:33 +00:00
Liam Young 620ff1c20a Charmhelper sync for 20.02
Change-Id: I696c0f3303f038a66cf2298d10f081b580e0a9fe
2020-02-04 16:38:23 +00:00
Corey Bryant d4a6142a03 Sync charm-helpers for Ussuri/Focal release and version details
Change-Id: I5ac45332a126143ce0299c2c534523bd890f5f57
2020-01-17 14:21:26 -05:00
Alexandros Soumplis df8f477cd7 Ignore devices with OSError
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: I5e86895d1adff3f95c7feb5ed0f78b998c28ed1f
Depends-On: I951897a699305604821f2c910ee9ea91582c4e40
Closes-Bug: #1833857
Signed-off-by: Alexandros Soumplis <soumplis@admin.grnet.gr>
2019-12-17 14:43:18 +02:00
Alex Kavanagh b15a23ef6a Re-fix Traceback issue when ceph-osd upgrade fails
This was originally fixed in Ib7d1fdc8f91bc992ccf618ef6f57e99bb90c2dbc
but unfortunately wasn't also added to the charms.ceph library.  Thus,
this is a re-application of that fix; the charms to ceph fix is in [1].

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.

[1] https://review.opendev.org/#/c/695163/
    I16539b2bc35104eed54033bebb1154cad8a5cf0f

Change-Id: Ieee8d13f25027ad540a23a6428c2226b6c20999a
Partial-Bug: #1770740
2019-11-20 10:29:04 +00:00
Andrew McLeod 67254e334f Sync charms.ceph
use btrfs-progs instead of btrfs-tools for eoan and later
update bionic-train zaza test bundle to include placement

Closes-Bug: #1850181
Change-Id: I6c414cb7db45f5a1a2cf9b65f6fd93c40f631a46
2019-10-31 19:37:18 +01:00
Sahid Orentino Ferdjaoui 019e5ba45a sync with last charms.ceph
7839ca3 put create_keyrings as a public method

Change-Id: Ia1ab1860df33960519d0fac70b8315bc3e8e25a3
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-10-24 10:00:25 +00:00
Chris MacNaughton 23103d2958 Use charm-internal _upgrade_keyring
This change includes a charms.ceph sync.

The _upgrade_keyring function was removed from charms.ceph
so this charm needs to use the already-existing, charm-
internal version.

Change-Id: Ia7cf352a2456dc85aca6f61d2e88327cd0c15f7e
Closes-Bug: #1845975
2019-10-02 15:18:21 +00:00
taodd 7772560510 Sync charms.ceph to get fix
Change-Id: Ib3d4b79690eb5931b4f0680b937590b317a91427
Closes-Bug: #1841021
2019-09-24 20:07:42 +08:00
David Ames e6086328f4 Validate output of list_logical_volumes
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.

Depends-On: I75a6b1dda15dd7c2cece8cfe97b28317b3d5162b
Change-Id: I2d371dae94dca328cf4782a79e85c1c6fd77f547
Closes-Bug: #1819382
2019-05-15 11:00:34 -07:00
Zuul 4a3a981e9d Merge "udevadm settle before processing osd-devices" 2019-03-19 07:55:02 +00:00
Liam Young 8655dbd9e3 udevadm settle before processing osd-devices
Run udevadm settle before processing osd-devices as there may by
udev events that have been queued for processing on server startup.

Includes charms.ceph sync

Corresponding charms.ceph change is:
Iec5932a4d819ad87e54c2af391abe1befe84f164

Change-Id: Ia4210d6a5c2c8a0b0e2038b25f24d2d82600e10a
Closes-Bug: #1812925
2019-03-05 07:59:46 +00:00
Andre Ruiz 56495eecba Implement new option to enable discard on SSDs
This change implements a new option called 'bdev-enable-discard' to control
behaviour of issuing discards to SSDs on ceph bluestore. The new code tries
to autodetect cases where it should be enabled by default but will allow
forcing if desired.

Change-Id: I7b83605c827eb4058bc4b46c92eb114c11108c93
Closes-Bug: #1788433
2019-03-01 15:26:56 +01:00
Zuul dc3e5c80f7 Merge "Update cloud-archive.list when upgrading from Pike to Queens" 2019-02-06 16:20:04 +00:00
Chris MacNaughton 9bc5abab55 Ensure we populate osd-devices with existing devices
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: I17fab658511275f1dde15683ef296d4c72e7980e
Closes-Bug: #1814597
Depends-On: I940b108d914b39b55013a4617c3d17ff7122df60
2019-02-05 12:36:28 +01:00
Felipe Reyes 336581efeb Update cloud-archive.list when upgrading from Pike to Queens
ceph-osd charm only upgrades when the ceph version changes, for the
case of upgrading from Pike to Queens the charm is skipping any
upgrades, because the Cloud Archive has Luminous for those 2 releases.

This patch checks if the requested ceph version is luminous and if the
'source' changed from pike to queens to then upgrade
/etc/apt/sources.list.d/cloud-archive.list via add_source()

Change-Id: I27c2d7648a1add6528924724a03682060d2d6007
Closes-Bug: 1778823
2019-02-01 11:47:05 -03:00
Zuul eec8464e93 Merge "Resync charms.ceph and charmhelpers" 2018-12-11 19:07:23 +00:00
Przemysław Hausman 87e43ce27a Remove chown'ing on adding dirs to osd-devices
When adding directories to osd-devices (e.g. juju config ceph-osd
osd-devices="/srv/ceph1 /srv/ceph2"), the charm was recursively changing
owner and group for all files below /var/lib/ceph, for each added
directory. This was taking time and was not useful.

The fix is to remove unnecessary recursive chown on /var/lib/ceph, since
ceph already manages the ownership of the files itself.

Change-Id: I39a00591bc86ec49c4ced53eadce75ddb21e2431
Closes-Bug: #1795383
2018-12-07 09:05:06 +01:00
James Page cfc7b05332 Resync charms.ceph and charmhelpers
Resync with latest updates to charms.ceph to avoid explicit
installation of python-ceph which is not required and breaks
under the laters Ceph packaging which no longer ships Python 2
support.

Change-Id: I4ce2b91dd476f90c30d1379dac5b00b8aaa9c73a
2018-12-05 15:24:45 +00:00
Chris MacNaughton c158d7432b Add directories to osd-devices as well
Tracking directory backed OSDs in the kv store allows
us to bootstrap further relations based on bootstrapped
OSD counts.

Change-Id: I1abd767d15c204845d9909d9c7ee9414dbe87a5c
Closes-Bug: #1802134
Depends-On: https://review.openstack.org/#/c/616230/
2018-11-07 17:17:44 +01:00
James Page ce97b7a479 Resync ceph helpers
Resync ceph helpers, picking up fixes for:

 - Upgrades from Luminous to Mimic.
 - Correct build of OSD list in more complex CRUSH
   configurations, resolving upgrade issues.

Closes-Bug: 1788722

Change-Id: I7d8fca74ec6eadae21a6e669e8b2522d9e4c9367
2018-10-12 09:55:03 +01:00
Chris MacNaughton 0cb16d8c66 Sync in charms.ceph
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.

Change-Id: Iea9812ee7ac67f9b45a6b38c43c130353e68ad8f
Closes-Bug: #1788722
Depends-On: I69d653f9f3ea4ee8469f3d7323ee68435ba22099
2018-08-24 16:38:06 +02:00
James Page 488f7dffef Use provided device paths
Ensure that device paths provided by end users are used for OSD's,
rather than the link target device as this may change between
reboots. The specific use case is bcache, where:

   /dev/bcacheX:
        changes between reboots
   /dev/disk/by-dname/bcacheX:
        udev managed and consistent

This change also ensures that any unit data is updated to switch
back to using the provided block device path, rather than the
actual target which may have been used in prior charm revisions.

Change-Id: If5e88d93b9323052ea762d3a4b66f2442d4a19be
Depends-On: If0e1fbc62bfe7d0f9e21db9bfdeee761060de846
Closes-Bug: 1782439
2018-07-27 13:51:55 +01:00
James Page a26b5e4551 mimic: Sync charms.ceph for misc fixes
Ensures mon cluster is not queried early in unit lifecycle
when the cluster is not bootstrapped or accessible by the
ceph-osd unit.

Block device sizes are set in local config so querying the
monitor is OK to skip.

Change-Id: Iea37455b0946560056ee665e819ee0a2a4a7832c
2018-07-24 06:54:48 +01:00
Nicolas Pochet bb3a7f198c Remove reference to ntp package
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: I5834ff22d4306707529e958cd26f14bbb752c796
Closes-Bug: #1780690
Depends-on: Iddb7ffcc7ab7a74700855b950f619208511c2fab
2018-07-20 16:07:12 +02:00
Dmitrii Shcherbakov e340cc851c ignore devices that have already been processed
Similar to how osdize in charms.ceph checks for already processed
devices we need to avoid checking if they are pristine or not.

Additionally, mapped LUKS devices need to be filtered from being zapped
as they may hold valuable data. They are only used as underlying devices
for device mapper and dmcrypt to provide a decrypted block device
abstration so if they really need to be zapped a mapping needs to be
removed first.

This change also pulls charms.ceph modifications.

Change-Id: I96b3d40b3f9e56681be142377e454b15f9e22be3
Co-Authored-By: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
Co-Authored-By: Chris Procter <chris.procter@canonical.com>
Closes-Bug: 1781453
2018-07-17 14:30:51 +03:00
Frode Nordahl 352d699387
Add pre-flight check for device pristinity
Add `non-pristine` key to `list-disks` action.

No longer attempt to do initializtion of `osd-journal` devices.

Make py27 test noop

Flip pep8 test to py3

Partial-Bug: #1698154
Change-Id: I0ca574fa7f0683b4e8a693b9f62fbf6b39689789
Depends-On: I90a866aa138d18e4242783c42d4c7c587f696d7d
2018-06-04 17:02:11 +02:00
Ryan Beisner 22ce311b0b
No reformat
Do not reformat devices.  A subsequent change will be necessary
to account for conditions where a reformat is still desired,
such as a set of blocking states and user-driven actions.

Partial-bug: #1698154

Depends-On: I90a866aa138d18e4242783c42d4c7c587f696d7d
Change-Id: I3a41ab38e7a1679cf4f5380a7cc56556da3aaf2b
2018-06-04 12:40:47 +02:00
Frode Nordahl 2c3eae272f
Remove replace-osd action
At present this action does not work.  While looking to repair the
functionality I found a number of issues with the current
implementation.

For now I suggest we remove this functionality, and at some point we may
consider replacing it with a `remove-disk` action.

Sync in relevant changes from charms.ceph

Depends-On: Id61b87927c43d807aacc93cf05ec8f88d91b7a39
Change-Id: Ic71d304ff65a05ab7249f4dd07adc45429a323e9
2018-05-28 11:25:00 +02:00
Alex Kavanagh 8b2303e863 Fix Traceback issue when ceph-osd upgrade fails
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: Ib7d1fdc8f91bc992ccf618ef6f57e99bb90c2dbc
Partial-Bug: #1770740
2018-05-17 11:44:23 +01:00
James Page 2069e620b7 Add support for vault key management with vaultlocker
vaultlocker provides support for storage of encryption keys
for LUKS based dm-crypt device in Hashicorp Vault.

Add support for this key management approach for Ceph
Luminous or later.   Applications will block until vault
has been initialized and unsealed at which point OSD devices
will be prepared and booted into the Ceph cluster.

The dm-crypt layer is placed between the block device
parition and the top level LVM PV used to create VG's
and LV's to support OSD operation.

Vaultlocker enables a systemd unit for each encrypted
block device to perform unlocking during reboots of the
unit; ceph-volume will then detect the new VG/LV's and
boot the ceph-osd processes as required.

Note that vault/vaultlocker usage is only supported with
ceph-volume, which was introduced into the Ubuntu packages
as of the 12.2.4 point release for Luminous.  If vault is
configured as the key manager in deployments using older
versions, a hook error will be thrown with a blocked
status message to this effect.

Change-Id: I713492d1fd8d371439e96f9eae824b4fe7260e47
Depends-On: If73e7bd518a7bc60c2db08e2aa3a93dcfe79c0dd
Depends-On: https://github.com/juju/charm-helpers/pull/159
2018-05-15 08:28:15 +01:00
James Page 4846c5654c Support use of partitions with ceph-volume
Resync ceph helpers to support use of partitions and bcache devices
for OSD filestore, blockstore, journal, db and wal devices.

Change-Id: Iac5eefc4c3f53b1ec2f5cfc6e98a9a2168c1c0b6
Closes-Bug: 1769678
2018-05-08 11:47:57 +02:00
James Page a21be9a7ab Improve idempotency of block device processing
Resync charms.ceph to pickup improvements in recording
of block devices that have been processed as OSD devices
to support better idempotency of block device processing
codepaths.

This fixes a particularly nasty issue with osd-reformat
is set to True where the charm can wipe and re-prepare
an OSD device prior to the systemd unit actually booting
and mounting the OSD's associated filesystem.

This change also makes the osd-reformat option a boolean
option which is more accessible to users of the charm
via the CLI and the Juju GUI.

Change-Id: I578203aeebf6da2efc21a10d2e157324186e2a66
Depends-On: I2c6e9d5670c8d1d70584ae19b34eaf16be5dea19
2018-04-10 14:34:53 +01:00
James Page b6dca11a1b luminous: ceph-volume switch
Switch to using ceph-volume + LVM for managing block devices
for Luminous and later; this is the upstream preferred approach
to managing OSD devices, allowing for more flexibility in terms
of use of crypto and logical volumes.

Change-Id: I30c4d29e6f568ac2e30a45b1a7bc0e68685c3707
Depends-On: I1675b67d364ae6042129a8a717d4bdffff5bde92
2018-04-10 09:17:38 +01:00
Chris MacNaughton eeacba1614 Sync in charms.ceph change for udev settle
Change-Id: Ideb8dbe8e6e43966baa83084fa0ea7eac2e2597c
Closes-Bug: #1746118
2018-02-15 15:03:56 +01:00
James Page de3b55a4e7 Resync ceph helpers for misc fixes
Pickup fixes for upgrade from Jewel -> Luminous.

Change-Id: I3ffeebc38464096724ca0fd40f1cf29cf3e7fe4f
Closes-Bug: 1742082
Closes-Bug: 1742083
Closes-Bug: 1742120
Closes-Bug: 1742079
Closes-Bug: 1742408
2018-01-10 11:31:53 +00:00
Dmitrii Shcherbakov 189e7620c0 add bluestore-specific config options
Adds bluestore-specific options related to the metadata-only journal.

The options allow a user to control:

1. path to a bluestore wal (block special file or regular file)
2. path to a bluestore db (block special file or regular file)
3. size of both

Their configuration works similarly to the FileStore journal. If paths
are not specified both WAL and DB will be collocated on the same block
device as data.

Other options can be configured via an existing config-flags option if needed.
http://docs.ceph.com/docs/master/rados/configuration/bluestore-config-ref/

Closes-Bug: #1710474
Change-Id: Ia85092230d4dcb0435354deb276012f923547393
Depends-On: I483ee9dae4ce69c71ae06359d0fb96aaa1c56cbc
Depends-On: Idbbb69acec92b2f2efca80691ca73a2030bcf633
2017-12-20 12:02:42 +00:00
Liam Young f5c1861054 charms.ceph sync for py3 bug fix
Change-Id: Id0add7b995e424a5a1c77c80e242fc6ffca54c87
Partial-Bug: #1735720
2017-12-01 13:36:12 +00:00
James Page 1efade7f7c Resync charmhelpers for py3 fixes
Includes fix for failed sysctl tuning with lxdbr0.

Change-Id: I53de0d6dd9e9c4035f02405d172e1e2e5224daf0
Closes-Bug: 1735070
2017-11-29 09:20:12 +00:00
Alex Kavanagh 4e1ecd55b8 Bring ceph-osd to Python 3
* Synced version of charm-helpers
* Synced version of charms.ceph to bring in Py3 compatible library
  methods.

Change-Id: I5ac45740f48a71d9cb0c5943472fc8590a723514
2017-11-17 12:13:54 +00:00
Dmitrii Shcherbakov 7a5be1a23c sync changes from charms.ceph
Change-Id: I8a83e15a77306cca4baa665c31cb9363f7cbde83
Depends-On: I483ee9dae4ce69c71ae06359d0fb96aaa1c56cbc
2017-09-25 21:37:58 +03:00
Chris MacNaughton 867afa38e1 sync in changes from charms.ceph
Change-Id: Iaa2ddfa4db639db1a142e7b025a26012fb45e3de
2017-08-28 14:45:58 +02:00
Chris MacNaughton 7384c244ea Sync charms.ceph changes
- ensure filestore is used by default
- allow upgrades to luminous

Change-Id: I00aa4fcba53d9bd28592b9ba1b89f74d869148c2
Depends-on: I8205f7c7c63ec30900c4afdc76df174d3d9a8466
2017-08-16 14:41:28 +02:00
Edward Hope-Morley 4bcdddc4a3 Sync charms.ceph to get code cleanup changes
Also had to fix some imports due to changes
implemented as part of the cleanup.

Change-Id: Ie232828056a7f15525f820e8e106264b22697168
2017-08-14 14:46:38 +01:00