Made changes to revert image state to `queued` and deleting image data
from staging area if image conversion fails. If image is importing to
multiple stores at a time then resetting the image properties
`os_glance_importing_to_stores` and `os_glance_failed_imports` to
reflect the actual result of the operation.
Closes-Bug: 2072483
Change-Id: I373dde3a07332184c43d9605bad7a59c70241a71
This will let downstream distros with qemu-img versions
that don't support the qed format pass unit tests without
having to patch this test out.
Change-Id: I50907c90686366cab12be072b53c65b048b7c510
This will eliminate the regression of adding the schema validation
in existing schema which is defined for image create/update API.
Change-Id: Icd704f37a0a770b6cad63207276825d97c87eb5b
Removing deprecated location_strategy functionality which was used
to prioritize location order for downloading the image.
The weighing mechanism introduced in the Bobcat development cycle
now should be used by operators who would like to prioritize
certain stores over others.
Change-Id: I7b760d2b28a8b289a303a0a9c1d91a9de0c7138a
This change adds a new location api GET
/v2/images/{image_id}/locations to get the locations associated
to the image.
This operation will be allowed to service user only,
and validated by the new policy rule `fetch_image_location`.
Implements: blueprint new-location-apis
Change-Id: I9d14465a83e76c73e12cec3b96d42e568ab97072
This change adds a new location api POST
/v2/images/{image_id}/locations to add the new location to
the image when in `queued` state only.
This operation will be service user & image owner only,
and validated by the new policy rule `add_image_location`.
Implements: blueprint new-location-apis
Change-Id: I238c21efd09de296e8928d8fa68bac4b41f81694
This change adds location_import task flow which includes
below tasks which are required for new add location api,
1. UpdateLocationTask
2. CalculateHash
3. VerifyValidationData
3. SetHashValues
4. SetImageToActiveTask
Related blueprint new-location-apis
Change-Id: Id5482582a29d947dcb74a506bf715cf6a2d05b3e
In case of glance multiple stores (mostly for ceph) nova initiates
copy-image functionality if image, from which the sever is being
created, is not present in the referring ceph store. This can fail if
image location which is already present in image but not available for
that glance edge node. This scenario can only be reproducible
with EDGE deployment.
In order to fix this, if the store is defined on that glance node
then only call set_acls method, else ignore it.
Closes-Bug: #2073945
Change-Id: I0409982ae27b662e60dd2363ba2f7863d0722fea
This reverts commit 244ccb68dd9c1be8b8c6223c50998464a394b688.
Reason for revert: disk-format list not required to be passed to the import jobs after the tempest change [1].
[1]: https://review.opendev.org/c/openstack/tempest/+/924252
Change-Id: Id2548fad3e90144b47964b82bb4f702ad6407ae2
The openstack-tox-functional-py38-fips job is based on centos-8-stream,
which is no longer working and will soon be dropped completely, so
remove the job.
Change-Id: Ie419f2cf9f685bba770b6b2c88571e41758cb212
This adds a safety check and detection mechanism to the
tools/test_format_inspector.py utility for verifying those features
outside of glance.
Change-Id: I447e7e51315472f8fa6013d4c4852f54c1e0c43d
When Glance is configured to use Cinder store and we upload
volume to Glance in the optimized path, it fails with
InvalidLocation error.
This happens because Cinder is not aware about the store
in which we will create the image and supplies the old
format URL i.e. cinder://<vol-id> whereas Glance expects
new location format i.e. cinder://<store-id>/<vol-id>.
Glance has code to update the format from old location format
to new location format but it isn't triggered in case of
old location APIs.
This patch adds the context to the update store ID request
which calls the Cinder store to provide the updated location,
hence fixing the optimized path for upload volume to image.
Closes-Bug: #2054575
Change-Id: Idd1cb8982b40b85a17821596f76dfa10207f6381
This reverts commit b75f3e4a4278f71d5379d40858df49c8920ca53d.
Reason for revert: Since we have landed all important patches on master branch, we can now revert this change and make jobs voting.
Change-Id: I2f5fa707a2cb7f6ffb38a8b919f224897684c795
The tempest-integrated-storage-import has been timing out
frequently around 2 hour 5 minutes mark and similarly one
of the jobs inheriting from it,
tempest-integrated-storage-import-standalone, also times
out around the same time. The timeout issue has increased
recently as can be seen in the job build history[1].
We had a similar issue with the glance-multistore-cinder-import
job for which we increased the timeout to 3 hours[2] but the
job completes successfully on average 2 hour 10 minutes
and has been completing in that time for more than 8 months
since the change to increase timout landed.
The underlying cause could be due to a lot of reasons:
1. Lower concurrency (3) as compared to parent job (6)
2. More number of tests being added to tempest
3. Slow Devstack installation
4. Slow tempest test execution
5. memory consumption of OpenStack services
increased making environment slow
6. no significant improvement in the hardware
specifications on which we run the job
This patch generalizes the timeout to the tempest-integrated-storage-import
job so all of it's child jobs also don't face similar timeouts.
Also we are updating timeout for tempest-integrated-storage-enforce-scope-new-defaults
job as we see similar time out issues in that job.
[1] https://zuul.opendev.org/t/openstack/builds?job_name=tempest-integrated-storage-import&skip=0
[2] 64e6da6fe1
Change-Id: I7165bb8c588659362b7b36394111c41772ac802d
This merely recognizes this format and always marks it as unsafe
because no service supports it. This prevents someone from uploading
one that we will ask qemu-img to inspect.
Change-Id: Ieea7b7eb0f380571bd4937cded920776e05f7ec4
This causes us to use the format inspector to pre-examine qcow and
vmdk files for safe configurations before even using qemu-img
on them.
Change-Id: I0554706368e573e11f649c09569f7c21cbc8634b
Closes-Bug: #2059809
This makes us check the extent filenames to make sure they don't
have any banned characters in them (i.e. slashes). It also makes
us reject VMDK files with a footer. Since we process these files
as a stream, we can't honor a footer that directs us to find the
descriptor block in a location we've already processed. Thus, if
a file indicates it has a footer, consider it a policy exception
and unsupported.
Change-Id: I4a1c6dff7854c49940a0ac7988722aa6befc04fa
This adds two properties to the QcowInspector that makes it able to
indicate whether the file specifies a backing_file or data_file in the
header. Both conditions are considered unsafe for our usage. To
ease checking of this condition, a classmethod is added that takes
a local filename and digests just enough of the file to assert that
both conditions are false.
Change-Id: Iaf86b525397d41bd116999cabe0954a0a7efac65
Related-Bug: #2059809
Recent changes does not allow image conversion to convert an image
having AMI disk format for image. Passing list of disk-formats to
each import job which will now use qcow2 as default disk-format to
create the image.
Change-Id: I712b304ebe168705ec2793626f5d64135ad6d458