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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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