Commit Graph

144 Commits

Author SHA1 Message Date
Zuul 09ec6c27e2 Merge "Use normal credentials for legacy image update" 2024-04-22 15:46:10 +00:00
Rajat Dhasmana c2b7b78d4f Use normal credentials for legacy image update
When updating legacy images, currenly we use the user's
context and elevate priviledges. However, we do not
require admin priviledges for the cinder API calls.

This patch removes the special case where we elevate
priviledges as it wasn't doing anything rather avoiding
us to use right credentials and failing to fetch volume
in the right location because of wrong credentials.

The correct credentials are either the service ones
set in glance-api.conf file or the user context
credentials, using which the Image-Volume was created.

NOTE: When using cinder as glance backend and we want
to perform optimized volume upload to image, one thing
we should make sure is either using the context or the
cinder credentials set in glance-api.conf file, it should
match the following details on the cinder side (if we are
using internal context to create clone of image-volumes):

cinder_store_user_name = context.user_id/cinder_internal_tenant_user_id
cinder_store_project_name = context.project_id/cinder_internal_tenant_project_id

The cinder_internal_tenant_user_id and
cinder_internal_tenant_project_id are set in the
[DEFAULT] section of cinder.conf.

This issue was first discovered when testing the new
location APIs[1] where tempest creates a volume with
cinder's internal context and glance uses wrong (user context)
credentials to access it and failing with 404 not found.

[1] https://review.opendev.org/c/openstack/cinder/+/909847

Closes-Bug: #2056179
Change-Id: I4f27a9800f239da8dbf29f4c028678df1f867664
2024-04-08 23:53:24 +05:30
Zuul 51887ec64a Merge "reno: Update master for xena Unmaintained status" 2024-03-26 16:02:59 +00:00
Zuul a1247c706c Merge "reno: Update master for wallaby Unmaintained status" 2024-03-26 16:02:58 +00:00
Zuul ac1e8714aa Merge "reno: Update master for victoria Unmaintained status" 2024-03-26 15:56:56 +00:00
OpenStack Release Bot 390310d30c reno: Update master for xena Unmaintained status
The stable/xena branch has been deleted, so reno can't find its
release notes.  Use the xena-eom tag to indicate the end of the
Glance project's maintenance of the Xena series.

This strategy is consistent with the way we handled stable/yoga and
was agreed upon at the 8 Feb Glance meeting:
https://meetings.opendev.org/meetings/glance/2024/glance.2024-02-08-14.00.log.html#l-58

Change-Id: I72b66cf523f1d5515704e4d6909ee032bdb06210
2024-03-07 22:12:03 +00:00
OpenStack Release Bot 7e50396aee reno: Update master for wallaby Unmaintained status
The stable/wallaby branch has been deleted, so reno can't find its
release notes.  Use the wallaby-eom tag to indicate the end of the
Glance project's maintenance of the Wallaby series.

This strategy is consistent with the way we handled stable/yoga and
was agreed upon at the 8 Feb Glance meeting:
https://meetings.opendev.org/meetings/glance/2024/glance.2024-02-08-14.00.log.html#l-58

Change-Id: I04c557318accc4b95c52833b15c1f0f8ca91ef97
2024-03-07 22:08:11 +00:00
OpenStack Release Bot f9809f8659 reno: Update master for victoria Unmaintained status
The stable/victoria branch has been deleted, so reno can't find its
release notes.  Use the victoria-eom tag to indicate the end of the
Glance project's maintenance of the Victoria series.

This strategy is consistent with the way we handled stable/yoga and
was agreed upon at the 8 Feb Glance meeting:
https://meetings.opendev.org/meetings/glance/2024/glance.2024-02-08-14.00.log.html#l-58

Change-Id: I7e5ac421b51be33b67ffd5910a16d549c3df624d
2024-03-07 22:02:46 +00:00
OpenStack Release Bot 8200b759b8 Update master for stable/2024.1
Add file to the reno documentation build to show release notes for
stable/2024.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.1.

