Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-16604

Ensure size passed from client side is utilized and set while saving the data in backend

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Normal Normal
    • None
    • 2025.2 (Flamingo)
    • openstack-glance
    • Moderate

      Here we will read the size passed from glanceclient or any request source via header `x-openstack-image-size` and pass it to the designated storage backend. This approach will help prevent resize-on-write operations for Cinder and RBD backends and enable the use of the multipart upload feature for the S3 backend. After completing the staging process, we will compare the actual image size to the size provided by the user. If there is a discrepancy, we will reject the image staging, remove the data from the backend, and return an appropriate error message to the user. Additionally, we will log a warning that aligns with the existing checks for image disk format and hash.

       

      If the image size is not included in the request header, we will have no option
      but to allow the storage backends to perform resize-on-write operations or
      to utilize the single-part upload feature for the S3 backend.

      For asynchronous operations (import APIs), such as the glance-direct and
      web-download import methods, we already gather data in a local staging area
      before transferring it to the backend. We will ensure that the image size is
      set before starting the import operation to avoid these resize operations.

              akekane@redhat.com Abhishek Kekane
              akekane@redhat.com Abhishek Kekane
              rhos-storage-glance
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: