Commit Graph

1107 Commits

Author SHA1 Message Date
Zuul 6697f415ea Merge "Updates for caracal tox.ini" 2024-03-06 12:50:56 +00:00
Zuul 26cc4b30b5 Merge "Use ids for cinder internal tenant and user" 2024-02-26 16:58:51 +00:00
Alex Kavanagh e41df6f1cd Updates for caracal tox.ini
Update the tox.ini file(s) to use the constraints file from
zaza-openstack-tests.

Change-Id: I4d743c10474904e379234357103bd96eecc7b59a
2024-02-24 20:11:14 +00:00
Alex Kavanagh ba3ac4a1dc Updates for caracal testing support
These updates, on the master branch, are to support testing the caracal
packages and support of the charms for caracal.  They do NOT lock the charms
down, and don't change the testing branches to stable branches.

Change-Id: I5d15739f7f0804323ec61629fea53fc13f638f34
2024-02-12 18:18:57 +00:00
Erlon R. Cruz ff442694d2 Use ids for cinder internal tenant and user
admin_tenant_id and admin_user_id are more explicit than
admin_tenant_name and admin_user as names could duplicate
and cause issues.

Includes sync from Charm-helpers PR #874 below

Charm-helpers-pr: https://github.com/juju/charm-helpers/pull/874

Closes-Bug: #2030755
Change-Id: Idbc2f3d12dcf325b4a53a3dda1ecfa75a199295a
2024-01-11 10:32:03 -03:00
Alex Kavanagh 39462317b6 Improve platform mocking
Patch out charmhelpers.osplatform.get_platform() and
charmhelpers.core.host.lsb_release() globally in the unit tests to
insulate the unit tests from the platform that the unit tests are being
run on.

Change-Id: I6807128492cb184de3ef5f454d0ea745246b242e
2023-10-24 12:03:17 +01:00
zhhuabj 8b366fbf6b Support disabling apache wsgi socket rotation
Bug LP 1863232 introduced a new Apache configuration option called
WSGISocketRotation which allows users to disable wsgi socket
rotation. This patch makes this configurable with a new
wsgi-socket-rotation config option that defaults to the Apache
default and can optionally be set to False.

Closes-Bug: #2021550
Change-Id: Ieca45a470e7f827194780b2fee9f8c6049b94da3
2023-09-04 18:41:43 +08:00
Alex Kavanagh 2e2fff4253 Ensure get_requests_for_local_unit doesn't fail on incomplete relation
This is a rebuild/make sync for charms to pickup the fix in charmhelpers to fix
any inadvertant accesses of ['ca'] in the relation data before it is available
from vault in the certificates relation.  Fix in charmhelpers is in [1].

[1] https://github.com/juju/charm-helpers/pull/824
Closes-Bug: #2028683

Change-Id: I1fe688bf595520f876d0c15c591ee8cac34d00f2
2023-08-14 10:09:12 +00:00
Jadon Naas 32ceddef86 Fix typo in actions.yaml
There was a typo in actions.yaml for the resume action that was breaking
builds. This change fixes that typo. The charm will build.

Closes-Bug: 2030677
Change-Id: Iebded9db63ace1d70a21c1b2e72f88f57044047f
2023-08-08 20:20:49 -04:00
Corey Bryant d06c3a5e9f Add 2023.2 Bobcat support
* sync charm-helpers to classic charms
* change openstack-origin/source default to bobcat
* add mantic to metadata series
* align testing with bobcat
* add new bobcat bundles
* add bobcat bundles to tests.yaml
* add bobcat tests to osci.yaml
* update build-on and run-on bases
* drop kinetic
* update charmcraft_channel to 2.x/stable

Change-Id: Ied0a22bcd255d9dd2d253db2a64e549963ce942d
2023-08-02 14:20:26 -04:00
Jadon Naas 6f00af3e77 Add docs key and point at Discourse
Add the 'docs' key and point it at a Discourse topic
previously populated with the charm's README contents.

When the new charm revision is released to the Charmhub,
this Discourse-based content will be displayed there. In
the absense of the this new key, the Charmhub's default
behaviour is to display the value of the charm's
'description' key.