Sem-Ver: feature
Change-Id: I377e11336ba61b77d5253a1c40d924e41fef48a4
2024-03-07 15:00:45 +00:00
OpenStack Release Bot a17b8a8fef reno: Update master for yoga Unmaintained status
The stable/yoga branch has been deleted, so reno can't find its
release notes.  Use the yoga-eom tag to indicate the end of the
Glance project's maintenance of the Yoga series.

This strategy was agreed upon at the 8 Feb Glance meeting:
https://meetings.opendev.org/meetings/glance/2024/glance.2024-02-08-14.00.log.html#l-58

Change-Id: I5947418451eb37bd78d1910a3c7d9049f4cf1736
2024-02-12 19:58:36 +00:00
Zuul e823a3caa0 Merge "RBD: Use rados_connect_timeout to override timeout" 2024-01-19 16:44:23 +00:00
Takashi Kajinami c197bbdcca RBD: Use rados_connect_timeout to override timeout
This imports the existing rados_connect_timeout option handling in
cinder so that users can use a different timeouts for Glance
specifically, instead of relying on the global ceph.conf options.

This parameter was initially deprecated in Zed release by [1] and has
had no effect since then, but this change restores the parameter with
the logic to override the timeout value in RADOS client.

[1] b1d0feeba4

Related-Bug: #1983499
Change-Id: Ib370f527c06dc85bcfd9df6ca1efb2a4e8cb5e7d
2024-01-19 13:16:24 +09:00
Zuul b72d837acb Merge "Deprecate VMWare Datastore" 2023-12-07 15:12:04 +00:00
OpenStack Release Bot f3f5bdb45b Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: I50485a9c9a563c925988bf8456b45f9caaf844ba
2023-09-15 14:53:08 +00:00
Takashi Kajinami ea61721442 Deprecate VMWare Datastore
The vmwareapi virt driver in nova was marked as experimental some
cycles ago due to lack of CI and maintainers[1]. This deprecates
the VMWare Datastore so that we can remove it when nova removes
the virt driver. The store driver is used along with the vmwareapi virt
driver and we don't expect any usage of this store driver with
the other virt drivers such as libvirt driver.

[1] 713ef7839670bd5d73af52c211a14932adc933ba

Change-Id: I57fc8cbd6308c4a82a638a2d1e997605736aedc4
2023-09-05 22:02:19 +09:00
OpenStack Proposal Bot 0c60291637 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: If5c27deb39ce62c5791b8157efeb42cfc728fc67
2023-07-08 02:08:39 +00:00
OpenStack Proposal Bot 5a81f77bd4 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ic35a1ee81e3a406aca987f75707d61e21d8606f4
2023-06-22 03:20:15 +00:00
Zuul f627d69f04 Merge "Add per-store weight config element" 2023-06-21 14:20:58 +00:00
Eric Harney 5427e0ca48 RBD: Trash image when snapshots prevent deletion
RBD snapshots automatically end up in the trash
when deleted when using RBD image format v2.

However, they prevent images from being deleted.

Instead, move RBD images to the trash in this
situation.  This trash must be purged by a scheduled
rbd trash purge operation outside of Glance.

This passes new cinder<->image dependency tests in
I5fee2395195 when using ceph require-min-compat-client
of "mimic", which enables clone v2.

Closes-Bug: #1959186
Change-Id: I34dcd90a09d43127ff2e8b477750c70f3cc01113
2023-06-15 07:58:48 -07:00
Dan Smith b0b3edf703 Add per-store weight config element
Related to blueprint store-weight

Change-Id: Ia7d5ca93500aa84a00cd571a67d9838152ecfadd
2023-06-15 06:57:53 -07:00
Zuul 9bd9cf4fcd Merge "Revert "RBD: Wrap RBD calls in native threads"" 2023-05-18 20:17:13 +00:00
Dan Smith 99f4014493 Revert "RBD: Wrap RBD calls in native threads"
This reverts commit 27ab8a6aeb.

