Commit Graph

39 Commits

Author SHA1 Message Date
Peter Sabaini 1bac66ee50 Remove FileStore support
Remove support for creating FileStore OSDs. Also prevent upgrade
attempts to Reef if a FileStore OSD is detected

Change-Id: I9609bc0222365cb1f4059312b466a12ef4e0397f
2023-10-06 09:03:51 +02:00
Samuel Walladge 97be046f9b Save the crash module auth key
Read the key set on the mon relation,
and use ceph-authtool to save it to a keyring,
for use by the crash module for crash reporting.

When this auth key is set, the crash module (enabled by default)
will update ceph-mon with a report.
It also results in a neat summary of recent crashes
that can be viewed by `ceph health detail`.
For example:

```
$ juju ssh ceph-mon/leader -- sudo ceph health detail

HEALTH_WARN 1 daemons have recently crashed
[WRN] RECENT_CRASH: 1 daemons have recently crashed
    osd.1 crashed on host node-3 at 2023-01-04T05:25:18.218628Z
```

ref. https://docs.ceph.com/en/latest/mgr/crash/

See also https://review.opendev.org/c/openstack/charm-ceph-mon/+/869138
for where the client_crash_key relation data set is implemented.

Depends-On: https://review.opendev.org/c/openstack/charm-ceph-mon/+/869138

Closes-Bug: #2000630
Change-Id: I77c84c368e6665e4988ebe9a735f000f99d0b78e
2023-01-20 15:13:13 +10:30
Luciano Lo Giudice 55720fa087 Implement the 'remove-disk' action
This new action allows users to either purge an OSD, or remove it,
opening up the possibility of recycling the previous OSD id. In
addition, this action will clean up any bcache devices that were
created in previous steps.

Change-Id: If3566031ba3f02dac0bc86938dcf9e85a66a66f0
Depends-On: Ib959e81833eb2094d02c7bdd507b1c8b7fbcd3db
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/683
2022-03-31 18:50:22 +00:00
Luciano Lo Giudice 65207967cf Enhance the 'add-disk' action for disk replacement
As part of the task to improve disk replacement, the 'add-disk' action
needs some changes. This includes:
- Creating 'bcache' devices to accelerate disk access.
- Creating caching partitions of a specified size.
- Recycling previously deactivated OSD ids.

Change-Id: Id5027f30d51c23d2be4c34f82867d65a50b35137
Depends-On: I43d0a0bc11664c37532c0117711affc93c9d1ad1
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/675
2022-02-18 12:43:46 -03:00
Robert Gildein e928f1376c Add `osds` argument to the osd-in/osd-out action
The `osds` parameter has been copied from function start/stop to preserve
the same functionality. By default, osd-in/osd-out needs list of IDs as
an argument or it will not do anything (previously, it applied the change
to all the osds). It's possible to take in/out *all* with provided `osds`
parameter as `all`.

Closes-Bug: #1910150
Change-Id: I0275f015e2d0bbbb661d2b7dea59c320ba6c021c
2021-01-15 15:13:29 +01:00
Frode Nordahl b49468fc10
Add BlueStore Compression support
Sync in updates from charm-helpers and charms.ceph.

Depends-On: I153c22efb952fc38c5e3d36eed5d85c953e695f7
Depends-On: Ibec4e3221387199adbc1a920e130975d7b25343c
Change-Id: I028440002cdd36be13aaee4a0f50c6a0bca7abda
2020-08-26 16:30:24 +02:00
Frode Nordahl 0ca99c2fc3
Unpin flake8, fix lint
Change-Id: I7f47c1dac0761101980ebba3f9aab8732cb0d1ce
2020-08-26 16:29:47 +02:00
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
Chris MacNaughton 82f8bd8804 Refactor OSD bootstrap code out of charms.ceph
As the OSD bootstrap code is unique to ceph-osd, the code
to check / setup the OSD bootstrap & upgrade keys can be
moved in-tree.

Change-Id: Ia1639c81238ca782b5600bbe445cf6ee105bfd37
2019-08-21 15:49:03 +02:00
Chris MacNaughton 1e18c645e6 Do not fail when called on an invalid device
When calling smartctl on bcache devices, we will get
a non-zero return code. In this case, we fail safe and
do not enable a potentially unavailable feature. Additionally,
other possible failures with device identification will
be caught and safely handled this way.

Change-Id: Ie10fb24cbfedf98c8bb53b710b95962579d3284e
Closes-Bug: #1819652
2019-03-13 12:40:53 +01: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
David Ames a5ab695962 Series Upgrade
Implement the series-upgrade feature allowing to move between Ubuntu
series.

Change-Id: I174c30e0de2c9753742262a31b73651b7a4ed3da
2018-09-21 07:38:01 +00: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
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
Frode Nordahl c4d4e42c1a Add actions to blacklist osd-devices
The blacklist actions allow for adding and removing devices
to a unit-local list of devices to be skipped during osd
initialization. This list will be used to override the
application level, and thereby deployment wide, 'osd-devices'
configuration option on a individual unit basis.

The pre-existing list-disk action is extended to return
list of blacklisted devices under the 'blacklist' key.

Change-Id: I28a3c5d6076fb496dead3fe3387d9bbbbe9ec083
Closes-Bug: #1730267
2017-11-09 07:06:29 +01:00
Alex Kavanagh 2305eabe27 Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: I904f5faf2bd8fc28204d5e26c94877708cb98d7e
Related-Bug: #1659575
2017-04-11 17:19:09 +01:00
James Page c32211c8e1 Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

In order to make this change, this commit also drops the
inclusion of upstart configurations for very early versions
of Ceph (argonaut), as they are no longer required.

Change-Id: I9609dd79855b545a2c5adc12b7ac573c6f246d48
2016-06-28 12:01:05 +01:00
James Page afe7651e5c Add support for Juju network spaces
Juju 2.0 provides support for network spaces, allowing
charm authors to support direct binding of relations and
extra-bindings onto underlying network spaces.

Add public and cluster extra bindings to this charm to
support separation of client facing and cluster network
traffic using Juju network spaces.

Existing network configuration options will still be
preferred over any Juju provided network bindings, ensuring
that upgrades to existing deployments don't break.

Change-Id: I78ab6993ad5bd324ea52e279c6ca2630f965544c
2016-04-08 22:42:36 +01:00
Alex Kavanagh bbfdeb84f0 Pause/resume for ceph-osd charm
This changeset provides pause and resume actions to the ceph charm.
The pause action issues a 'ceph osd out <local_id>' for each of the
ceph osd ids that are on the unit.  The action does not stop the
ceph osd processes.

Note that if the pause-health action is NOT used on the ceph-mon
charm then the cluster will start trying to rebalance the PGs accross
the remaining OSDs.  If the cluster might reach its 'full ratio' then
this will be a breaking action.  The charm does NOT check for this
eventuality.

The resume action issues a 'ceph osd in <local_id>' for each of the
local ceph osd process on the unit.

The charm 'remembers' that a pause action was issued, and if
successful, it shows a 'maintenance' workload status as a reminder.

Change-Id: I9f53c9c6c4bb737670ffcd542acec0b320cc7f6a
2016-04-08 11:25:18 +00:00
Edward Hope-Morley 384d3c80d5 remove unused function 2016-02-18 17:10:53 +00:00
Edward Hope-Morley 3f59f4fc7f post-review fixes 2016-02-18 11:39:47 +00:00
Edward Hope-Morley 408b1c7a4e [hopem,r=]
Support multiple l3 segments.
Closes-Bug: 1523871
2016-02-10 15:21:47 +00:00
James Page eebb030429 [xianghui,dosaboy,r=james-page,t=gema] Add IPv6 support using prefer-ipv6 flag 2014-10-01 21:11:28 +01:00
Hui Xiang 515cc1e710 Refactor codes. 2014-09-30 11:22:30 +08:00
Edward Hope-Morley 9dc6e5bfbb fixed ceph.conf newline issue and get_host_ip() 2014-09-24 14:29:10 +01:00
Edward Hope-Morley 1913919d34 applied jamespage review fixes 2014-09-24 13:54:40 +01:00
Edward Hope-Morley b715ebd273 fixed get_mon_hosts() 2014-09-19 09:10:31 +01:00
Edward Hope-Morley 86b1c30ef5 [hopem,r=]
Adds IPv6 support for ceph osd.
2014-09-18 18:52:25 +01:00
James Page 2b75b70758 Sync with alternatives charmhelpers, installed ceph.conf as alternative for charm co-existence 2013-10-10 11:49:36 +01:00
James Page 653b7164df Use new storage charmhelpers, configure_source redux 2013-06-25 12:03:55 +01:00
James Page 56a11a2a57 Migrate to charm-helpers, tidy up flake8 2013-06-24 11:24:47 +01:00
James Page df28cb6218 Updates to support Ceph Bobtail LTS
- Add support for different OSD block device formats
- Add support for separate journal disks

Fixes

- Improve hostname -> ip address resolution (fixes issues with MAAS managed DNS)
- Improve zapping process for devices that have already been OSD's.
- Don't catch key errors from hooks in do_hooks.
- Resync utils.py, ceph.py across ceph charms.
2013-02-08 11:03:53 +00:00
James Page 247519b4fd Allow DNS problems to bubble up and break hooks as things are broken if this
is the case.
2013-02-07 16:01:17 +00:00
Paul Collins ed8494ed6f use ceph.list, not quantum.list 2013-01-28 16:24:05 +13:00
James Page 17081d934b Improve host ip resolution - fixes issues with maas managed DNS 2013-01-24 08:40:15 -06:00
James Page f75ba8b080 Misc updates 2013-01-11 09:11:24 +00:00
James Page 80b4985348 Resync with ceph charm, updates for raring 2012-12-17 10:31:03 +00:00
James Page e30f3f7b3c Add full support for cloud archive use; add early check for device presens in osdize. 2012-11-12 09:36:03 +00:00
James Page 1683ffaa84 Initial ceph-osd charm 2012-10-08 15:07:16 +01:00