Change-Id: Ia8830828f363af91b0765ff4f761faefb5f00212
2023-07-11 16:05:56 -04:00
Corey Bryant 43ff5e66e7 Use service_domain in [service_user] section
Sync from charm-helpers to update [service_user] config to use the
service domain.

The keystone charm currently creates two service users, one for the
service domain (for v3 authentication), and the other for the default
domain (for v2 authentication). The [service_user] config needs to
use the service domain.

Closes-Bug: #2026202
Change-Id: Ice5953fb7e926fd8dcf48c895a1dc36210da1dfc
2023-07-05 16:00:52 -04:00
Corey Bryant ebbedcbf58 Render [service_user] only for identity-service relation
The service token section [service_user] is not required when
cinder-volume is deployed as a separate service. In other words
it is not required for the identity-credentials relation.

The [service_user] section is nearly the same as the
[keystone_authtoken] section, and the keystone_authtoken data
is only produced for the IdentityServiceContext, therefore this
change will not render [service_user] for the
IdentityCredentialsContext.

Closes-Bug: #2024676
Change-Id: Iaecae3c22db1f4f2309f73f8c6836e6c072b848b
2023-06-26 17:50:18 -04:00
Jorge Merlino 81c330b5d8 Add support for using service tokens
This patch configures Cinder to send a service token along with the
received user token on requests to other services. This can allow those
other services to accept the request even if the user token has been
invalidated since received by Cinder. Also with this patch Cinder will
accept request from other services with invalid user tokens but valid
service tokens. Service tokens exist since Openstack Queens.

Closes-Bug: #1992840
Change-Id: I6cb9b1cb257db0b57bd7984c795b8caa1e3b74d9
2023-05-18 12:25:19 -03:00
Jorge Merlino 739aed0a14 Sync with charm-helpers
This sync includes this patch to charm helpers:

https://github.com/juju/charm-helpers/pull/757

which is an extension of this one:

https://github.com/juju/charm-helpers/pull/740

and both are meant to include templates to configure service tokens
in juju charms as shown in this lp bug:

Related-Bug: #1992840
Change-Id: Ib273f50d620160f62cbb3d6f5789bf334a7d6333
2023-05-15 15:07:49 +00:00
Zuul 05a28c19c7 Merge "Enable jammy-antelope voting and drop kinetic-zed tests" 2023-04-14 18:35:39 +00:00
Corey Bryant 9246a92b98 Enable jammy-antelope voting and drop kinetic-zed tests
* Voting was turned on for jammy-antelope in the
  project-template for charm-functional-jobs in zosci-config
* Voting for jammy-antelope bundles with non-standard names
  is turned on in individual charms
* Kinetic-zed bundles/tests are removed

Change-Id: Ieacd818299773e3ffee55ab3f7f052e2f57dd74a
2023-03-29 21:01:47 +00:00
Zuul c0f8e970d2 Merge "Add support for HAProxy L7 checks" 2023-03-29 15:14:54 +00:00
Gabriel Cocenza 51e32a4f7e Add support for HAProxy L7 checks
This change add several configuration options to enable HTTP checks
to the HAProxy configuration, instead of the default TCP connection
checks (which continue to be the default). It also enables /healthcheck
endpoint for cinder-api on openstack releases >= ocata.

Closes-Bug: #1880610
Change-Id: I9d118f70fc1390be7b800ad20ae20e77818adac7
2023-03-29 09:48:30 -03:00
Corey Bryant 14f6801933 Add Antelope support
* sync charm-helpers to classic charms
* change openstack-origin/source default to antelope
* align testing with antelope
* add new antelope bundles
* add antelope bundles to tests.yaml
* add antelope tests to osci.yaml and .zuul.yaml
* update build-on and run-on bases

Change-Id: I57e1fec8537d95b1035aa809ab30378fb44973da
2023-03-07 20:07:52 +00:00
Zuul 70deb577f9 Merge "Add nova section for Ussuri" 2023-01-31 15:07:32 +00:00
Tiago Pasqualini e737668e2f Add nova section for Ussuri
Commit 024de37 added the nova section on cinder.conf, but placed it
on the Victoria folder. This issue is also observed on Ussuri, so
this patch moves this from Victoria to Ussuri.

