Commit Graph

82 Commits

Author SHA1 Message Date
Myles Penner e25b5d38fb Add keystone audit middleware API logging
This commit adds Keystone audit middleware API logging to the Cinder
charm in versions Yoga and newer to allow users to configure their
environment for CADF compliance. This feature can be enabled/disabled
and is set to 'disabled' by default to avoid bloat in log files.
The logging output is configured to /var/log/apache2/cinder_error.log.
This commit builds on previous discussions:
https://github.com/juju/charm-helpers/pull/808.

Related-Pr: https://github.com/juju/charm-helpers/pull/893
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1200
Closes-Bug: 1856555
Change-Id: Ia7dbd6af2305e92eaa9a65890644c4a324ab2c65
2024-04-23 08:28:11 -07:00
Erlon R. Cruz ff442694d2 Use ids for cinder internal tenant and user
admin_tenant_id and admin_user_id are more explicit than
admin_tenant_name and admin_user as names could duplicate
and cause issues.

Includes sync from Charm-helpers PR #874 below

Charm-helpers-pr: https://github.com/juju/charm-helpers/pull/874

Closes-Bug: #2030755
Change-Id: Idbc2f3d12dcf325b4a53a3dda1ecfa75a199295a
2024-01-11 10:32:03 -03:00
Corey Bryant ebbedcbf58 Render [service_user] only for identity-service relation
The service token section [service_user] is not required when
cinder-volume is deployed as a separate service. In other words
it is not required for the identity-credentials relation.

The [service_user] section is nearly the same as the
[keystone_authtoken] section, and the keystone_authtoken data
is only produced for the IdentityServiceContext, therefore this
change will not render [service_user] for the
IdentityCredentialsContext.

Closes-Bug: #2024676
Change-Id: Iaecae3c22db1f4f2309f73f8c6836e6c072b848b
2023-06-26 17:50:18 -04:00
Jorge Merlino 81c330b5d8 Add support for using service tokens
This patch configures Cinder to send a service token along with the
received user token on requests to other services. This can allow those
other services to accept the request even if the user token has been
invalidated since received by Cinder. Also with this patch Cinder will
accept request from other services with invalid user tokens but valid
service tokens. Service tokens exist since Openstack Queens.

Closes-Bug: #1992840
Change-Id: I6cb9b1cb257db0b57bd7984c795b8caa1e3b74d9
2023-05-18 12:25:19 -03:00
Gabriel Cocenza 51e32a4f7e 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 (which continue to be the default). It also enables /healthcheck
endpoint for cinder-api on openstack releases >= ocata.

Closes-Bug: #1880610
Change-Id: I9d118f70fc1390be7b800ad20ae20e77818adac7
2023-03-29 09:48:30 -03:00
Tiago Pasqualini e737668e2f Add nova section for Ussuri
Commit 024de37 added the nova section on cinder.conf, but placed it
on the Victoria folder. This issue is also observed on Ussuri, so
this patch moves this from Victoria to Ussuri.

Closes-Bug: #1939389
Change-Id: Ia39177d6f47ddda0b1acb27cde02ae5e74a01032
2023-01-30 14:54:18 +00:00
Gabriel Adrian Samfira 024de3783f Add nova section
Cinder sometimes needs to communicate with nova,
for example to notify VMs when live-resizing a disk.
Under certain circumstances,
the autodetected authentication details don't work,
so we must add a dedicated section in the config
for the nova client with proper credentials.

This issue has been observed on victoria and newer,
hence the addition of cinder.conf for victoria.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/776

Closes-Bug: #1939389

Co-authored-by: Samuel Walladge <samuel.walladge@canonical.com>

Change-Id: I6d44223b7c2863c6d9c62b46a41275fd360f92d1
2022-06-27 13:30:18 +09:30
Samuel Walladge 7f97a6d30e Add support to configure scheduler_default_filters
Add new config option: `scheduler-default-filters`.
This is unset by default, so cinder retains the default value for
scheduler_default_filters.

Closes-Bug: #1956727
Change-Id: I9777bf8fe5ddbb69689db60c2790e8a4be57e1ab
2022-01-25 11:04:40 +10:30
eric-chen dd5137c2e7 Add support for configuring image volume cache
Support new configuration to turn on image volume cache in Cinder
service. User can control the maximum size and count from
configuration too.

Closes-Bug: #1869903
Change-Id: If96dbb9c0974bfa1f6d67405bb430a7cd251f821
2021-09-16 15:25:13 +08:00
Nobuto Murata 12193d2bc2 Allow specifying default_volume_type
It's useful when multiple storage backends to be connected to Cinder.
The corresponding volume type must be created after a deployment via API
to take effect, e.g., `openstack volume type create VOLUME_TYPE
--property volume_backend_name=BACKEND_NAME`

Please note that there is a regression in upstream as LP: #1879578, so
it doesn't work for Train or later releases until the issue gets fixed.

