Commit Graph

112 Commits

Author SHA1 Message Date
Rafael Lopez 0a1d645000 Add configuration option for custom image properties
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
2023-08-10 04:47:17 +00:00
Hemanth Nakkina c2f877a7d4 Add support for cinder storage backend
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
2022-02-07 08:46:14 +05:30
Hernan Garcia 4aaa2ce5a3 add config to enable convertion to raw format
image-convertion config enables image convertion to raw format
this optimizes back-end capabilities while not putting the burden
of converting images to their end users

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/582
Closes-Bug: 1899767
Change-Id: Id3791721f9e38899c87b88591cdc42e46ffea5c1
2021-06-01 05:23:11 -05:00
Gabriel Adrian Samfira be8c4e00a9 Add multi backend support
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
2020-09-14 22:19:22 +00:00
Trent Lloyd e553d095d6 Remove rbd_store_chunk_size=8 reverting to default
We have shipped rbd_store_chunk_size=8 in our glance configuration for a
very long time, this value was sometimes suggested in older upstream
documentation and has the effect of halving the number of rados objects
used to store glance images.

When using qcow2 images in ceph the created VM volume will have an
rbd_store_chunk_size=4 (the default) however in modern clouds when
images are in the raw format we will use copy-on-write cloning from the
image to the volume, which means all such VM volumes inherit
rbd_store_chunk_size=8 from the parent. This has negative performance
implications for working volumes as there are object-wide locks that now
cover twice as much data and a wider chunk of sequential disk storage
will hit the same OSD.

Any overhead benefit of using objects only double the size (and thus
half in number) is very likely long relegated to history given the
number of volumes we're likely to have in a cloud versus base images, so
there doesn't seem to be any benefit to this setting and outside of a
few glance documents this rbd option is not documented anywhere I can
find as a suggestion or with any evidence of an advantage of performance
improvement from storing images this way.

Remove rbd_store_chunk_size=8 from all configuration files so that it
reverts to the default of 4.

Existing images (and old or new dependent volumes of them) will maintain
the existing rbd_store_chunk_size=8 and continue to work correctly. New
images will be created with the new rbd_store_chunk_size=4.

Change-Id: I5f6801c418430bbdcda53b94fcd51ed2fc230b68
2020-07-07 14:22:01 +08:00
Alex Kavanagh 848eb535a4 Remove policy.json from charm for ussuri
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
2020-04-23 16:17:35 +01:00
Corey Bryant a0f5d548f8 Add minimal policy.json template for Ussuri
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
2020-04-01 21:16:38 +00:00
tpsilva 8eb305f3f1 Disable Apache port 80
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
2020-01-28 14:53:01 +00:00
Zuul 2ea4cff1ac Merge "Fix deprecation warning in glance-api.conf" 2020-01-07 11:04:21 +00:00
Chris Johnston 8e94ec9225 Fix deprecation warning in glance-api.conf
Beginning with the Queens release of OpenStack, idle_timeout in the
database config group has been deprecated in favour of
connection_recycle_time. Starting with Queens, the database type also
changed from 'mysql' to 'mysql+pymysql'. This patch uses the context
for database type to also determine idle_timeout vs. 
connection_recycle_time

Change-Id: I875e54bbb0c43a9ad1b7f35c8d17939ca7739244
Closes-Bug: 1857041
2020-01-06 16:27:57 +00:00
Zuul 16acb63fcc Merge "Revert "Disable Apache default ports"" 2019-12-20 09:40:34 +00:00
Tiago Pasqualini da Silva bcadb3f450 Revert "Disable Apache default ports"
This reverts commit dcd9a269dc.

Change-Id: I842a67a7e167036ddd7fd529b35ef5d5c03f7c53
2019-12-20 02:05:33 +00:00
Zuul e6d34b0b66 Merge "Disable Apache default ports" 2019-12-19 12:16:29 +00:00
Stamatis Katsaounis 16abd40985 Remove glance-registry in OpenStack Stein deployments
This patch removes glance-registry service when upgrading to
OpenStack Stein and later releases.

Second part of:
Change-Id: Ie6d618582cd5063738a965d36e7d766633e1a607

Change-Id: I5e644ed8dba809fd1ad5d628f32ea64d31799e52
Signed-off-by: Stamatis Katsaounis <skatsaounis@admin.grnet.gr>
2019-11-30 19:49:11 +02:00
tpsilva dcd9a269dc Disable Apache default ports
Openstack services don't use the default ports (80 and 443), so
change Apache to not open them.

Change-Id: I543e3309c5522d7bc865133f8ec5ecc79542112c
Closes-bug: #1845665
2019-11-27 12:51:50 +00:00
Corey Bryant 557566e9d9 Sync charm-helpers and use "rabbit_use_ssl" for ocata
Ensure "rabbit_use_ssl" is specified in the [oslo_messaging_rabbit]
config section instead of "ssl" for Ocata, since "ssl" was not yet
introduced.

