Commit Graph

1699 Commits

Author SHA1 Message Date
Alex Kavanagh 007f302ed6 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: I6f8bd495a2078b5683a05a63124d7902d0a86f74
2024-02-24 19:57:42 +00:00
Edward Hope-Morley 05b081bf5f Ensure mgmt network hostname and fqdn in known_hosts
The cloud-compute relation uses the private-address setting to
reflect the hostname/address to be used for vm migrations. This
can be the default management network or an alternate one. When
this charm populates ssh known_hosts entries for compute hosts
it needs to ensure hostname, address and fqdn for the mgmt network
is included so that Nova resize operations can work if they use
the hostname from the db (which will always be from the mgmt
network).

Change-Id: Ic9e4657453d8f53d1ecbee23475c7b11549ebc14
Closes-Bug: #1969971
2023-12-02 15:56:06 +00:00
Felipe Reyes b915f8e6f8 Use wss protocol when SSL enabled
This patch checks if HTTPS configuration is enabled in Apache to
determine if the websocket protocol should switch from 'ws' to 'wss' or
not.

Change-Id: I738652373604966b6df079e45a0ad26c83e21688
Closes-Bug: #2039490
2023-10-26 18:09:35 -03:00
Alex Kavanagh 3d237a44ec 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: I25df688c9ec07168b825815b1e1c27ecf2673d2b
2023-10-24 14:49:41 +01:00
Zuul f022edc81f Merge "Drop AvailabilityZoneFilter inline with upstream removal" 2023-10-02 21:36:03 +00:00
Corey Bryant 5cf66c87c7 Drop AvailabilityZoneFilter inline with upstream removal
The was removed from upstream nova in the 2023.2 cycle
via commit 5edd805fe2395f35ecdfe5b589a51dc00565852f.

The nova release note states:

The ``AvailabilityZoneFilter`` was deprecated for removal
in 24.0.0 (Xena) and has now been removed.
The functionality of the``AvailabilityZoneFilter`` has been
replaced by the``map_az_to_placement_aggregate`` pre-filter.
The  pre-filter was introduced in 18.0.0 (Rocky) and enabled
by default in 24.0.0 (Xena). This pre-filter is now always
enabled and the ``[scheduler] query_placement_for_availability_zone``
config option has been removed.

This change also syncs the charm-helpers change from:
https://github.com/juju/charm-helpers/pull/850

Closes-Bug: #2037751
Closes-Bug: #2036766
Change-Id: I315900a7e32ec66b27fa69961e9b7dcb9fa1f949
2023-09-29 19:21:36 +00:00
Zuul bab1e0e3c7 Merge "Add new interface 'dashboard'" 2023-09-27 13:54:21 +00:00
Felipe Reyes 816ee80cd0 Add new interface 'dashboard'
This new interface consumes information exposed by openstack-dashboard
to correctly configure nova-serialproxy and allow requests coming from
the web browser that tries to load the serial console.

Change-Id: I2d82abffb9649f16a792f180806cea36cc5e25df
Closes-Bug: #2030094
2023-09-21 10:17:36 -03:00
Jadon Naas 98581a04d5 Update default Keystone api_version
This change moves the default return value for the Keystone api_version
 to 3.0 instead of 2.0. By this point in time, all supported OpenStack
  releases use Keystone API version 3.0 instead of 2.0.
 This was previously causing Nova templates to render with 2.0 in the
 Keystone auth URL instead of 3.0, which caused auth failures.

Closes-Bug: 1995778
Change-Id: I6463a24fe4aaa654a58cff56720a55f0950db717
2023-09-19 17:28:26 -04:00
zhhuabj e0d3b6a365 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: I85d48b646b3d0778aae3a7dd3942ad45b4af002d
2023-09-04 18:15:31 +08:00
Zuul b58f88263f Merge "Ensure get_requests_for_local_unit doesn't fail on incomplete relation" 2023-08-16 15:59:48 +00:00
Alex Kavanagh 912d2bed51 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: Ifb8dd875065af94e6aa1b2433638ea52b410b72f
2023-08-04 18:48:46 +01:00
Corey Bryant 3ace19e601 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: I6886c96797784c3b98b965ebe1b4a99de22d84a0
2023-08-02 14:16:54 -04:00
Jadon Naas 636c9e3598 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: I76332eb6f80b494015d461cf968604fe795b16f1
2023-07-11 15:27:50 -04:00
Corey Bryant 1c1ab7658e 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: I3a5f61c39ce1d3f663f5f5c9d9f4ac19d1fc6886
2023-07-05 16:01:19 -04:00
Felipe Reyes fd810f9afd Add support for using service tokens
This patch configures nova-cloud-controller to send a service token
along with the received user token on requests sent to other services.
This allows those other services to accept the request even if the user
token has been invalidated since received by the nova services running
in nova-cloud-controller units, the same applies for incoming requests
from other services. Service tokens exist since Openstack Queens.

Change-Id: I95021600da8af12cb75ef5681fb5af8780ade4f8
Closes-Bug: #1992840
2023-05-18 22:32:51 -04:00
Jorge Merlino 9adc198f74 Sync with charm-helpers
This sync includes these patches to charm helpers:

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

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

