Commit Graph

1063 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
James Vaughn 6c1efee2d0 Add aggregate filtering and isolation options
Add limit-tenants-to-placement-aggregate,
placement-aggregate-required-for-tenants and
enable-isolated-aggregate-filtering options.

Closes-Bug: #1920982
Change-Id: Ibbb0e412d1a821cdb56e447ca88b91afca50c8c6
2021-11-29 10:34:26 +09:00
Paul Goins aac2c2a178 Sharing SSH pubkeys across nova-compute apps
SSH keys from nova-compute are now shared across all
nova-compute charm apps.

Closes-Bug: #1468871
Change-Id: Ia142eceff56bb763fcca8ddf5b74b83f84bf3539
2021-11-03 11:59:46 +00:00
Rodrigo Barbieri 1a63d9c0b6 Fix ssh keys duplication
Upon running hooks that update ssh_keys, they
end up duplicated in the /etc/nova/compute_ssh/* files
and cloud-compute relations because the code that
checks whether the keys already exist are currently
not working.

This change fixes the deduplication code and improves
unit tests, while also handling a special case for
specific ubuntu-version scenarios.

Change-Id: I93f9418d5340e7cb599a42970d78557362c1542f
Closes-bug: #1943753
2021-10-06 13:07:33 +00:00
Zuul b2fe2601c9 Merge "Drop placement endpoints from relation in train+" 2021-08-26 13:06:58 +00:00
Brett Milford eeac5fca96 Expose *_allocation_ratio config
This commit exposes allocation ratio configuration via the cloud-compute
relation for backwards compatiable behaviour of the charms when
configuration of allocation ratios is delegated to nova-compute.

Closes-Bug: #1677223
Change-Id: I5a6bd1fa06d06dfd3e49182cc72ad83025429b13
2021-07-29 11:44:15 +00:00
Billy Olsen 231a0f1459 Drop placement endpoints from relation in train+
When a cloud is deployed earlier than the Train release, the placement
service is provided by nova-cloud-controller. As part of an upgrade to
Train, the new placement service is added and updates the placement
endpoint in the service catalog. The nova-cloud-controller charm no
longer advertises the placement service URL, but because the data
exists on the relation until removed, the service catalog changes the
placement URL to the placement endpoints advertised from
nova-cloud-controller.

Fix this by explicitly removing the placement service URLs when the
placement service is not provided by nova-cloud-controller.

Change-Id: Ibb3b1429820a4188fe3d2c1142c295c0de4ee24e
Closes-Bug: #1928992
2021-07-27 11:23:59 -07:00
Zuul 179930d364 Merge "Set cross_az_attach setting on cloud-compute relation" 2021-06-08 06:56:33 +00:00
Ionut Balutoiu b56572cf6b Add sync-compute-availability-zones Juju action
This action should be used to sync the Juju availability zones,
from the nova-compute units, with the OpenStack availability zones.
The action is meant to be used post-deployment by the operator.

It will setup OpenStack aggregates for each availability zone, and
add the proper compute hosts to them.

Co-Authored-By: Billy Olsen <billy.olsen@canonical.com>
Change-Id: Ibd71cd61e51b04599eadf21b3ef46e47544b8814
2021-04-22 19:54:36 -07:00
Billy Olsen 198c9e7d6e Set cross_az_attach setting on cloud-compute relation
Communicate to compute services the cross_az_attach config setting.
Since the cross_az_attach setting needs to be applied at the compute
node, update the relation settings to specify the cross_az_attach
policy configured.

Change-Id: I71e97453453d5d091449caf547e68c6455d091cf
Closes-Bug: #1899084
2021-04-13 11:38:56 -07:00
Aurelien Lourot bd3e24f359 Fix for not passing CA cert to nova-compute
The charm looked for `keystone_juju_ca_cert` on disk
instead of
`/usr/local/share/ca-certificates/keystone_juju_ca_cert.crt`

Synced charm-helpers for
https://github.com/juju/charm-helpers/pull/570

Change-Id: Ib7cfdadc3a75fca951792ef2c2e2b454b1ad021d
Closes-Bug: #1915504
2021-02-16 14:45:03 +01:00
Frode Nordahl 93efd6e81d
Fix CA certificate on cloud-compute relation
Note that part of this fix belongs in c-h, but let's add it here
as a tactical measure given we are practically frozen.

Enable TLS in the functional test for focal-ussuri and onwards.

Also switch to focal-ussuri as target for smoke.

Drop Trusty/Mitaka as it currently does not pass with symptoms
like https://bugs.launchpad.net/charm-nova-compute/+bug/1861094

Closes-Bug: #1911902
Change-Id: I7b12479ce3afb94a0fb21c26b1ac78736b81aba2
2021-01-18 13:57:24 +01:00
Alex Kavanagh 6c5a5cdff3 Ensure user is aware upgrade has not happened w/ train
There is a 'hole' in the user experience where if you try to
openstack-upgrade from stein to train but have no already related
placement to the nova-cc unit, then the openstack upgrade is aborted and
a workload message indicates that the relation is needed.

However, if you then subsequently add the placement relation, the
warning goes away, but the payload is not upgraded to match the
openstack-origin value.

This patch adds a warning if the openstack-origin is for train, the
payload is stein, the action-managed-upgrade is false and the placement
relation is made; i.e. that the operator fell into the above hole.

Change-Id: I360f2d72cad374c31ee766065af682e2fa6218d1
Closes-Bug: #1910276
2021-01-11 14:10:09 +00:00
Zuul c5f420331d Merge "Wait before restarting services after ep change" 2020-10-02 15:36:35 +00:00
Liam Young 7d7c86c600 Wait before restarting services after ep change
If an ep change trigger is recieved then also look for the
catalog_ttl key on the relation. If it is present then wait for
that long before restarting services, this allows stale ep
entries to expire from the catalogue before restarting.

Change-Id: Ief2fa8286d9fa8058b7a012ec719776c4dd302f5
2020-10-02 14:32:18 +00:00
Zuul 2ff7d726a0 Merge "Drop RetryFilter in Victoria inline with upstream" 2020-10-01 20:26:25 +00:00
Alex Kavanagh 1beb8444b4 Sync libraries & common files prior to freeze
* charm-helpers sync for classic charms
* charms.ceph sync for ceph charms
* rebuild for reactive charms
* sync tox.ini files as needed
* sync requirements.txt files to sync to standard

Change-Id: Ie7640826be5426157c57877348cef43ab6067543
2020-09-28 09:37:24 +01:00
Corey Bryant 2205b650f4 Drop RetryFilter in Victoria inline with upstream
Change-Id: I77a25831efc409ec15aee91a1ca2cbec2a526e39
Closes-Bug: #1897331
2020-09-25 19:04:49 +00:00
Zuul d40b5cec8c Merge "Ensure cell0 updated on db/amqp change" 2020-09-09 20:31:20 +00:00
Corey Bryant 7983d1aaa9 Ensure cell0 updated on db/amqp change
Prior to this change, cell1 was updated when there was a database
or rabbitmq-server relation change, but cell0 wasn't. Ensure that
cell0 is also updated.

Change-Id: I670d0295ea339b21166ef7b18509b04a5beaa959
Closes-Bug: #1892904
2020-09-09 01:18:44 +00:00
Andrea Ieri 1bf5a92832 Make disabling build_failure_weight_multiplier optional.
This commit introduces a new charm option allowing operators to override
the hardcoded 0.0 that disabled hypervisor demotion on build failures
from pike onward.

In certain environments it may be preferable to retain the upstream
behavior of letting the scheduler work around malfunctional computes and
favor instance building reliability at the cost of a potentially uneven
load distribution.

Change-Id: I2faa5ab8cd505a9d61a9fa26e1b08d16b0c795fb
Closes-Bug: 1892934
2020-08-28 09:53:44 -04:00
James Page f0095ffcbb Use public endpoint binding for console cert and key
Ensure that the public endpoint binding is used to resolve the
path to the SSL certificate and key files as the base access
URL for console access is always via this binding.

Add unit tests to cover the InstanceConsoleContext class.

Change-Id: I27de9445d249b0d670543d250bd02f450764a10f
Closes-Bug: 1871428
2020-07-22 10:10:15 +01:00
David Ames 86bb59ec3e Specify port for mysql connection
Change-Id: I35cadeed547e669bc68a380dbf50929e304b697c
2020-05-05 16:16:52 -07:00
Hemanth Nakkina b5b6966f6d Add new config option to set [quota].count_usage_from_placement
New config option count_usage_from_placement is added in Nova from
Train release to enable/disable counting of quota usage from placement
service. Corresponding config parameter is required in nova-cloud-controller
charm.

This patch introduces quota-count-usage-from-placement config parameter in
nova-cloud-controller charm. For openstack releases train or above, this
option is rendered in nova.conf for nova-cloud-controller units.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/250
Change-Id: I57b9335b7b6aecb8610a66a59cb2e4e506e76a5e
Closes-Bug: #1864859
2020-04-28 18:07:21 +05:30
Chris MacNaughton 65ed6620c7 We cannot talk to the database during maintenance
Change-Id: Ie0d58c3f11b34d5fd6354c3f2130e8618e49b915
Closes-Bug: #1871647
2020-04-08 16:30:16 +02:00
James Page 24531f5c28 Enable hardware offload support
Enable PCI Passthrough Filter if neutron-api charm has enabled
support for hardware offloading.

Change-Id: I0ccb4366b03557b316da1507015112c7f378176e
Depends-On: I1f59012ad2d16af18ca310906f6c6b537bb7ec72
2020-03-18 10:30:17 +00:00
Zuul bb3600879f Merge "Adding support for cross_az_attach config option." 2020-03-16 11:16:53 +00:00
Liam Young b53c597b15 Do not run db updates if db is in maintenance mode
As witih the shared-db hook do not run db updates if the database
is in maintenace mode

Closes-Bug: #1866864
Change-Id: I65619271d8a4215c8d9bf68ad0a86136ad87011c
2020-03-11 07:18:06 +00:00
Vladimir Grevtsev ab6398463a Adding support for cross_az_attach config option.
Allow attach between instance and volume in different
availability zones. If False, volumes attached to an
instance must be in the same availability zone
in Cinder as the instance availability zone in Nova.

Change-Id: I21df8e0dfa585133c5ef6a55cdbbc2071c267424
Closes-Bug: #1856776
2020-03-09 14:41:00 +03:00
David Ames 6e3aacb08f Do not mask services on db departed
Currently the charm masks all services on db departed. The consequence
of which is that when a db relation is re-joined these services are not
started back up.

In addition, it stops all services, including memcached and haproxy,
which also do not get restarted on a db re-join.

This change selectively stops but does not mask services that pertain
directly to nova. So that on db joined the correct services get started.

Change-Id: I81f59c97b33edd5c3e67c379cfdee8f26509075a
2020-02-25 18:24:36 +00:00
Liam Young 335b67c66a Watch & react to placement and neutron ep changes.
Request to be informed of changes to placement and neutron changes.
If a placement change occurs restart nova-scheduler as it will
cache the old endpoint url and tell nova-compute to restart its
services as they will have done the same.

Change-Id: I7537723e40a5a25672fbbdc2d5c3144724f6240a
Closes-Bug: #1862974
2020-02-18 12:16:49 +00:00
Zuul adcbd7b28c Merge "Disable Apache port 80" 2020-01-31 15:52:57 +00:00
Liam Young 90ecd0f771 Do not access DB when it is in maintenance mode.
If the database is in maintenace mode do not attempt to access
it.

Depends-On: I5d8ed7d3935db5568c50f8d585e37a4d0cc6914f
Change-Id: I7d5b7a20573b38d12b1ead708ee446472f21e9f8
2020-01-30 12:37:49 +00:00