Commit Graph

50 Commits

Author SHA1 Message Date
Zuul 5bba68b2b2 Merge "Update command references to juju 3.x syntax" 2023-12-07 15:10:49 +00:00
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
Jake Nabasny 2380ad7cde Update command references to juju 3.x syntax
Change-Id: I4f1e1bbcf43a55b465382af914a0951aedf8c62b

Change "relate" to "integrate" in README juju cmd

Change-Id: I4f1e1bbcf43a55b465382af914a0951aedf8c62b
2023-09-20 12:07:47 -04:00
Peter Sabaini 8c7ae6889a Fix: increase timeout for remove-disk
The `ceph osd purge` command used for the remove-disk action can take
several minutes to run. Increase the timeout for this to avoid
spurious errors.

Change-Id: I3a7fafa42c4a2ecaf45ba476e0157937e468ca33
2023-03-20 17:33:03 +01:00
utkarshbhatthere 470be74771
Adds timeout for ceph command calls.
Change-Id: I8c81b1f0042181d814d5f268282b082c8a5fc217
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/989
2023-03-10 17:42:53 +05:30
Zuul f50e64fb33 Merge "Enable users to start/stop Crimson OSD's" 2022-11-08 15:08:26 +00:00
Luciano Lo Giudice dbe3ee52bc Enable users to start/stop Crimson OSD's
This patchset modifies the add-disk action so that it now
can optionally start a Crimson OSD daemon.

Change-Id: I59bf4e41f1f56c6bda2352b5613289ff73113342
Depends-On: If58bde4d5445ed5de420abc007db6bf8b8e43269
2022-10-18 18:11:47 -03:00
Chris MacNaughton ea56c2c197 Ensure add-disk and hooks handle disks the same way
Depends-On: I2ea119f5a1b2a36ccd36df4db094f208a1db100e
Depends-On: Ie19e5318ea35c38e5d02963260b85fec0f233df6
Change-Id: Idebe45504233fb5559a3e9ddd9b2d6534cba7bb2
Closes-Bug: #1820271
2022-09-12 09:29:05 -04:00
Chris MacNaughton 0b8a583892 Fix ceph-osd disk removal on Jammy
Closes-Bug: #1987695
Change-Id: I7523e8fa0f6b62329eefcce6daf250881812943c
2022-08-29 15:44:49 -04:00
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
Zuul e8a6a4f5c7 Merge "Add an action to provide information about AZ" 2021-09-07 12:11:00 +00:00
Robert Gildein d0d3d3edf5 Add an action to provide information about AZ
The 'get-availability-zone' action will get information about an
availability zone that will contain information about the CRUSH
structure. Specifically 'rack' and 'row'.

Closes-Bug: #1911006
Change-Id: I99ebbef5f23d6efe3c848b089c7f2b0d26ad0077
2021-09-03 09:48:24 +02:00
Nikhil Kshirsagar 489a4ede69 Do not zap a disk if it is used by lvm2
If the disk being zapped is used by lvm (if it contains the
lvm label and hasn't been pvremove'd) it's safer to simply
bail out of zapping it than attempt teardown through a force
pvremove, because the disk being zapped might be in fact in
use by some LV.

Closes-Bug: 1858519
Change-Id: I111475c5a4584a3e367c604ab51ce2ef3789ff7f
2021-08-25 11:34:42 +05:30
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
Martin Kalcok e22f602544 Added `start` and `stop` actions for management of ceph OSDs
Change-Id: If8b83ab06364903548c5841487034bc1bb9aaf0c
Closes-Bug: #1477731
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/473
2020-12-15 17:29:24 +01:00
Robert Gildein bc071cd208 add function to check if device exists
- if the device does not exists, the action failed with message:
  '/dev/<device>: Device does not exists.'

Closes-Bug: #1885336
Change-Id: I417c0074fe64c2afceecdfb09b8673930087f65f
2020-11-25 12:54:49 +01: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
Edward Hope-Morley 871b057335 Ensure bootstrapped-osds count updated after add-disk
When we add/zap disks it may change the overall osd
count so need to ensure this is kept up-to-date.

Change-Id: Ib55547f88316e80a8948ce808ea992c1402458f5
Closes-Bug: #1861293
2020-02-03 15:45:56 +00:00
taodd 8ca701eb87 Fix list-disk action wrongly report osd journal as the non-pristine device
Change-Id: Ib117fc5797447ade75d50a7ff7dae5de473fe7b9
Closes-Bug: #1847988
2019-10-23 15:27:17 +08:00
Chris MacNaughton 874e553e0c Add security-checklist action
Change-Id: I6e2ff9b546a1283748550beefc366ae055b63b7e
Func-Test-PR: https://github.com/openstack-charmers/zaza/pull/193
2019-03-13 10:32:13 +01:00
David Ames 1e0c6548b8 Rename pause/resume osd-out/osd-in
The actions pause and resume actually take all osds on a unit out of the
cluster. This is incredibly misleading.

This change renames to osd-out and osd-in to better describe what the
actions actually do.

Change-Id: I76793999f5d3382563eff308a5d7c4db18d065a0
Closes-Bug: #1793507
2018-11-27 14:48:47 -08: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
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
James Page 6c27240761 add-disk: Ensure key-manager config is passed to osdize
Recent changes to support vault for key management require that
the 'osd-encrypt-keymanager' is passed to all osdize calls so
that the correct key management approach is taken.

Ensure that the add-disk action does the same, otherwise keys
will always be stored in the ceph mon KV store, rather than
in Vault.

Closes-Bug: 1780920

Change-Id: I8c722d38d68f13dc00c7444a50d67ce37fbd6a29
2018-07-10 09:29:17 +01:00
Frode Nordahl 4368f6b545
Fix subscription of filter object error
In Python 3 filter() built-in returns a iterator and not a list