Reason for revert: The change introduced a blocking library call for
the thread running import jobs.

Closes-Bug: #2020122
Change-Id: I83e3a0da9fdf7167cf4adf7257d5960338901158
2023-05-18 09:30:58 -07:00
OpenStack Proposal Bot ec389750c8 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ic5399869cc57661706a6e8801fcb200fbb526082
2023-05-11 03:44:56 +00:00
Brian Rosmaita 1d8033e54e Add force to os-brick disconnect
In order to be sure that devices are being removed from the host,
we should be using the 'force' parameter with os-brick's
disconnect_volume() method.

Closes-bug: #2004555
Change-Id: I63d09ad9ef465bc154c85a9ea125449c039d1b90
2023-05-10 08:29:05 -04:00
OpenStack Release Bot e8e9d8d61c Update master for stable/2023.1
Add file to the reno documentation build to show release notes for
stable/2023.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.1.

Sem-Ver: feature
Change-Id: I9de26e99ebd9ab6bd106c7e0b10347ca572663de
2023-03-01 13:19:00 +00:00
OpenStack Proposal Bot 64e25979a9 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: If3f612f3ecabcd2610ea0443d3866a001dd82d0a
2023-02-10 04:13:41 +00:00
Zuul ff1f8b38ba Merge "Cinder: Add support to extend attached volumes" 2023-02-08 22:27:30 +00:00
Zuul 35a4589885 Merge "Rbd: Deprecate unused rados_connect_timeout" 2023-02-08 07:26:09 +00:00
OpenStack Proposal Bot 2379a56546 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I7f90bb35d8de35404a4c5a8c49835ba83faba4f7
2023-02-04 03:33:43 +00:00
Rajat Dhasmana a7edc87b0e Cinder: Add support to extend attached volumes
While creating an image, if we want to extend the volume
(to accomodate the image), we need to first detach the volume,
perform the extend and attach it again. This is inefficient
for backends that support extending attached volumes since we
are performing 3 cinder operations (the attachment call
includes 3 API calls which sum to a total of 5 API calls for 3
operations) instead of directly extending it which requires only
1 API call to cinder.
The support for extending attached volumes was added in cinder
microversion 3.42.

This patch adds a new boolean config option
``cinder_do_extend_attached`` which allows operators to specify
if the cinder backend they are using supports extending
attached (in-use) volumes. By default this will be ``false``.
Based on the parameter, we will perform the extend operation,
online (if cinder_do_extend_attached is true) and offline otherwise.

Spec: https://review.opendev.org/c/openstack/glance-specs/+/868901

Depends-On: https://review.opendev.org/c/openstack/glance/+/869021
Depends-On: https://review.opendev.org/c/openstack/cinder/+/869051

Change-Id: I5e70824e9abc5277ea25ba95704b358fe3686037
2023-01-18 15:46:49 +05:30
whoami-rajat d0733a0f4f Refactor/restructure glance cinder store
This is an effort to decouple some of the cinder backend specific
code (like nfs, scaleio) from the generic logic.
The purpose is to make the code modular and any change
for a particular cinder backend should not affect the code path
of other backends thereby reducing regression.
This is also required for another use case of supporting extend
of attached volumes added in [1].
Following are the major changes done in this patch:

1) Move cinder store to a new directory 'cinder' and rename
   'cinder.py' to 'store.py' (similar to swift)
2) Create new files for nfs and scaleio backends for moving code
   specific to these backends into their own separate file.
   This also fixes one bug when using sparse files in nfs and
   we wait for file size to be equal to volume size (initially done
   for scaleio/powerflex backend) but this will never happen for
   nfs sparse files. See bug: 2000584
3) Move cinder tests to 'tests/unit/cinder' directory and add tests
   for base, nfs and scaleio files.
4) Modify/fix existing tests

Closes-Bug: #2000584

