Test upload
- Prepare a large backing image file (make sure the size is greater than 1Gi and the uploading time is longer than 1 minute) in local.
- Click the backing image creation button in UI, choose
Upload From Local
, select the file then start upload. - Wait for the initialization complete. Then the upload progress will be shown.
- During the uploading, verify the corresponding backing image data source pod won’t use too many CPU (50 ~ 200m) and memory(50 ~ 200Mi) resources.
- Open another backing image UI page, the progress can be still found in the backing image detail page.
- When the upload is in progress, refresh the UI page to interrupt the upload.
- Verified that the upload failed without retry (typically the retry will happen after 1~2 minute). And there is a message indicates the failure.
- Delete the failed one then restart the uploading by creating a new backing image.
- Create and attach a volume with the backing image. Verify the data content is correct.
- Do cleanup.
Upload via Rancher URI
Related issue: 3129 with fix in Longhorn v1.3.0+
- With Rancher v2.6.x create a cluster and install Longhorn from Apps & Marketplace
- or import an existing cluster with Longhorn installed
- Open the cluster from Cluster Explorer via Rancher UI
- Open Longhorn from the Cluster Explorer navigation menu
- Click on the Longhorn app to open the UI
- An example URL:
https://rancer.server.domain/k8s/clusters/CLUSTER-ID/api/v1/namespaces/longhorn-system/services/http:longhorn-frontend:80/proxy/#/backingImage
- An example URL:
- Create a new backing image with Upload From Local
- Verify the uploaded image matches its size or checksum
Upload via Ingress Controller
Related issue: 2937 with fix in v1.2.0+
- Install and create Ingress Loadbalancer with proper hostname configuration
- On Rancher v2.6.x Cluster Explorer > open the cluster under testing > Service and Discovery > Ingresses
- Access Longhorn UI with the hostname URL
- Create a new backing image with Upload From Local
- Verify the uploaded image matches its size or checksum
Test CSI backing image
- Create a valid backing image
- Create a StorageClass, which use the same backing image name but different data source type/parameters.
- Create a PVC with the StorageClass.
==> The corresponding creation should fail. The longhorn-csi-plugin will repeatedly print out error logs like this
existing backing image %v data source is different from the parameters in the creation request or StorageClass
. - Delete the PVC and the StorageClass.
- Recreate a StorageClass in which the backing image fields match the existing backing image.
- Create a PVC with the StorageClass. ==> The corresponding volume creation should succeed.
- Delete the PVC and the backing image.
- ReCreate a PVC with the StorageClass. ==> Longhorn will create a backing image then create the corresponding volume.
- Do cleanup.
Test backing image creation via YAML
- Run
echo " apiVersion: longhorn.io/v1beta1 kind: BackingImage metadata: name: bi-test namespace: longhorn-system spec: sourceType: download sourceParameters: url: https://longhorn-backing-image.s3-us-west-1.amazonaws.com/parrot.qcow2 " | kubectl -n longhorn-system apply -f -
- Verify the backing image is created and ready for use.
Notice: It’s better not to create a backing image with type upload
via YAML. Otherwise, you need to find a way to send the upload HTTP request manually.