Change-Id: I641565109b0dcc816a66d3ca3eb578fb9ed44a1a
Closes-Bug: #1774694
2018-06-04 18:17:14 +02: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
Zuul bebf8601c9 Merge "No reformat" 2018-06-04 12:38:42 +00:00
Chris MacNaughton 487658abe0 Add action to zap disk(s)
This action includes configuration for disk(s) to
zap, as well as an additional required flag for
the administrator to acknowledge pending data loss

Change-Id: I3106e2f10cf132a628aad025f73161b04215598e
Related-Bug: #1698154
2018-06-04 13:08:45 +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
David Ames da51f91680 Py3 Fixes
Charm-helpers sync for python3 fixes.
Update Exception.message to use str(Exception)

Change-Id: I0e354d0d07f220e3285eb3e863498918c82df2ca
2017-12-05 18:55:28 +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
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 b15237b3c5 Fix up the imports on a recent change to follow coding spec
Essentially, we want to avoid doing:

    from module import f1, f2, f2

and instead doL

    import module

    module.f1()

This helps with reading the code and understanding where the functions
come from.

Change-Id: I1bc06441dc5595e8a0c84a5b5c3db5d88b68a4f2
2017-10-25 14:23:13 +01:00
Frode Nordahl 52306f8419 Fix imports for actions
Commit 4bcdddc4a3 code cleanup did
not address actions.

Fixed.

Change-Id: Ic5de38e4d56022e3f72e5dcb08f6a4253e3306ee
Closes-bug: #1726275
2017-10-23 17:18:57 +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
James Page ca8a5c332c Add bluestore support for OSD's
Add highly experimental support for bluestore storage format for
OSD devices; this is disabled by default and should only be enabled
in deployments where loss of data does not present a problem!

Change-Id: I21beff9ce535f1b5c16d7f6f51c35126cc7da43e
Depends-On: I36f7aa9d7b96ec5c9eaa7a3a970593f9ca14cb34
2017-07-07 10:00:23 +01:00
Billy Olsen 26afba1c3f Add lib folder to system path for replace_osd action
The replace_osd action fails to run because the ceph import cannot
be resolved without the lib folder existing in the system path.

Change-Id: If85a3ac7edbb22abf11cff5429e6820322ded898
Closes-Bug: #1696958
2017-06-09 11:40:04 -07:00
Billy Olsen 665ea2b6fc Skip osd-devices not absolute paths
This change skips over any devices which does not start with a leading
folder separator ('/'). Allowing such entries causes an OSD to be
created out of the charm directory. This can be caused by something as
innocuous as 2 spaces between devices. The result is that the root
device is also running an OSD, which is undesirable.

Change-Id: I0b5530dc4ec4306a9efedb090e583fb4e2089749
Closes-Bug: 1652175
2016-12-22 16:34:25 -07:00
Chris MacNaughton 5945a350d2 Move a disk with an action
A new action is implemented to allow an
administrator to move an OSD into a
different Ceph bucket

Change-Id: I6f9a2bfa12e97b4437cfac67747b62741de81e53
2016-12-12 11:34:49 -05:00
Chris MacNaughton 2dfbb5fe47 Add action to list unmounted disks
This action is fairly simple in that it returns
a list of unmounted disks

This also includes a git-sync to pull in charms.ceph
changes.

Change-Id: I0daa514958799cf5899375335e8e9e684df27704
Closes-Bug: 1645481
2016-11-28 16:53:04 -05:00
Ante Karamatic 1825045580 Reorder importing python modules
Path for python modules needs to be appended before
the module is imported

Closes-Bug: #1627685

Change-Id: I6001a7b01f3ba6c9a5179466a3165f2eace2e092
2016-09-26 12:23:52 +02:00
Chris MacNaughton 69b821d344 Clean up dependency chain
This includes a resync of charms_ceph to raise the directory one level
The charms_ceph change that we're syncing in changes the
name of the ceph.py file into the __init__.py file to remove the
second level of namespacing

Change-Id: I4eabbd313de2e9420667dc4acca177b2dbbf9581
2016-08-11 11:01:24 -04:00
Chris MacNaughton f9993191ab Migrate to shared lib
This change moves our ceph.py into
a seperate repository that we can share between various
ceph related Juju projects, along with a Makefile
change to use a new git_sync file to partially sync
a git repository into a specified path

Change-Id: Iaf3ea38b6e5268c517d53b36105b70f23de891bb
2016-08-02 09:04:51 -04:00
Chris Holcombe 3ab6133c2a Use osd-upgrade user for pause/resume
The pause and resume actions shell out to the ceph command to run
OSD operations (in/out).

Because the default cephx key given out by the monitor cluster does
not contain the correct permissions, these commands fail.

Use the osd-upgrade user which has the correct permissions.

Closes-Bug: 1602826

Depends-On: I6af43b61149c6eeeeb5c77950701194beda2da71
Change-Id: Ie31bc9048972dbb0986ac8deb5b821a4db5d585f
2016-07-19 10:50:30 +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
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
Chris Holcombe a8790f2303 Add support for replacing a failed OSD drive
This patch adds an action to replace a hard drive for an particular
osd server.  The user executing the action will give the OSD number
and also the device name of the replacement drive.  The rest is
taken care of by the action. The action will attempt to go through
all the osd removal steps for the failed drive.  It will force
unmount the drive and if that fails it will lazy unmount the drive.
This force and then lazy pattern comes from experience with dead
hard drives not behaving nicely with umount.

Change-Id: I914cd484280ac3f9b9f1fad8b35ee53e92438a0a
2016-03-17 08:41:15 -07:00