juju / charm-helpers

Apache License 2.0
18 stars 127 forks source link

OpenStack apps go into the error state if the 'openstack-origin' config option is set to 'ussuri' #863

Open wilkmar opened 10 months ago

wilkmar commented 10 months ago

According to [1] OpenStack charms should support simplified openstack-origin value maching OpenStack release name, for example: 'ussuri'

I tried that for cinder and glance charms and it seems not to work properly. Starting point: recent charm versions from the ussuri/stable channel:

juju status cinder glance
Model    Controller  Cloud/Region  Version  SLA          Timestamp
ussuri1  juju-maas   maas/default  2.9.44   unsupported  15:53:26+02:00

App                  Version  Status  Scale  Charm         Channel        Rev  Exposed  Message
cinder               16.4.2   active      1  cinder        ussuri/stable  660  no       Unit is ready
cinder-mysql-router  8.0.34   active      1  mysql-router  8.0/stable     111  no       Unit is ready
glance               20.2.0   active      1  glance        ussuri/stable  589  no       Unit is ready
glance-mysql-router  8.0.34   active      1  mysql-router  8.0/stable     111  no       Unit is ready

Unit                      Workload  Agent  Machine  Public address  Ports     Message
cinder/0*                 active    idle   0/lxd/0  10.10.10.68     8776/tcp  Unit is ready
  cinder-mysql-router/0*  active    idle            10.10.10.68               Unit is ready
glance/0*                 active    idle   0/lxd/1  10.10.10.71     9292/tcp  Unit is ready
  glance-mysql-router/0*  active    idle            10.10.10.71               Unit is ready

openstack-origin config is set to 'distro' After changing it to 'ussuri'

juju config glance openstack-origin=ussuri
juju config cinder openstack-origin=ussuri

both applications go in the the error state due to the following:

juju debug-log -i glance/0 -n 5
unit-glance-0: 16:52:31 WARNING unit.glance/0.juju-log Package openstack-release has no installation candidate.
unit-glance-0: 16:52:31 ERROR unit.glance/0.juju-log FATAL ERROR: Could not derive OpenStack version for codename: None
unit-glance-0: 16:52:31 ERROR juju.worker.uniter.operation hook "config-changed" (via explicit, bespoke hook script) failed: exit status 1
unit-glance-0: 16:52:31 INFO juju.worker.uniter awaiting error resolution for "config-changed" hook

juju debug-log -i cinder/0 -n 5
unit-cinder-0: 16:54:59 INFO unit.cinder/0.juju-log [cinder] pvscan:   No matching physical volumes found
unit-cinder-0: 16:54:59 WARNING unit.cinder/0.juju-log Package openstack-release has no installation candidate.
unit-cinder-0: 16:55:00 ERROR unit.cinder/0.juju-log FATAL ERROR: Could not derive OpenStack version for codename: None
unit-cinder-0: 16:55:00 ERROR juju.worker.uniter.operation hook "config-changed" (via explicit, bespoke hook script) failed: exit status 1
unit-cinder-0: 16:55:00 INFO juju.worker.uniter awaiting error resolution for "config-changed" hook

I think this is related to the fact that [2] returns None (the 'codename' variable is None) and this is because the get_os_codename_install_source(src) function [3] is not prepared for getting 'ussuri' as a parameter.

[1] https://docs.openstack.org/charm-guide/latest/concepts/software-sources.html [2] https://github.com/juju/charm-helpers/blob/stable/ussuri/charmhelpers/contrib/openstack/utils.py#L389C47-L389C50 [3] https://github.com/juju/charm-helpers/blob/stable/ussuri/charmhelpers/contrib/openstack/utils.py#L359

Kind regards, Marcin