[1] https://review.opendev.org/c/openstack/glance_store/+/868742

Depends-On: https://review.opendev.org/c/openstack/glance/+/869021

Change-Id: I26c272b6c503e98fbbafca411d3eec47283bd6fc
2023-01-17 12:13:06 +05:30
OpenStack Proposal Bot f732972891 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I6e39ce009fe9602dd63dd0052e8925b63ade3e0f
2022-09-16 04:44:24 +00:00
Zuul 70ef4b6bb7 Merge "Update master for stable/zed" 2022-09-12 22:20:16 +00:00
OpenStack Release Bot b2e6656d16 Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: I9745880b98acf910c4f8cf74372a7fdc9ebac582
2022-09-06 13:13:09 +00:00
OpenStack Proposal Bot 3942cafb41 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I531c32bd0b9692efc68a3a16ad7f4eb6fa996ce0
2022-09-06 03:05:07 +00:00
OpenStack Proposal Bot 0d224fa3c8 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I8dabf5882020d5bc17007f12f1d4afd0e9ecc45c
2022-08-24 04:39:20 +00:00
Zuul d8cc723490 Merge "Swift: Honor *_domain_name parameters" 2022-08-22 19:12:23 +00:00
Takashi Kajinami 6738d0b156 Swift: Honor *_domain_name parameters
The *_domain_id parmaeters should not have any default. Otherwise
keystoneauth ignores the *_domain_name parameters and it requires
only *_domain_id parameters are used.

Closes-Bug: #1620999
Change-Id: I1f8c9184761313f9fc5fda2f257e52233e0196d1
2022-08-18 11:20:52 +09:00
Zuul 9605ff1081 Merge "Imported Translations from Zanata" 2022-08-11 17:08:15 +00:00
Cyril Roelandt b1d0feeba4 Rbd: Deprecate unused rados_connect_timeout
This option determines the value we pass as the "timeout" argument to
rados.Rados.connect. Unfortunately, this argument is silently ignored by
librados[1].

[1] https://docs.ceph.com/en/latest/rados/api/python/#rados.Rados.connect

Closes-Bug: #1983499
Change-Id: I819df987f690c7a8c0a1153ad0e30bd5dbeb7b57
2022-08-04 15:29:28 +02:00
Gorka Eguileor 73ebb70542 Support os-brick specific lock_path for Cinder
As a new feature relevant for the Cinder store, os-brick now supports
setting the location of file locks in a different location from the
locks of the service.

The functionality is intended for HCI deployments and hosts that are
running Cinder and Glance using Cinder backend.  In those scenarios the
service can use a service specific location for its file locks while
only sharing the location of os-brick with the other services.

To leverage this functionality the new os-brick code is needed and
method ``os_brick.setup`` needs to be called once the service
configuration options have been loaded.

The default value of the os-brick ``lock_path`` is the one set in
``oslo_concurrency``.

This patch adds support for this new feature in a backward compatible
way so code works even if using an os-brick version that doesn't have
this feature.  That is the case for many CI jobs that install os-brick
from PyPi instead of the code present in master.

Change-Id: Ib11d63e3c388e12f145f40247d17030a566b8c5e
2022-07-12 11:30:31 +02:00
OpenStack Proposal Bot 8e540c6c47 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I5e4fd429f900c33934ca34afb340f06f174616fd
2022-05-26 02:40:19 +00:00
liyou01 5ff06df97f Remove Python 2 support
Python 2 has been deprecated for almost two years, and has not been
guaranteed to work with glance_store for a while. This patch removes all
traces of six, unicode strings and Python 2 tweaks.

Co-Authored-By: Cyril Roelandt <cyril@redhat.com>
Change-Id: Ifa78924d7ecf4f2d9a54c677888ab2926530c487
2022-05-25 04:42:06 +02:00
Ghanshyam Mann aeee48b561 Update python testing as per zed cycle teting runtime
In Zed cycle, we have dropped the python 3.6/3.7[1] testing
and its support. Moving the py36 job to py3 based so that they run
on latest supported python 3. Updating the python classifier also to reflect the same.

