Upload Large Images on OpenStack

Overview

StarlingX OpenStack handles large raw images (tens of GB, up to 100 GB and beyond) without special tooling.

Important

Three factors ensure large uploads proceed reliably:

  • Enough room on the Kubelet filesystem.

  • Enough Glance workers for concurrent uploads.

  • Horizon’s direct upload mode when uploading from a browser.

  • Enough room on the Glance storage backend (Ceph images pool, glance-images PVC or Cinder Volume pools).

Procedure

  1. Size the Kubelet filesystem.

    Each upload is staged on the controller’s Kubelet filesystem before it lands on the backend. Give it at least 25% more space than your biggest image — 125 GB for a 100 GB image.

    ~(keystone_admin)]$ system host-fs-list controller-0            # see current size
    ~(keystone_admin)]$ system host-fs-modify controller-0 kubelet=125
    

    Note

    On a duplex system, repeat the Kubelet resize on controller-1 so that the image can be staged regardless of which controller is active.

    Note

    When Glance is configured with Cinder as its storage backend, the image is also written to the Cinder storage pool on the primary Cinder backend (Ceph Rook, NetApp or Extended Storage Backend). Each upload consumes pool capacity in addition to the Kubelet filesystem, so size the backend pool to hold your largest images as well as the Kubelet filesystem.

    If cgts-vg is short on space, add a partition to it first (system host-disk-list, system host-disk-partition-add, system host-pv-add).

    If a large upload stalls, this is almost always why. Size it up front.

  2. Size the var filesystem.

    Before copying a large image to /var/opt/openstack, ensure the /var filesystem has sufficient capacity.

    ~(keystone_admin)]$ system host-fs-list controller-0            # see current size
    ~(keystone_admin)]$ system host-fs-modify controller-0 var=125
    
  3. Proceed with the image copy.

    ~(keystone_admin)]$ source /var/opt/openstack/admin-openrc
    ~(keystone_admin)]$ cp ./my-image.img /var/opt/openstack/
    
  4. Upload the image.

    openstack image create my-image \
    --file my-image.img \
    --disk-format raw --container-format bare \
    --shared --progress
    
  5. (Optional) Verify the uploaded image.

    ~(keystone_admin)]$ openstack image show my-image -c status -c size -c checksum
    

    The status should be active with a populated size and checksum.

Add Glance Workers for Concurrent Uploads

Overview

Each image upload is processed by a single Glance worker; consequently, increasing the number of workers does not reduce the duration of an individual upload.

Additional workers become relevant only when multiple uploads are performed concurrently, such as during a continuous integration pipeline or when several users upload images simultaneously. In the absence of additional workers, concurrent uploads are queued sequentially, which reduces overall throughput.

Increase the worker count to match the level of the expected concurrency.

Procedure

  1. Override the Glance worker count and apply the change.

    Set conf.glance.DEFAULT.workers to the number of concurrent uploads you want to support. The following example configures 10 workers.

    ~(keystone_admin)]$ system helm-override-update stx-openstack glance openstack   --set conf.glance.DEFAULT.workers=10
    ~(keystone_admin)]$ system application-apply stx-openstack

    Each parallel upload will be dispatched to a separate worker, so the images transfer concurrently instead of one after another.

    Note

    Each worker consumes additional memory on the controller. Set the worker count to the concurrency you actually need rather than an arbitrarily high value.

Upload from Horizon

For large images from the dashboard, put Horizon in direct mode so the browser sends the image straight to Glance instead of through the dashboard pod. This needs two overrides: the upload mode on Horizon, and a CORS rule on Glance that allows the browser to PUT across origins.

  1. Replace <horizon-fqdn> with your dashboard hostname (for example horizon.example.com).

    horizon.yaml — set the mode via the raw block:

    conf:
    horizon:
       local_settings:
          config:
          raw:
             HORIZON_IMAGES_UPLOAD_MODE: direct
    

    glance.yaml — allow the Horizon origin:

    conf:
    glance:
       cors:
          allowed_origin: "https://<horizon-fqdn>"
          allow_headers: "X-Auth-Token,Content-Type,Accept,X-CSRFToken,X-Requested-With"
          allow_methods: "PUT,OPTIONS"
    
  2. Apply both and wait for the app to settle:

    ~(keystone_admin)]$ system helm-override-update stx-openstack horizon openstack --values horizon.yaml
    ~(keystone_admin)]$ system helm-override-update stx-openstack glance  openstack --values glance.yaml
    ~(keystone_admin)]$ system application-apply stx-openstack
  3. Use the exact Horizon FQDN as allowed_origin, not *. The browser must also trust the Glance endpoint’s CA, so you get a clean padlock on https://<glance-fqdn>/ before uploading.