Change-Id: I192396dbd1ef96cab95e3958ae06fd86aa54ab46
Closes-Bug: #1838696
2019-08-05 11:48:13 +01:00
Nikolay Vinogradov 83b304ba18 Rework keystone_authsection generation for Queens+
Generate keystone_authsection section configuration option names
and values in Python code, and just iterate over it from Jinja
template. The idea is to have more flexibility in case of complex
branching logic (e.g. per OpenStack version), or to support option
deprecation.

Change-Id: I15d802d34de4a4b9319fd83a7063523df19cbe03
Related-to: https://bugs.launchpad.net/charm-glance/+bug/1786186
2019-05-07 17:39:29 +00:00
Frode Nordahl 0d128e913f
Switch to using ``ceph.conf`` template from charm-helpers
The Glance charm distributes a out of date ``ceph.conf`` template
that among other things does not contain the ``rbd_features``
configuration.

Switch to using the tempalte distributed with ``charm-helpers``

The effective diff between the two can be viewed here:
https://gist.github.com/fnordahl/a4034999cec28fd70628599125b10bda

Change-Id: I94f5a80c6ebfefdf7196cdf533f76931cfb22950
2019-03-15 10:32:37 +01:00
Corey Bryant 5ae43bb056 Update rabbit driver config options
The stein version of python-oslo.messaging (9.0.0+) has removed
the following config options from the [oslo_messaging_rabbit]
section:

rabbit_host, rabbit_port, rabbit_hosts, rabbit_userid,
rabbit_password, rabbit_virtual_host rabbit_max_retries, and
rabbit_durable_queues.

The above change requires a sync from charm-helpers.

Additionally the transport_url directive has been moved to the
[DEFAULT] section.

These have been deprecated since Ocata, therefore this change
will be provided to pre-Stein templates in order to drop
deprecation warnings.

See release notes at:
https://docs.openstack.org/releasenotes/oslo.messaging/index.html

test_300_glance_api_default_config is also removed in this change
as amulet tests no longer need to confirm config file settings.

Change-Id: I02c02f71669433ea719dffae42073771a40f743a
Closes-Bug: #1817672
2019-02-26 13:35:10 +00:00
Andre Ruiz 6e6b492485 Implement new option: filesystem-store-datadir
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
2019-02-21 09:41:06 -03:00
Nicolas Pochet 10ce2f862b
Enable the image signature verification feature
The rationale behind this change is to allow the use of the glance image
signature verification feature.
In order to do so, it is necessary to:
* Add the [barbican] section to `/etc/glance/glance-api.conf` with
keystone endpoint

Change-Id: I1ec0864b0a4ad6381532032830ac4948b74f7771
Closes-Bug: 1811067
2019-01-16 14:41:02 +01:00
Przemysław Hausman 046f20f3bc Add support for image_size_cap in charm config
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
2018-12-11 23:04:16 +01:00
Liam Young 19aaffaa81 Update to run under Python 3
Updating charm to support execution under Python 3.

Change-Id: I1429d1c6b634959e0062a8e9f4bc615c58bf31e0
2018-08-01 14:11:56 +02:00
Liam Young a7f029143f Enable proxy header parsing
Ensure that oslo.middleware parses any proxy information
forwarded from haproxy/apache with regards to protocol;
this ensures that https connections are correctly detected.

Change-Id: Id939a1873eb1e57b4b76771ad96c31a793cea923
Closes-Bug: 1758675
2018-06-28 12:00:43 +09:00
James Page 4d1d7f5a3f Fix keystone v3 support with swift backend
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
2018-02-28 08:55:08 +00:00
Billy Olsen 5030d244e2 Use VolumeAPIContext for endpoint
Switch to use the VolumeAPIContext for determining the endpoint
which is used for communicating with the Cinder volume API.

Change-Id: I15c326caf5561463fc25ee879cee0ed7b8dfd09e
Related-Bug: #1733566
2018-02-08 18:43:10 -07:00
James Page bd7375104e Remove deploy from source support
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
2018-01-08 15:11:54 +00:00
Edward Hope-Morley f0f70a942b Use volumev3 for internal endpoint in >= Pike
volumev2 api is deprecated for >= Pike so select
volumev3 for internal endpoint when using >= Pike.

Also moved cinder_catalog_info config to
[glance_store] section which should have been done
a long time ago.

Change-Id: Ia9c002199d939ba20c029b70d2eb3c6b6cdc51a6
Partial-Bug: #1733566
2017-12-11 11:09:13 +00:00
Liam Young f62513ad06 Expose {disk,container}_format options
The disk_format option was hardcoded and the container_format option
was unset. This change exposes both to the user allowing the admin
to restrict what formats are uploaded.

Closes-Bug# 1570875

Change-Id: I19fdc75b30863e997affb2dc90b0dd3bd19c9d27
2017-09-22 14:40:36 +00:00
James Page faa89dee7b Update notification config >= mitaka
Use oslo_messaging_notifications for mitaka or later releases
including setting the transport_url to the value provided by
the AMQP context.

This removes use of deprecated configuration options for
ceilometer notifications.

Change-Id: I66188d7275a84efd7aea4482db88b20983fe671f
2017-08-02 15:26:51 +01:00
Shane Peters 92c06de6aa Set 'show_image_direct_url' in openstack >= kilo
To expose the image location in the API for versions below Mitaka,
show_image_direct_url should be set to True. For Mitaka specifically,
show_multiple_locations should also be set.

This change sets both of these values when show_multiple_locations is
set in the charm.

Change-Id: Ibb3b6ecd92834f6345d21801942da0d3466d5bdc
Closes-Bug: #1645703
2016-12-23 13:38:23 -05:00
Andrey Pavlov 2b3eea98eb Allow to provide configuration for specific cinder backend
This changeset allows to change default store to cinder
and define additional key/values for glance-api.conf file.
Some cinder backends could require additional changes
in service and additional changes in the OS.
Same functionality implemented in cinder charm via storage-backend interface.

Change-Id: Ia9c78df7e9a1ccb0d9ca2121dd01e5832186bf19
2016-08-26 17:21:11 +03:00
Andrey Pavlov fa1c1dda1c Add support for storage of images in Cinder
Glance charm allows to store images in file, ceph, swift.

This changeset adds support for storage of images in Cinder
for OpenStack Mitaka or later.

Required dependencies are installed on relation to Cinder
(inline with Ceph integration).

This feature is dependent on resolution of some packaging
issues in the glance-store package (see Related-Bug).

Related-Bug: 1609733

Change-Id: Ib9d9f28e040b7b2eebb3f5d0ee9ff0773292bdcc
2016-08-24 10:56:55 +01:00
Corey Bryant 8b49c92fc2 Add systemd init support for deploy from source
systemd is used instead of upstart by default since Ubuntu 15.10
(Wily).  This adds systemd init file support for glance services
that are deployed from source.

Change-Id: I4117e9cbe5a30ed19ef2976d4e7160b82c09d4d3
2016-06-08 18:41:29 +00:00
Liam Young 4b9d9ad781 Update keystone_auth section for Mitaka
The keystone_auth section has changed for Mitaka. The Liberty format
,which is currently being used, is incompatible with keystone v3 on
Mitaka as it assumes the id of the default domain is default where
as in Mitaka it is a uuid.

The install documentation for Mitaka dictates that domain name should
be used rather than id when setting project_domain and user_domain

Change-Id: Ie4d20a7287b7baca104996999ac8d333976ab752
Partial-Bug: 1571347
2016-04-17 16:58:43 +00:00
Edward Hope-Morley 063f3a44f0 Support using internal network for clients
Openstack mostly defaults to using public endpoints for
internal communication between services. This patch adds
a new option use-internal-endpoints which, if set to True,
will configure services to use internal endpoints where
possible.

Closes-Bug: 1456876
Change-Id: I76129d4def671c5a5001cf15d9ff629a94a450e0
2016-04-01 12:13:20 +01:00
James Page a8f380b4cf Drop charm supplied paste.ini configurations
The glance-api-paste.ini and glance-registry-paste.ini configuration
files provided as part of the glance packages should be used; drop
charm templates and associated code paths.

This was required in early OpenStack versions where keystone auth
credentials where rendered into the paste ini file.

Existing deployments will go through a upgrade step to replace the
previously provided paste files from the charm with those provided
by the glance-api and glance-registry packages.

Change-Id: I016b8cb7823b98e8dffa91b3b427ed88a7b619bc
2016-03-10 11:46:02 +00:00
James Page b8ce24c8e6 Fix support for mitaka release
Use the messagingv2 notification driver from oslo.messaging instead
of 'rabbit' which is no longer recognised.

Include *-paste.ini's for mitaka release, as they are quite
different to those for kilo.

Change-Id: I382be1c04230422ade3c646b9329f9f31ea8a6c5
2016-03-06 13:27:18 +00:00
James Page 381a362b48 Rollup and remove unsupported releases
OpenStack releases < icehouse are no longer supported by the charms;
rollup and remove any templates for older releases.

Change-Id: I2e184c22dc9bca3a3dc0532bbe72948a11e330f9
2016-03-04 13:13:52 +00:00
James Page eb2e10d2ee Make exposure safe 2016-01-07 11:39:27 +00:00
James Page 8a0023faa4 Expose image locations by default when in use with a Ceph backend to support copy-on-write cloning in cinder and nova 2016-01-07 11:38:02 +00:00
Liam Young 193d2bac7a Charmhelper sync 2015-08-20 10:43:35 +00:00
James Page 16a30a3d2e Fixup key name 2015-06-02 19:29:59 +01:00
James Page 18a0a1ee12 Remove duplicate store config 2015-06-02 18:33:25 +01:00
James Page 5a4597fdc7 Restore filesystem_store_datadir option 2015-06-02 18:30:30 +01:00
James Page fbe257b542 Sort out problem with sectional configuration of glance_store 2015-06-02 18:25:25 +01:00
James Page 9c77d48459 Switch to using charm-helper templates for keystone authtoken 2015-03-25 09:25:38 +00:00
James Page e6dff09da5 Switch to using charm-helper templates for rabbitmq 2015-03-25 09:22:24 +00:00
James Page 884f710ae1 Update config for kilo 2015-03-24 11:21:03 +00:00
Edward Hope-Morley 57d4570620 added signing_dir field to template 2015-02-20 10:20:24 +00:00