The other way to have the similar effect is to edit the definition of
__DEFAULT__ volume type via API (available for Train or later releases).
Howevers it's not as flexible as the option in cinder.conf since it
doesn't allow any modification unless all of the volumes with the
__DEFAULT__ type get deleted.

Change-Id: I031a6bf2a066bb9d3157e545bb9df782a76551f3
Closes-Bug: #1884548
2020-08-19 17:51:35 +00:00
tpsilva 962225ecca 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: Iaa80573dc2661089093c4c87ab100bf941f8b3b8
Closes-bug: #1845665
2020-01-27 17:33:51 +00:00
Tiago Pasqualini da Silva ebcbb5bc90 Revert "Disable Apache default ports"
This reverts commit 2b251b093f.

Change-Id: I28a3634eb1d980c16aea804e11eb1bbc0c88beec
2019-12-20 02:05:28 +00:00
tpsilva 2b251b093f Disable Apache default ports
Openstack services don't use the default ports (80 and 443), so
change Apache to not open them.

Change-Id: I896334b232589baacb48da2285829f9e9f0963f9
Closes-bug: #1845665
2019-11-27 12:51:48 +00:00
Corey Bryant b5d20a0718 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: I070b8bbebed4e53fa524047599c71f73dc1c79fc
Closes-Bug: #1838696
2019-08-01 23:00:16 -04:00
Corey Bryant efb1a1e2d9 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_cinder_config is also removed in this change as amulet
tests no longer need to confirm config file settings.

Change-Id: Ia93be49430e8d95c38ed521d08bbb62f47e13e59
Closes-Bug: #1817672
2019-03-05 15:26:24 -05:00
Chris MacNaughton 26c0dec5f3 Add policy to allow owner to force delete volumes
The default in cinder is to only allow the admin to
force delete a volume; this change allows the
admin_or_owner to force delete a volume.

This was previously authored by Chris MacNaughton in change
I703a21b68186059a63f0d06d88cd2528e821f3d3
And then reverted in change
I77f9351da8516e5af40fea57400101e6dd16b528

This change includes gating on the OpenStack version.

Change-Id: I35599bae8a94724869a36c555ebfc6bf94384bd4
Co-Authored-By: Chris MacNaughton <chris.macnaughton@canonical.com>
Closes-Bug: #1782008
2019-02-08 07:32:20 -08:00
Alex Kavanagh 834cde35ec Migrate to python3 only charm
Change-Id: Ia4bcf570d40083625358fdd4fea14202ff3d89af
2019-01-30 12:36:21 +00:00
Chris MacNaughton (icey) 79f9ff5c70 Revert "Add policy.json to allow owner to force delete volumes"
This reverts commit 4ddea990d0.

Change-Id: I77f9351da8516e5af40fea57400101e6dd16b528
2018-07-30 15:19:47 +00:00
Chris MacNaughton 4ddea990d0 Add policy.json to allow owner to force delete volumes
The default in cinder is to only allow the admin to
force delete a volume; this change allows the
admin_or_owner to force delete a volume.

Change-Id: I703a21b68186059a63f0d06d88cd2528e821f3d3
Closes-Bug: #1782008
2018-07-27 13:18:35 +02:00
Nobuto Murata da7104c472 Use charmhelpers template instead of hardcoding per charm
Now that charmhelpers have the template with the same content so we can
switch to it for future maintainability.

Change-Id: Icfc7834de8215836b035bed98cdd64f479c5b2c9
Related-Bug: #1758675
2018-06-28 12:18:41 +09:00
James Page 3451c1c498 Tidy ceph backend configuration
Drop generation of upstart override file and /etc/environment and
scrub any existing charm configuration in these locations from
an existing install.

These where required way back in the dawn of time when ceph support
was alpha/beta in cinder.

Provide backend specific configuration file path, allowing multiple
ceph clusters to be used with a single cinder application.

Change-Id: I7adba0d35fb7406afa40f047b79a9ab51a6a333d
Closes-Bug: 1769196
2018-05-10 11:51:04 +01:00
James Page 50651ca6c0 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: I64e8c14123e5d12850902ce99490697ca4bb853d
Closes-Bug: 1758675
2018-04-09 11:29:51 +01:00
James Page 4ea9d6a427 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: Icd464e950c6f53470311e3c110b530a69bff6e2f
2018-01-12 13:59:33 +00:00
Seyeong Kim 24588869f2 Copied mitaka's api-paste.ini to /templates/mitaka/
to support http_proxy_to_wsgi

Change-Id: Icdfcd3963848dccc9e42f72ed899dddc96ca1ebf
Related-Bug: #1558683
2017-11-20 12:32:26 +09:00
Jenkins 5b23ec1de6 Merge "Modify the spelling mistakes" 2017-08-18 12:37:38 +00:00
zhangbailin 41c16f321d Modify the spelling mistakes
While I was reading the code, I found some spelling mistakes
in the comments and corrected them here.