Related-Bug: #1992840
Change-Id: I31e95e227f82a4049d5f639516ed4ef5ef52d354
2023-05-18 16:24:06 -03:00
Felipe Reyes 366df4c07e Update nova relations data on ha-relation-changed
When taking the nova-cloud-controller from single unit to full HA by
increasing the number of units from 1 to 3 and relating it to hacluster,
the data set on the cloud-compute relation is not updated, because the
update_nova_relation() function is only called on
cloud-compute-relation-joined and config-changed, none of these hooks
are executed when scaling out the application.

This patch introduces a call to update_nova_relation() on
ha-relation-changed.

Test case on an environment deployed with a single unit of
nova-cloud-controller:

    export NOVA_CC_VIP=10.0.0.11
    juju config nova-cloud-controller vip=$NOVA_CC_VIP
    juju deploy --series jammy --channel 2.4/stable hacluster \
        nova-cloud-controller-hacluster
    juju add-unit -n 2 nova-cloud-controller
    juju deploy --series jammy memcached
    juju add-relation memcached nova-cloud-controller
    juju add-relation nova-cloud-controller nova-cloud-controller-hacluster

Change-Id: Ib08bf9b6e1ce2b69be4d99ffe0726b59d81f4bc9
Closes-Bug: #2002154
2023-04-24 21:22:22 -04:00
Zuul 09928ae295 Merge "Enable jammy-antelope voting and drop kinetic-zed tests" 2023-04-14 22:58:54 +00:00
Zuul 00fad27866 Merge "Update unittests" 2023-03-31 14:52:32 +00:00
Corey Bryant 0d34b8725d 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: I367b12d6919747d987f30020575a467f1c473fef
2023-03-29 21:01:50 +00:00
Zuul fb0a570ad1 Merge "Add support for HAProxy L7 checks" 2023-03-29 15:11:24 +00:00
Gabriel Cocenza 468d648655 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.

Closes-Bug: #1880610
Change-Id: I4a947c5b52eb3283c08a0d39cc9bf14695a63eab
2023-03-29 09:44:24 -03:00
Felipe Reyes 89b94fe7f5 Update unittests
Drop the use of the pattern "self.assertTrue([...].called)" in favor
"[...].assert_called()"

Change-Id: I6546623d043c4bde14b8532fa9125f8a12db280d
2023-03-22 15:27:36 -03:00
Felipe Reyes d3f30c4d8f Fix unittest
- Replace ".has_calls(...)" with ".assert_has_calls(...)"
- Use "self.Client()" instead of "self.Client", because otherwise the
  wrong mock object is tested.

Related-Bug: #2012108
Change-Id: I8649ba727a75c8dcb86404ed4c3def12e0fdda01
2023-03-22 15:06:52 -03:00
Corey Bryant 05efc621c4 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: I70cadc739d692cf442aef8012477e89a9601c06f
2023-03-07 20:07:40 +00:00
Liam Young 83b866eaac Fix charm for tox4 compatibility
Related-Bug: 2002788
Change-Id: I716fb1056d5e603a9e0e6414fa46df5b4ae1031d
2023-01-17 17:50:03 +00:00
Alex Kavanagh 1d06b80c8d ch-sync: IndentityServiceContext app data fixes
The IdentityServiceContext was recently updated to add the application
data bag. Unfortunately, they keystone charm uses both the regular
relation data primarily, but the updates for endpoints are on both the
application database and the regular relation data. The
IdentityServiceContext used the app data bag exclusively if there were
any keys available, which leads to it ignoring the existing relation
data entirely; this results in 'identity relation not ready' with
missing data items.

charm-helpers is patched at [1] to solve the issue and this is a
charm-helpers sync that includes that patch.  This changes the
functionality of the IdentityServiceContext so that it preferentially
selects keys from the application data bag unless they are None, in
which case it tries for those keys on the existing relation data. e.g.
it will stitch the two relations together with the app data bag taking
priority. This allows the nova-cloud-controller charm to correctly
access the identity relation data and form a complete context.

[1] https://github.com/juju/charm-helpers/pull/746

Change-Id: Ic868213c6bb42bc2a28ad25a2f7344a28ab9f04d
2022-11-03 16:02:51 +01:00
Alex Kavanagh 007f9e33b0 In nova_cc_utils.py:resolve_hosts_for: .append -> .add
The method was refactored (in part) to use sets to enforce uniqueness of
the hosts.  Unfortunately, a list method (.append()) slipped through
that should have been converted to .add(). This fixes that error.

Change-Id: I248430cd1a9156efab745fe110a39441b503b3a5
Closes-Bug: #1992789
2022-10-17 11:12:44 +01:00
Corey Bryant abb8ee551c 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: Icdef04e25e74c0a18fd49997c5f5b0540d583f40
2022-10-04 19:37:47 +00:00
Alex Kavanagh 82c441de07 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: I64af53fe6a37d1dcc8e7f9fcbc887367b9c21eea
2022-08-31 20:27:20 +01:00
Corey Bryant f9206facde 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: I8f2c34f3a4a0601ee19aa694b323cc0f9ee65616
2022-08-26 18:40:41 +00:00
Felipe Reyes 43848ce1fc charm-helpers sync.
This sync is needed to bring in 2 fixes:

- python 3.10 (collections.abc.Iterable).
- Handle NoNameservers exception in ns_query().

Change-Id: I0b965b47b814e99d484682d7c90dcd60dd810ae7
2022-04-22 10:00:06 -04:00
Billy Olsen b13eaf757f Restart nova-conductor on endpoint changes
The charm looks for endpoint changes and restarts the nova-scheduler
when the endpoint changes. However, the nova-conductor also needs to be
restarted in order to pick up new endpoints.

Closes-Bug: 1968708

Change-Id: I18dee4eb46bd836805e60427c0afc508e2489111
2022-04-20 19:23:27 -07:00
Alex Kavanagh 77992a5a48 charmhelpers sync for yoga release
Change-Id: I230b814a9944d4dab15aeb020504df3170a1978f
2022-04-07 12:26:30 +01:00
Alex Kavanagh 97f0144739 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

Change-Id: Ia0cdf927a4d4d2339ca1739066bf9a965c97d190
2022-04-06 10:54:36 +01:00
Edward Hope-Morley f501a36bc9 Sync charmhelpers to get fixes
Change-Id: I40d3827949caf36b9d019985802e97806d91c025
Related-Bug: #1965967
2022-03-28 11:35:49 +01:00
Zuul f55776445f Merge "Expose max_local_block_devices as an explicit charm option" 2022-03-11 08:41:05 +00:00
Alex Kavanagh e63c68d505 Fix bug where str is added to cached_hostset list
The original code was appending a str to a list rather than either
appending it or adding it as a list of one element.  The code avoids
append to avoid unintentional side-effects.

Change-Id: I1466981f1d68f8dea3bbe32fdde6c4825056c0d0
Closes-Bug: #1927698
2022-03-07 14:46:57 +00:00
Zuul 0369f55efa Merge "Add scheduler-max-attempts flag" 2022-03-03 09:14:55 +00:00
Arif Ali cdaa255120
Add scheduler-max-attempts flag
Using affinity/anti-affinity policies sometimes we get into a race
condition on the resources that are available on the hypervisors.
This flag allows to increase the number of retries and hence hosts
to schedule on and therefore allowing the successful scheduling
of instances.

This option was taken from the following URL, while future work
with placement is done to help with scheduling with affinity

https://docs.openstack.org/nova/latest/admin/troubleshooting/affinity-policy-violated.html

Signed-off-by: Arif Ali <arif.ali@canonical.com>
Change-Id: I353dbaa38eb0526014888ede27702b428eb66afd
2022-02-22 11:15:53 +00:00
Nobuto Murata 0e9136fe1e Expose max_local_block_devices as an explicit charm option
It's useful to force instance creations to fail if ephemeral drives are
requested when cloud admins want users to use persistent volumes always.

Closes-Bug: #1953561
Change-Id: I1c958b4bcf79512c06de6d81fe55c681bb5f38a7
2022-02-21 22:28:40 +09:00
Alex Kavanagh 1c7f320cb6 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: I7c695c77c67f43f02c72c3b50d949c451be53bc3
2022-02-19 15:17:08 -07:00
Marcin Wilk 690d1d190c Allow resizing to the same host
By default resizing an instance to the same host as the source is
not enabled. This change adds new charm config option that maps
directly to the nova.conf setting which effectively gives a user
possibility to enable/disable this functionality.

Closes-Bug: #1946620
Change-Id: I13d0c332cd0b110344b7a1645e3e4fd250fce33a
2022-02-11 15:46:56 +00:00
Zuul 4f1665cbfa Merge "Remove nrpe check of nova-consoleauth when not needed." 2022-02-03 14:09:26 +00:00
Alex Kavanagh edbb0ff0a2 Migrate charm to charmhub latest/edge track
Change-Id: If8e32b398183c0ef28346dc1c40fed6167f5d15f
Co-authored-by: Aurelien Lourot <aurelien.lourot@canonical.com>
2022-01-28 17:16:01 +01:00
Felipe Reyes bebed44c3b Remove nrpe check of nova-consoleauth when not needed.
nova-consoleauth was removed for OpenStack >= Train, this change will
remove the nrpe check associated with it when is_consoleauth_enabled()
returns False.

Change-Id: I891634fc8001597089312801b29a80336543f5f0
Closes-Bug: #1904650
2022-01-06 12:04:58 -03:00
Zuul 68a124df5d Merge "Drop default cpu-allocation-ratio to 2:1." 2021-12-17 11:39:54 +00:00
Hervé Beraud 71bc319326 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: Id925078c5c04c2f89a570bdf7171c666839f9e40
2021-12-15 14:16:56 +00:00
Zuul 1e69076af6 Merge "Remove sync AZ test from queens" 2021-11-29 16:20:18 +00:00