[1] https://governance.openstack.org/tc/reference/runtimes/zed.html

Change-Id: Ida582daf7db6fb3cedb3c7e37fc512d094b37c6e
2022-05-10 19:25:24 -05:00
Zuul 111a7a14b0 Merge "Cinder: Correct exception logging during attach" 2022-05-05 13:34:26 +00:00
whoami-rajat 3ee399a1e3 Cinder: Correct exception logging during attach
There is a syntax error in the exception logging when attaching a
volume fails in attachment state manager. This patch corrects it
and adds a test to guard against similar changes in future.

Closes-Bug: #1970698

Change-Id: I43c407046a49bb37631113e2ea65d05450f9365d
2022-04-28 10:31:54 +05:30
whoami-rajat ba4af147fb Correct retry interval during attach volume
When we try to simultaneously attach same volume multiple times
(multiattach), there are multiple attachments created, suppose
attachA and attachB. If attachA marks the volume "reserved" then
attachB can't proceed until the volume is in "in-use" or "available"
state. We retry until we reach any of these states for which we use
the retrying library.

The retrying library defaults to 1 second retry[1] (5 times) which causes
the original failure as the volume takes time to transition between
"reserved" -> "in-use" state. This patch corrects it by adding an
exponential retry time and max exponential retry i.e.

1: 2 ** 1 = 2 seconds
2: 2 ** 2 = 4 seconds
3: 2 ** 3 = 8 seconds
4: 2 ** 4 = 16 seconds (but max wait time is 10 seconds)
5: 2 ** 5 = 32 seconds (but max wait time is 10 seconds)

[1] https://github.com/rholder/retrying/blob/master/retrying.py#L84

Closes-Bug: #1969373

Change-Id: I0094b044085d7f92b07ea86236de3b6efd7d67ea
2022-04-18 22:23:49 +05:30
OpenStack Release Bot db235f1b21 Update master for stable/yoga
Add file to the reno documentation build to show release notes for
stable/yoga.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/yoga.

Sem-Ver: feature
Change-Id: I99772281621ebce5a57ddd37cee879d7cc387c47
2022-02-16 14:43:24 +00:00
whoami-rajat f3433ed1a5 Cinder store: Wait for device resize
When we have an image with size > 1 GB, we follow the following steps
to accomodate the image:
1) Detach the volume
2) extend the volume
3) Attach the volume
4) Open the volume device as a file and resume writing the image

Sometimes due to several reasons (mostly network related), the
size of the device file could mismatch with the actual volume size
(or the backend LUN size). This can happen if the extend was performed
(i.e. the control path) but it takes the time to reflect that into
the mapped device (i.e. the data path). This mismatch can cause the
issue "IOError: [Errno 28] No space left on device".
To avoid this scenario, we check if the device size is less than the
volume size, we wait for the extended LUN to show up in mapped device
and then continue the image writing operation.

Closes-Bug: #1959913

Change-Id: I206580f6be615ebc5e15b546b9c23728d4116a5d
2022-02-07 23:56:17 +05:30
whoami-rajat 8b4d97a6f7 Pass valid IP address to os-brick
While fetching connector information the cinder driver of
glance-store is passing 'hostname' as IP address whereas it
actually needs IP address.

This path fetches the IPV4 or IPV6 address from the available
'hostname' and passes it to os-brick.

This worked for other cinder backends which don't rely specifically
on IP address for initializing connection like fibre channel, nfs etc
and even for some iscsi backends since, in some environments,
the hostname is same as the ip address. This is not the case always
and we should pass the correct IPv4/IPv6 address of the host to
avoid this issue.

Closes-Bug: #1955668

Change-Id: Ic79815972e654a8bfe2775f57c68cfa0bf115e2f
2021-12-23 11:39:53 -05:00