Commit Graph

18 Commits

Author SHA1 Message Date
Chris MacNaughton f5965a81bd Bypass charm going into blocked due to a bug
After Octopus, the reporting about image states fails because of a
permission issue in Ceph. This change disables that status reporting
to allow a deployment to be healthy even when some tools cannot query
status.

Also modernize build and func testing: remove python 3.9 and xena from
tests

Related-Bug: #1879749
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1063
Change-Id: Id86fc043495b89609cf6873ec58aee1e2e388578
2023-06-02 10:49:27 +02:00
Hervé Beraud a0781dafff Use unittest.mock instead of mock
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.

Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.

Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: I6cf34358b919d4ab568a329395207676bd2e531d
2021-12-15 11:02:05 +00:00
Ionut Balutoiu c2a27dc336 Cinder Ceph Replication tests
* Add optional parameter `pools` to the Juju actions: `resync-pools`,
  `status`, `demote`, and `promote`.
* Add `bionic-train-image-mirroring` to the `gate_bundles`.

Change-Id: I9df77be628718bb60a1bdc65078c94d0b7bda9d4
Func-Test-Pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/486
2021-03-10 14:31:25 +00:00
Ionut Balutoiu 3562e11bda Handle RBD mirroring mode set in the relation
Change-Id: I423eb38f5197879c5f8f7999acb11ece3d26a6a4
Co-authored-by: Marius Oprin <morpin@cloudbasesolutions.com>
Signed-off-by: Marius Oprin <moprin@cloudbasesolutions.com>
2020-12-15 15:52:01 +02:00
Frode Nordahl 85e33607d1 Add BlueStore Compression support
Drop support for forwarding requests for manually created Erasure
Coded pools. The initial implementation was based on a incomplete
implementation of EC support in the supporting libraries.

Make use of the forwarding of broker requests to support both
BlueStore Compression and Erasure Coded pools created through
the broker request protocol by charms in the source model.

There is currently no support for forwarding or influencing these
properties for manually created pools.

Depends-On: I0d4ed457e1d59eabed3340f5dc7d8353d5d66f04
Depends-On: I16196053bee93bdc4e5c62f5467d9e786b047b30
Change-Id: I19f66f8594b9bdada5365582ce98365039235f9d
2020-11-12 09:06:46 +01:00
Frode Nordahl efb995a78a Do not execute handlers in update-status hook
Change-Id: I9093f83bd5ef642ad5da7d56543254ca9804b80b
2020-10-08 22:06:47 +02:00
Frode Nordahl 0bb529a828
Make use of default ``config.rendered`` handler
Change-Id: I44307aa958ee3caf245865a21948fd2641fa0a6d
2019-11-29 08:02:08 +01:00
Frode Nordahl 011a5d3b67
Pass key data instead of interface object
Update to match change in ``charms.openstack``

Depends-On: If1d645f4708e27b724f93cac0e14431137c885d7
Change-Id: I01053ff88e4dba58893dc20e171095f62524f480
2019-04-23 15:37:56 +02:00
Frode Nordahl cc6897b738 Handle inability to retrieve status gracefully
Tactical fix for occational segfault in ``rbd mirror pool status``

Change-Id: Ic50d06ee646ca525085fa009d344c8eabd178839
Partial-Bug: #1820976
2019-04-02 17:02:29 +02:00
Frode Nordahl 79bc4e1379 Add action to force resync of images in all pools on local endpoint
There exist failure scenarios where abrupt shutdown and/or
interruptions to communication may lead to a split-brain situation
where the RBD Mirroring process in both Ceph clusters claim to be
the primary.

In such a situation the operator must decide which cluster has the
most recent data and should be elected primary by using the
``demote`` and ``promote`` (optionally with force parameter)
actions.

After making this decision the secondary cluster must be resynced
to track the promoted master, this is done by running the
``resync-pools`` action on the non-master cluster.

Change-Id: I4f57c9202ed4d055066286f808369ec0ddddb7ea
2019-04-02 09:23:22 +02:00
Frode Nordahl 0770640158 Centralize pool mirror eligibility decision making
Pool mirror eligibility is currently done in generator expressions
repeated where needed.

Centralize this in one function.

Change-Id: I6e151621cefb4fe2c6339c9b16cd31c01b95e6f2
2019-04-02 09:20:59 +02:00
Frode Nordahl 87677bf23d Handle relation departure
Change-Id: I5b7600a524ce1ec7bce34efd12dadcea26197832
2019-03-28 11:57:55 +01:00
Frode Nordahl cb66d5acea
Add ``status`` action
The action gets rbd mirror pool status for mirrored pools.

Change-Id: Ie0962dbee9e0ba9298df6b2448d21180c3a9c0d4
2019-03-20 10:53:40 +01:00
Frode Nordahl 2a645e9d0d
Add actions
``demote`` is used to demote all images in all pools, used for
operator controlled fail over/fall back.

``promote`` is used to promote all images in all pools, used for
operator controlled or disaster recovery fail over/fall back.

``refresh-pools`` is used to refresh list of eligible pools from
local Ceph cluster.  Side effect is to enable mirroring of pools
created manually without the use of the charm ceph broker protocol.

Change-Id: I9af983b37045f83a0a9703e2212b371b97dc3121
Depends-On: I97bfb9a2c0e30998566aee56d4630af6baa36d45
2019-03-06 13:30:36 +01:00
Frode Nordahl d9cea01476 Add summary stats for mirrored pools and images in workload status
Change-Id: I550473edf7c7253b96fdb323b8b4761049a1de88
2019-03-05 12:35:35 +01:00
Frode Nordahl 8e54055e92 Make rbd tool use json formatted output
Change-Id: Ie2233350cb4520b598dd127b24132fdb4ed42802
2019-03-05 12:35:04 +01:00
Frode Nordahl a17c896c29
Add gate jobs
Fix a few discrepancies discovered during unit testing.

Add missing unit tests.

Add end to end functional test bundle.

Change-Id: Ic05c72f9e684f615b60a3975779e76526a0c9c64
2019-03-05 12:34:18 +01:00
Frode Nordahl 5537237ea7
Initial commit of charm skeleton 2019-01-10 16:11:41 +01:00