Closes-Bug: #1939389
Change-Id: Ia39177d6f47ddda0b1acb27cde02ae5e74a01032
2023-01-30 14:54:18 +00:00
Trent Lloyd ceafd9f67f Fix missing assert_ prefix on called_with
test_clean_storage_unmount incorrectly used 'called_with' instead of
'assert_called_with' which just made a mock function call and didn't
check or assert that the function was actually called.

As a result this function didn't actually test anything, the expected
parameters were not correct so they have been updated.

An error to catch this accidental mistake was added in the recently
released mock 5.0.1 (https://github.com/python/cpython/issues/100690)
  AttributeError: 'called_with' is not a valid assertion.
  Use a spec for the mock if 'called_with' is meant to be an attribute.

The mock library ships in python as unittest.mock but also publishes the
latest code as the 'mock' python package so that older python versions
can get the latest code. The stable branches currently install mock
but the master branch does not, so this error does not actually appear
on master but only the <=yoga stable branches currently. The test is
however wrong either way.

Change-Id: I3076778e8fc62c086651d29abb2c5a3d9921be97
2023-01-25 13:23:37 +08:00
Trent Lloyd ba8d8fc3e1 Add identity-credentials relation support
Implement support for the identity-credentials relation as an
alternative way to get keystone credentials when we are not registering
a service endpoint via the identity-service relation.

This solves an issue where the image volume cache does not work when the
cinder volume service is deployed as a second cinder application
('cinder-volume') having enabled-services=volume set.

Previously the following items were missing from cinder.conf:
cinder_internal_tenant_project_id
cinder_internal_tenant_user_id

Resulting in the image cache not functioning with the following warnings:
Unable to get internal tenant context: Missing required config
parameters.
Unable to get Cinder internal context, will not use image-volume cache.

As there are now two possible interfaces to keystone ('identity-service'
and 'identity-credentials') any existing bundles that don't specify the
interface 'identity-service' when relating to keystone will fail to
deploy and will need to be updated.

Closes-Bug: #1978452
Change-Id: Ieef500c9c55eb3968b3e2e231a8ff6e2a5ec148d
2023-01-20 14:53:39 +08:00
Liam Young dd8a9aae8a Fix charm for tox4 compatibility
Related-Bug: 2002788
Change-Id: Id697fb2ae78af9c4e111d419b88ada2c98134f80
2023-01-16 13:40:03 +00:00
Zuul df94221404 Merge "Retry online_data_migrations until exit code 0 or 2." 2022-10-26 13:02:44 +00:00
Zuul 6ae6c1beef Merge "Review README" 2022-10-11 16:57:06 +00:00
Zuul fcdac49707 Merge "Update metadata in setup.cfg" 2022-10-11 11:11:02 +00:00
Felipe Reyes ca61c8e7fe Retry online_data_migrations until exit code 0 or 2.
The command 'cinder-manage db online_data_migrations' has three possible
exit codes:

- 0: The migrations have been completed successfully.
- 1: Some migrations have been completed, but more objects need to be
  migrated.
- 2: Some migrations are generating errors and manual intervention is
  needed.

This change will run in a loop the command online_data_migrations in
batches of 5000 objects, when the exit code is 1 runs again, when the
exit code is 0 the loop is stopped, when the exit code is 2 a
CalledProcessError exception is raised.

Change-Id: Iee99e9ab9777392f05c1a0db55951d97773bb0ba
2022-10-07 17:09:24 -03:00
Peter Matulis 07023654b9 Review README
Fix up organisation of storage backends in particular.

Make a corresponding minor change to config.yaml.

Apply README template.

Change-Id: Ic01bac2758f6659cd6cd821cb9672dd58804fdcc
2022-10-07 14:46:29 +00:00
Billy Olsen d33a2d0567 Check for online_data_migrations when syncing db
Due to bug #1908037, the database sync can fail if the volume types
have not been migrated to the __DEFAULT__ volume type. When this fails,
a message will be sent telling the user to run online_data_migrations.
Check for this error, and when it occurs, run the online_data_migrations
and then retry the db sync.

Closes-Bug: #1908037

Change-Id: I0cd9a9db256b0adffbb244222a66c85d055840c4
2022-10-06 21:27:26 -03:00
Corey Bryant 0fa3fdadd0 Ensure openstack-release package is correct after install hook
The linked bug shows the install of the charm with openstack-origin set
to zed.  This happens because configure_installation_source() causes the
openstack-release package to be installed *before* the zed cloud archive
sources are configured into /etc/apt and an apt update done. This means
that the openstack-release package says "yoga" despite the zed packages
actually being installed.

Then, on the config-changed hook, it sees that the installed version is
showing as yoga and tries to do an upgrade.  This fails, as the charm
hasn't yet bootstrapped, and the charm tries to bootstrap after
upgrading the packages.

There's a few bugs here which are exposed, but the tactical fix is to
force the openstack-release to match the installed packages.

Closes-Bug: #1989538
Change-Id: Ifc35474c98b1ffa1d7d81ac42deb897ace7db885
2022-10-05 14:46:46 +00:00
tushargite96 a4aaa2bef8 Update metadata in setup.cfg
we are using some "aliases" that the setuptools docs say 
"are supported for compatibility reasons" but their use is not advised[1].

[1] https://setuptools.pypa.io/en/latest/userguide/declarative_config.html#metadata

maintaining setup.cfg as per other repos[2]

[2] https://review.opendev.org/c/openstack/cinder-tempest-plugin/+/828475

Change-Id: I4874777e00fa87884b994b553c1849800af33e62
2022-09-26 04:23:17 +00:00
Nobuto Murata ba21da64f6 Re-enable AppArmor enforcement
Ensure tests are run with aa-profile-mode=enforce. So we should be able
to notice any future behavioral changes in the upstream or additional
rules required for nova-compute AppArmor profile in the functional
tests.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/870

Depends-Onː Id2db3a70b8d1287bda006f1bbc5442038f7070f1
Related-Bug: #1979812
Related-Bug: #1939389

Change-Id: If658d9e8ee11248ef09e774f3e21fe0f801dc066
2022-09-04 10:04:11 +09:00
Alex Kavanagh 8656303f29 Ensure that kinetic/22.10 is enabled
This patch adds kinetic to the metadata.yaml and ensures
that a run-on base for 22.10 is added in the
charmcraft.yaml

Change-Id: Ifded78d4a56769f5a298deb64360c3e6dd9afb9b
2022-08-31 19:47:04 +01:00
Corey Bryant cdc2fc738f Add Kinetic and Zed support
* sync charm-helpers to classic charms
* change openstack-origin/source default to zed
* align testing with zed
* add new zed bundles
* add zed bundles to tests.yaml
* add zed tests to osci.yaml and .zuul.yaml
* update build-on and run-on bases
* add bindep.txt for py310
* sync tox.ini and requirements.txt for ruamel
* use charmcraft_channel 2.0/stable
* drop reactive plugin overrides
* move interface/layer env vars to charmcraft.yaml

Change-Id: Ie133bc41bf789e07d4d777e128617b21d822de30
2022-08-26 18:40:29 +00:00
Gabriel Adrian Samfira 024de3783f Add nova section
Cinder sometimes needs to communicate with nova,
for example to notify VMs when live-resizing a disk.
Under certain circumstances,
the autodetected authentication details don't work,
so we must add a dedicated section in the config
for the nova client with proper credentials.

This issue has been observed on victoria and newer,
hence the addition of cinder.conf for victoria.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/776

Closes-Bug: #1939389

Co-authored-by: Samuel Walladge <samuel.walladge@canonical.com>

Change-Id: I6d44223b7c2863c6d9c62b46a41275fd360f92d1
2022-06-27 13:30:18 +09:30
Alex Kavanagh a50281db83 Stop endless cycles on openstack upgrade
If an HA cinder deployment is upgraded twice and the leadership has
changed, there is a potential race that can be triggered where because
the CINDER_DB_INIT_RKEY is different on the units that have been the
leader.  This race is that when the unit tries to decide whether it has
reflected the 'new' RKEY it sees a different one from each unit.  By
clearing the rkey, it ensures that only the relation changed event from
the leader actually causes a restart.

Change-Id: I712502a666f23421cc58925f10b7643e3482d861
Closes-Bug: #1928383
2022-05-12 12:01:40 +01:00
Zuul 1f45d8c5ae Merge "Sync charmhelpers to get fixes" 2022-04-25 12:28:34 +00:00
Zuul bc3b511544 Merge "Check if the newhost exists instead of currenthost" 2022-04-25 12:20:36 +00:00
dongdong tao 93dfc624d4 Check if the newhost exists instead of currenthost
Closes-Bug: #1956470

Signed-off-by: Dongdong Tao <dongdong.tao@canonical.com>
Change-Id: I2b9eec030a5b0f6d9a405cecea29bef04eb72f5d
2022-04-25 16:22:53 +08:00
Alex Kavanagh f5ec72dac8 Updates to enable jammy and finalise charmcraft builds
- Add 22.04 to charmcraft.yaml
- Update metadata to include jammy
- Remove impish from metadata
- Update osci.yaml to include py3.10 default job
- Modify tox.ini to remove py35,py36,py37 tox target and add py310
  target.
- ensure that the openstack-origin is yoga
- sync charmhelpers

Change-Id: I359df29fb7c86caf0c29c7f35c3e4b68392ba5ad
2022-04-06 18:43:26 +01:00
Nobuto Murata a0f44d0f90 Install ssl_ca for volume service only scenarios
The CA information is necessary to talk to Keystone or Glance from the
Cinder volume service. This is a follow-up of the following change where
the Vault certificate relations is assumed but ssl_ca wasn't addressed
at that point.
I69f15c3fd164f7114f5498d100b2832caf93fb00

Closes-Bug: #1967302
Change-Id: I4d7b3721fe7dfd6f7cdfd364d8c5bc340d38c00f
2022-04-01 10:12:58 +09:00
Edward Hope-Morley ad08fb62e2 Sync charmhelpers to get fixes
Change-Id: Id4ea5c5258d467b4eae1345721f1750ebfca2483
Related-Bug: #1965967
2022-03-28 11:32:49 +01:00
Alex Kavanagh 8903fdca5e Update to classic charms to build using charmcraft in CI
This update is to ensure that the Zuul Canonical CI builds the charm
before functional tests and ensure that that artifact is used for the
functional tests.  This is to try to ensure that the charm that gets
landed to the charmhub is the same charm that was tested with.

Change-Id: Ic7cf54d7669219f4a42e08c8a1e2adb786a16af6
2022-02-17 12:30:05 -05:00
Alex Kavanagh 7c551e4dfa Migrate charm to charmhub latest/edge track
Change-Id: Ida0ad9ac927de7ed8f9206521014404b38187cd6
Co-authored-by: Aurelien Lourot <aurelien.lourot@canonical.com>
2022-02-01 12:52:13 +01:00
Samuel Walladge 7f97a6d30e Add support to configure scheduler_default_filters
Add new config option: `scheduler-default-filters`.
This is unset by default, so cinder retains the default value for
scheduler_default_filters.

Closes-Bug: #1956727
Change-Id: I9777bf8fe5ddbb69689db60c2790e8a4be57e1ab
2022-01-25 11:04:40 +10:30
Hervé Beraud 77fdcf3e27 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: I538b5c2a9df4de66c9874e65247496e54c0522e8
2021-12-15 10:56:43 +00:00
Nobuto Murata bde329d973 Make sure iscsid has a unique InitiatorName
os_brick may require InitiatorName in /etc/iscsi/initiatorname.iscsi
before iscsid is invoked via iscsid.socket with iscsiadm. Cloud images
including MAAS ones have "GenerateName=yes" instead of "InitiatorName="
on purpose not to clone the initiator name. Let's initialize it so
Cinder units can be fully ready to accept iSCSI based subordinate and
storage backend charms.

Closes-Bug: 1825809
Change-Id: I413bbb29dd609e0c86ac3691556f37a9fcc13439
2021-12-01 12:17:49 +09:00
Corey Bryant bc48c60f1c Drop creation of v2 endpoint from OpenStack Xena+
In this patch we drop creation of the v2 volume endpoint for
OpenStack Xena onward. Upstream cinder removed the block storage
v2 API in commit e05b261a "Remove Block Storage API v2".

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/670
Depends-On: https://review.opendev.org/c/openstack/charm-cinder/+/816007
Closes-Bug: #1947387
Change-Id: Ie553a53f794f2cdd262bf77364e6374244844b92
2021-11-22 09:18:02 -05:00