Change-Id: Ib847f484a883523cd330a517bdb719ec7ea7b32b
Closes-Bug:#1709830
2017-08-17 22:51:58 -07:00
James Page a14eaa5eeb 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: Ic363af31b5e74ae0830e4d3213ce21231a332773
2017-08-02 15:25:50 +01:00
Liam Young 8641e81498 Move backends into their own sections
Using DEFAULT section to configure drivers is not supported since
Ocata. This change lists backends in enabled_backends.

Note: Using sectional config causes the os-vol-host-attr:host
volume attribute to change which invalidates existing volumes.
A subsequant change is needed to add an action for renaming
the host attribute of existing volumes *1

*1 https://docs.openstack.org/admin-guide/blockstorage-multi-backend.html#enable-multiple-storage-back-ends

Partial-Bug: #1665272
Change-Id: I22c3e74b0874c051bee89e4609088facf95b4664
2017-02-20 15:32:00 +00:00
Corey Bryant a74562f113 Add new api-paste.ini template for Ocata
Change-Id: I326bde6c8a6501f86b65730d41fd4fed6d00cf4d
2017-02-13 19:57:01 +00:00
Jorge Niedbalski 07ae3acbb4 Adds volume-usage-audit-period config directive >= kilo.
This change adds the config directive called
volume-usage-audit-period for versions >= kilo.

Also, According to the doc change I90dff1b5c2a7dd2943cfa7ff25bb63c08eb7986d,
messagingv2 should be the default for anything > Icehouse.

So, this change also sets the following configuration section for
versions >= mitaka.

[oslo_messaging_notifications]
driver = messagingv2

This change adds a specific configuration context that installs
a crontab entry for running the cinder-volume-usage-audit recurrently.

Change-Id: I0056edaac55210a1a1f509ec908ae61c0ea887df
Closes-Bug: #1623144
Signed-off-by: Jorge Niedbalski <jorge.niedbalski@canonical.com>
2016-09-14 14:18:50 -03:00
Corey Bryant 9803fbc934 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 cinder services
that are deployed from source.

Change-Id: I476074659c03d44a78dd607e7a91c87de0734562
2016-05-24 12:45:32 -04:00
Liam Young e2d8622b41 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: Ic8621020db16eaa4ac398e48406d8a858f974ae4
Partial-Bug: 1571347
2016-04-18 05:28:41 +00:00
Edward Hope-Morley 0c2f80976e 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: Iadd1e4e8833f637d75d3b5080e49ddabb0f78427
2016-04-01 12:10:59 +01:00
Liam Young 9969922c88 Charmhelper Sync & corresponding amulet fix
sync charmhelper to pickup new keystone auth template section file and
update amulet to account for the changes

Change-Id: Id1c58d7a2081eb59ff620e53adbd9515013b8085
2016-03-29 11:25:48 +00:00
James Page a9a5e16600 Rollup templates to drop unsupported releases
Folsom, grizzly and havana have not been supported for some time;
rollup any templates as required and drop unsupported series.

Change-Id: I6d50531792a821101c3d808b0d2a2ba41faa2474
2016-03-03 14:47:06 +00:00
billy.olsen@canonical.com 441ebdc635 [billy-olsen,r=] Specify os_region_name based on the region.
This ensures that the region is configured within the cinder.conf file.

Partially-Closes-Bug: LP#1468306
2016-02-16 11:46:22 -07:00
James Page fb1c5d2df2 Add keymgr encryption_auth_url as a workaround for bug 1516085 2015-12-15 10:20:01 +00:00
Edward Hope-Morley ed1b4950f6 fixup jinja indentation 2015-10-01 09:45:55 +01:00
Corey Bryant d33070988d Move deploy from source template files to templates/git 2015-04-13 13:49:53 +00:00
Corey Bryant 994e29fd27 Deploy from source 2015-04-02 12:13:45 +00:00
James Page 39b6767922 Switch to using charm-helper templates for keystone authtoken 2015-03-25 09:25:34 +00:00
James Page d04d133bf9 Switch to using charm-helper templates for rabbitmq 2015-03-25 09:22:19 +00:00
James Page 0d584e63d4 Add newline 2015-03-24 10:27:30 +00:00
James Page df08606108 Tidy whitespace 2015-03-24 10:26:09 +00:00
James Page b3433ee221 Set auth_uri as well 2015-03-24 10:23:22 +00:00
James Page 320d19522f Move to section config for cinder kilo 2015-03-24 10:02:14 +00:00
Corey Bryant 6a427372de Overall refresh to current install from source approach 2015-03-21 02:18:45 +00:00
Corey Bryant 6d779cb9d1 Merge next branch 2015-03-21 01:39:33 +00:00
Corey Bryant d0becc8e4a Initial support for deploying from git 2015-03-07 21:27:57 -05:00
Edward Hope-Morley bae1dc0f45 [hopem,r=]
Adds pki token support.

Closes-Bug: 1309667
2015-02-19 19:37:26 +00:00