re-installation does not restore them.
Implemented a unit test function for the above
scenario.
Call apt_update from upgrade_charm().
Closes-Bug: #2042792
Change-Id: I57c5fa293b421483b0879f24ddac260e47c7cbef
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: I7b0d02c915e2f7ae1d6d86cd829895530643de45
Added configuration for injecting default image properties using the
interoperable image import process. This change adds 1 configuration
option to the charm:
- 'custom-import-properties' to specify the desired custom properties
Note: current glance docs example shows incorrect quoting, the
implemented format in this change (no quotes) is correct. Docs fix
in: https://review.opendev.org/c/openstack/glance/+/890423
Release note: https://review.opendev.org/c/openstack/charm-guide/+/891010
Closes-Bug: 1994053
Related-Bug: 2028895
Change-Id: I9548c90e663285c6e7a70eebc8c135a5568974bc
Glance Registry has been deprecated in Stein release.
Leftover configuration files can still be read and
configure wrong settings, breaking deployment.
Closes-Bug: 1979090
Change-Id: I54b72aef0fd49b036cf1783ef9887fa9243c93f8
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)
Closes-Bug: #1880610
Change-Id: I81d7fd67029dd5025f95b41d788b03ce4b6038bb
Create new glance_api.conf template from Ussuri release to
use default_backend and enabled_backends configuration
parameters instead of deprecated stores, default_store
parameters.
Add new config option cinder-volume-types to specify the
volume types in cinder that can be used to store glance
images.
Add logic to update cinder in glance-api configurations
if cinder-volume-service relation is joined.
Also add two flags, cinder_http_retries and
cinder_state_transition_timeout
Closes-Bug: #1905042
Change-Id: Ife649defc9b765b433d7973ab31778f9cb1efdd9
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: I3286f03d977e6f602f0f50dac0646534d1d6f305
This is a follow-up change on Id2e9d4351513341b5ee41fa8a8d677aca6580fca
Instead of relying users to set expose-image-locations=false which is
error prone, disable expose_image_locations from the charm side whenever
S3 backend is enabled not to expose credentials.
Closes-Bug: 1935743
Change-Id: Iac0f27418eec6c818df8cc3fa1c133db38d26069
S3 backend has been available (again) since Ussuri in the upstream
Glance. We will enable the backend with config options for an external
S3 storage information.
Co-authored-by: Connor Chamberlain <connor.chamberlain@canonical.com>
Co-authored-by: Vladimir Grevtsev <vladimir.grevtsev@canonical.com>
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/574
Closes-Bug: #1919338
Change-Id: Id76a74cc6041b9c3364399254681138475f19935
The `CONFIGS.write(GLANCE_SWIFT_CONF)` is missing in the object-store
hook. This config file is used when the `swift` backend is enabled.
This bug is only encountered on some deployments, because there are multiple
places where `CONFIGS.write_all()` is called.
If the `object-store` relation is established, and another hook calls
`CONFIGS.write_all()`, this problem wouldn't reproduce. However, if
`object-store` relation is executed last, this issue will pop up.
Closes-Bug: #1915300
Change-Id: Ie52b18fc4dc637dbeec5ecfb8d5930a24c5f72cf
When assessing the charms status check that the current
ceph broker request has been complete. If it has not
put the charm in a 'waiting' state and update the status
message.
Change-Id: I779b6933242ce88cb1577ae11ca258b96ec46b38
Closes-Bug: #1899918
Adds multi-backend support to Glance. Currently supported backends
are local, Swift and RBD. The order of preference for default backend
is RBD --> Swift --> Local. Backend can be selected explicitly by the
operator when creating an image.
Change-Id: I78ecad0e8e12fc1ff7d716b7e43d84ca4d5b0ee1
Add standard configuration options for erasure coded pool
creation and profile configuration.
Update ceph relation joined handled to support erasure
coded pools - a replicated pool is created at 1% of the
total data weight alongside the erasure coding profile and
supporting erasure coded data pool.
Update ceph context to use the metadata pool name in the
glance configuration files when erasure-coded pool-type
is configured.
Resync charmhelpers to update Ceph Broker request support
for erasure coding.
Change-Id: If4a31a2adf8080af66885adb970fbb3cdd82f573
Depends-On: Iec4de19f7b39f0b08158d96c5cc1561b40aefa10
Allow the rbd pool name to be set via config. This brings glance
inline with other openstack ceph clients such as cinder.
Change-Id: I93b28c1b1276cca73348fd421024ef3ce0241258
Glance (in ussuri) uses policy-in-code, and so that policy.json file
doesn't ship with the package. This means that the charm can't rely on
the file existing ussuri onwards. This patchset changes the way the
charm uses policy.json by switching it to a charm determined policy.yaml
file (preferred format) with the only 3 options that the charm
determines to enforce.
Also add yaml vars to focal-ussuri bundle
This brings it into line with the other charms that are part of the the
enable-focal topic. This makes it easier to add a new bundle just by
changing a couple of variables.
Closes-Bug: #1872996
Change-Id: I47f19272a4e0af3781843608b76304ce8ba1e2b8
As of OpenStack Ussuri, Glance has removed policy.json in favor
of using default policy in code. In order to continue supporting
the restrict-image-location-operations config option, a minimal
policy.json template is rendered for Ussuri and above. This allows
update_image_location_policy() to continue making modifications
to get_image_location, set_image_location, and delete_image_location
policy.
Change-Id: I7e3693ffda01d6a6269e771ecfd232ad2c87ce74
If the database is in maintenace mode do not attempt to access
it.
Depends-On: I5d8ed7d3935db5568c50f8d585e37a4d0cc6914f
Change-Id: I9550452e78608589592265fca9549a51c88d65bc
Currently, Apache ports.conf file is not being configured by this
charm. This patch changes the ports.conf default file with another one
that does not open port 80 on SSL environments.
Change-Id: I3f8eb69813058a9291540634ad262bfdaa7b8731
Closes-bug: #1845665
When resuming services exclude those managed by hacluster, in
this case haproxy. If pacemaker lacks quorum it may shut haproxy
down which will cause this charm to error.
Charmhelper sync included to bring in required
get_managed_services_and_ports method.
Change-Id: I9ede7d45e1d4da457d2228caf0367bf374bd51ea
This change follows the existing pattern that the keystone charm uses to only
run db migration once. To ensure it only runs once a flag is placed in the
leader db once it has run.
Change-Id: Iaba10cc70f60faa33e00cc5d33e03626f54374f9
Openstack services don't use the default ports (80 and 443), so
change Apache to not open them.
Change-Id: I543e3309c5522d7bc865133f8ec5ecc79542112c
Closes-bug: #1845665
This patchset implements policy overrides for glance. It uses the
code in charmhelpers.
Change-Id: I0586326ff87fdf03f2c88e4c459627f4085c3367
Closed-Bug: #1741723
If the certificates that Apache is using change then services needs
to be restarted. This change adds the SSL directory to the restart
map to ensure any certificate changes trigger a restart.
Change-Id: Idbdceb5acd80c06a2bde02f9df88a9d9fd2404fb
Closes-Bug: 1828530
This change implements a new option in config.yaml that can be used
to change the location of the images store on the filesystem.
Change-Id: I0d8e7409b8eb4e5e403455db03d73020f741afc4
Closes-Bug: #1657165
The glance-registry daemon was deprecated at Queens, but was still
installed for the Queens charm release; ensure that any re-install
of paste.ini files accomodates this as part of the charm upgrade
process, resolving issues with glance-registry not running due to
missing paste configuration files.
Change-Id: Iaaea4907ce4ef9d1e17b8ef9719e8bb0e0001946
Closes-Bug: 1812972
Glance supports image_size_cap setting. This setting controls maximum
size of image a user can upload. An image upload greater than the size
mentioned here would result in an image creation failure.
This commit adds support for setting image_size_cap parameter in charm
config. It can be manipulated during the runtime with `juju config'
command.
Change-Id: I0af1c6a503a87941b7c8ee34255583652e54f0cc
Closes-Bug: #1720040
Use the generate_ha_relation_data helper from charmhelpers to
generate the data to send down the relation to the hacluster
charm.
This results in a few changes in behaviour:
1) The charm will no longer specify a nic name to bind the vip. This
is because Pacemaker VIP resources are able to automatically
detect and configure correct iface and netmask parameters based
on local configuration of the unit.
2) The original iface named VIP resource will be stopped and deleted
prior to the creation of the new short hash named VIP resource.
Change-Id: I0ab095fdcb42dbfd2c64595e7390130500600190
On charm upgrade the charm may switch to py3 packages. If so, ensure
the old py2 packages are purged. If the purge occurs then restore
the glance-api-paste.ini from packages and restart services.
Closes-Bug: 1803451
Change-Id: Ib258873fb2be95821e8f8c22fd1f3d19666b3181
Switch package install to Python 3 for OpenStack Rocky or later.
When upgrading, remove any python-* packages that where explicitly
installed and then autoremove --purge any dependencies that are
no longer required.
Tidy install on ceph relation joined - python-ceph is a dependency
of ceph-common, so no need to explicitly install.
Change-Id: I7b66bb3ab9f9130c9054411819d51434480cac97
Some users may not want *_image_location operations to be
restricted to role:admin so this patch allows that to be
configurable and sets the default to be False since
enabling this by default is breaking RBD COW clones in
Nova for non-admin users (and anywhere else that relies
on that information).
Change-Id: I8c293d6036bc1d6104dab5458f6915968459a09e
Closes-Bug: #1786144
Refactor configuration for mitaka onwards, where the
authentication details for swift storage are in a new
glance-swift.conf configuration file.
Update for Keystone v3 support as required for
queens or later, where the v2 API has been dropped.
Closes-Bug: 1752027
Depends-On: Ie6e2733f34de10a4d34b18dbf1fd9ba623af0e18
Change-Id: Ibcc36ca22d72d310921f840e6081608be1fbc7e1
Drop support for deployment from Git repositories, as deprecated
in the 17.02 charm release. This feature is unmaintained and has
no known users.
Change-Id: Ic9a74991973863b2cf61fc5368bbe3664af90ef4
Remove postgresql DB support; This feature is untested as part
of the charms, is not in use and was deprecated as part of
the 1708 charms release.
Change-Id: Ia197a37cbfe9c11538f272437d95cfc836768cc9
When using ceph as a backend request the additional privilege
class-read on rbd_children. This fixes bug 1696073.
Change-Id: Ie4341eb834ae6fe02424c75e31f16f1cf5411f21
Closes-Bug: #1696073
Depends-On: Icf844ec7d33f2e558dee7935fe5fa3d7f08e0d59
This patch will cause /etc/glance/policy.json to
be updated so that *_image_location rules are
set to role:admin so that only admins can see
that info. On first update the original values are
stored on the local kvstore in case they need to
be retrieved for later restoring or comparison.
Closes-Bug: #1699565
Change-Id: Id6198d534af95013af47c0c1292ac65c79470af4
When an existing cluster of the service is scaled out the new unit
will join with keystone before it is fully clustered. In identity
joined hook the charmhelpers function canonical_url is called which
in turn uses another charmhelpers function, resolve_address.
resolve_address will only return the vip if the vip is set in config
AND the unit is clustered. This means that the units local address
is returned and that is then registered with keystone.
This change gates registering an endpoint if the cluster is
partially formed.
Change-Id: I85e7304b1480a95c784f46490dbcc0c4cc1c3129
Partial-Bug: #1544959