Longhorn: Create PV/PVC in Namespace of restored volume for batch operation

Created on 3 Dec 2019  路  6Comments  路  Source: longhorn/longhorn

If the restored volume already has a namespace, restore it to that namespace.

image

areui enhancement

All 6 comments

The Namespace field is already restored with volume.

Actually we already have this feature. You are using batch operation (the button on the top) hence there won't contain a default value here. If you create PV/PVC via the button on the right of the volume then check Use Previous PVC, the restored Namespace value will be applied to this blank automatically.
Screen Shot 2019-12-04 at 12 17 31 PM

The Namespace field is already restored with volume.

Actually we already have this feature. You are using batch operation (the button on the top) hence there won't contain a default value here. If you create PV/PVC via the button on the right of the volume then check Use Previous PVC, the restored Namespace value will be applied to this blank automatically.
Screen Shot 2019-12-04 at 12 17 31 PM

It would have to be individually done to a few hundred volumes?

@ainiml We will support it in the batch operation too.

Validation: Partially Failed

  • Longhorn UI image: wangsiye/longhorn-ui:661911d

Steps to test:

  • Create a namespace using kubectl create ns ns1
  • Create a StatefulSet in ns1 namespace using:
    kubectl apply -n ns1 -f https://raw.githubusercontent.com/longhorn/longhorn/master/examples/statefulset.yaml
  • Scale StatefulSet up to 3 using kubectl scale statefulset -n ns1 web --replicas=3
  • Create backup for each Longhorn volume.
  • Scale StatefulSet down to 0 using kubectl scale statefulset -n ns1 web --replicas=0
  • Delete all 3 Longhorn volumes.
  • In Backup page, restore each volume using the original volume name.

Expected Result: volumes should be restored successfully, PV/PVC field should be Bound, and Namespace field should be ns1 (PASS)

  • Scale StatefulSet back to 3
    Expected Result: volumes gets attached to newly created StatefulSet pods. (PASS)
  • In Backup page, restore each volume using the different volume name than its original volume name.
  • In volume page, select 2 volumes, and click Create PV/PVC button.
  • check Use Previous PVC and click OK.
    Expected Result: a new PV/PVC will be created for each volume in ns1 namespace. (PASS)
  • for the 3rd restored volume, using the Operation menu on the right, click Create PV/PVC

An empty page with the following error on console (FAILED)

image

Validation: Partially Failed

  • Longhorn UI image: wangsiye/longhorn-ui:9787bfb

Steps to test:

  • Create a namespace using kubectl create ns ns1
  • Create a StatefulSet in ns1 namespace using:
    kubectl apply -n ns1 -f https://raw.githubusercontent.com/longhorn/longhorn/master/examples/statefulset.yaml
  • Scale StatefulSet up to 3 using kubectl scale statefulset -n ns1 web --replicas=3
  • Create backup for each Longhorn volume.
  • Scale StatefulSet down to 0 using kubectl scale statefulset -n ns1 web --replicas=0
  • Delete all 3 Longhorn volumes.
  • Delete created PVs and PVCs.
  • In Backup page, click Restore Latest Backup for each volume using a different volume name than its original volume name.
  • In volume page, for one volume, using the Operation menu on the right, click Create PV/PVC
  • Check Use Previous PVC, and clic OK

Expected Result: a new PV will be created, and a new PVC will be created using the old PVC name. (PASS)

  • Select other two volumes, and click on Create PV/PVC button.
  • Check Use Previous PVC, and clic OK
    Expected Result: for each volume, a new PV will be created, and a new PVC will be created using the old PVC name (FAILED)
    Error: a new PVC is created with different name than the original PVC.

Validation: Passed

Longhorn UI version: wangsiye/longhorn-ui:d629ffe

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Angelinsky7 picture Angelinsky7  路  8Comments

lucevers picture lucevers  路  4Comments

JLueke picture JLueke  路  3Comments

hillbun picture hillbun  路  6Comments

XzenTorXz picture XzenTorXz  路  4Comments