Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI][FEATURE] Support volume cloning using UI #8741

Closed
4 tasks done
PhanLe1010 opened this issue Jun 12, 2024 · 12 comments
Closed
4 tasks done

[UI][FEATURE] Support volume cloning using UI #8741

PhanLe1010 opened this issue Jun 12, 2024 · 12 comments
Assignees
Labels
area/ui UI related like UI or CLI highlight Important feature/issue to highlight kind/feature Feature request, new feature priority/0 Must be implement or fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/doc Require updating the longhorn.io documentation
Milestone

Comments

@PhanLe1010
Copy link
Contributor

PhanLe1010 commented Jun 12, 2024

This is a part of the ticket [FEATURE] Volume cloning enhancement #2907

Some ideas:

  • In the create volume UI, users should be able to create a volume with the data source pointing to another volume or a Longhorn snapshot
  • Users can click on any volume and select clone a new volume from that volume
  • Users can click mutliple volumes to clone them (bulk action for volume clone)
  • Users can click on any snapshot and select clone a new volume from that snapshot

cc @a110605

@PhanLe1010 PhanLe1010 added the kind/task General task request to fulfill another primary request label Jun 12, 2024
@PhanLe1010 PhanLe1010 added this to the v1.7.0 milestone Jun 12, 2024
@PhanLe1010 PhanLe1010 added the priority/0 Must be implement or fixed in this release (managed by PO) label Jun 12, 2024
@a110605
Copy link

a110605 commented Jun 13, 2024

Based on above ideas, UI requirements are

  • In create volume modal, add data source field with two dropdowns for user to choose source types (backing image, snapshot or other volumes) and the source items.
Screenshot 2024-06-13 at 9 03 44 PM

@PhanLe1010 create volume from backing image / snapshot / other volumes sources are mutually exclusive (can only choose one), right?

  • Add new option named Clone Volume in volume table operation dropdown.
Screenshot 2024-06-13 at 8 58 01 PM
  • Add new option named Clone Volume in snapshot dropdown.
Screenshot 2024-06-14 at 10 06 49 AM

@PhanLe1010
Copy link
Contributor Author

Adding highlight label because this is part of the highlighted ticket #2907

Please correct me if this is wrong @innobead @derekbit

@PhanLe1010 PhanLe1010 added the highlight Important feature/issue to highlight label Jun 14, 2024
@PhanLe1010
Copy link
Contributor Author

In create volume modal, add data source field with two dropdowns for user to choose source types (backing image, snapshot or other volumes) and the source items.
@PhanLe1010 create volume from backing image / snapshot / other volumes sources are mutually exclusive (can only choose one), right?

@a110605 A volume can set both:

  1. Backing Image
  2. Datasource (another volume/a snapshot)

So can we keep the backing image field the same and create a dropdown for Datasource (another volume/a snapshot) ?

Add new option named Clone Volume in volume table operation dropdown.

Yes, this one looks good!

Add new option named Clone in snapshot dropdown.

Yes, this one looks good

@a110605
Copy link

a110605 commented Jun 14, 2024

In create volume modal, add data source field with two dropdowns for user to choose source types (backing image, snapshot or other volumes) and the source items.
@PhanLe1010 create volume from backing image / snapshot / other volumes sources are mutually exclusive (can only choose one), right?

@a110605 A volume can set both:

  1. Backing Image
  2. Datasource (another volume/a snapshot)

So can we keep the backing image field the same and create a dropdown for Datasource (another volume/a snapshot) ?

Sure, let's keep original backing image field and add another data source field with two dropdowns to choose volume or snapshot.

Could you also provide the API spec for above three UI changes that I can know how to call API?

@PhanLe1010
Copy link
Contributor Author

Could you also provide the API spec for above three UI changes that I can know how to call API?

Surely, you can use this volumeCreate API https:/longhorn/longhorn-manager/blob/6d936dc7e190110a8c9b216e0b4455e730456467/api/router.go#L70-L71 and pass in the parameter volume.DataSource https:/longhorn/longhorn-manager/blob/6d936dc7e190110a8c9b216e0b4455e730456467/api/model.go#L38-L39 . This is an example of how Longhorn CSI plugin use the API:

  1. Set the parameter in the json payload https:/longhorn/longhorn-manager/blob/6d936dc7e190110a8c9b216e0b4455e730456467/csi/util.go#L207-L214
  2. Make the call https:/longhorn/longhorn-manager/blob/6d936dc7e190110a8c9b216e0b4455e730456467/csi/controller_server.go#L237

@a110605
Copy link

a110605 commented Jun 16, 2024

2. https:/longhorn/longhorn-manager/blob/6d936dc7e190110a8c9b216e0b4455e730456467/csi/controller_server.go#L237

@PhanLe1010 , double confirm to clone volume or create volume from snapshot, just pass snapshot name or volume name in dataSource field in POST /v1/volumes API?

{
   ...params
   "dataSource": [snapshot name or volume name] 
}

@PhanLe1010
Copy link
Contributor Author

PhanLe1010 commented Jun 18, 2024

  1. https:/longhorn/longhorn-manager/blob/6d936dc7e190110a8c9b216e0b4455e730456467/csi/controller_server.go#L237

@PhanLe1010 , double confirm to clone volume or create volume from snapshot, just pass snapshot name or volume name in dataSource field in POST /v1/volumes API?

{
   ...params
   "dataSource": [snapshot name or volume name] 
}

Hi @a110605

  1. If it is created from another volume, pass this "dataSource": "vol://<source-volume-name>"
  2. If it is created from a snapshot of another volume, pass this "dataSource": "snap://<source-volume-name>/<snapshot-name>"

@longhorn-io-github-bot
Copy link

longhorn-io-github-bot commented Jun 27, 2024

Pre Ready-For-Testing Checklist

  • Where is the reproduce steps/test steps documented?
    The reproduce steps/test steps are at:

Single Volume clone

  1. Click Click Volume in volume operation menu
  2. Click "ok" should clone the volume with new one

Single snapshot volume clone

  1. Go to a volume details page
  2. click "Clone Volume" on any snapshot or backup
  3. Should allow user clone volume from this snapshot

Bulk volume clone

  1. Go to volume page
  2. selected some volumes
  3. click clone volume on top of table
  4. should allow user configure each volume and click ok to bulk clone volume.

Note. above three actions should lock (disable) data engine field.

Create volume from snapshot or volume

  1. Go to volume page, click Create Volume
  2. Select "volume" or "volume snapshot" for data source field
  3. Select target volume and target volume snapshot
  4. Click ok to create new volume from snapshot
    See : Support volume cloning in volume and volume detail pages longhorn-ui#760
  • Is there a workaround for the issue? If so, where is it documented?
    The workaround is at:

  • Does the PR include the explanation for the fix or the feature?

  • Does the PR include deployment change (YAML/Chart)? If so, where are the PRs for both YAML file and Chart?
    The PR for the YAML change is at:
    The PR for the chart change is at:

  • Have the backend code been merged (Manager, Engine, Instance Manager, BackupStore etc) (including backport-needed/*)?
    The PR is at

  • Which areas/issues this PR might have potential impacts on?
    Area
    Issues

  • If labeled: require/LEP Has the Longhorn Enhancement Proposal PR submitted?
    The LEP PR is at

  • If labeled: area/ui Has the UI issue filed or ready to be merged (including backport-needed/*)?
    The UI issue/PR is at

  • If labeled: require/doc Has the necessary document PR submitted or merged (including backport-needed/*)?
    The documentation issue/PR is at doc(v1.7.0): add clone volume features from longhorn UI website#940

  • If labeled: require/automation-e2e Has the end-to-end test plan been merged? Have QAs agreed on the automation test case? If only test case skeleton w/o implementation, have you created an implementation issue (including backport-needed/*)
    The automation skeleton PR is at
    The automation test case PR is at
    The issue of automation test case implementation is at (please create by the template)

  • If labeled: require/automation-engine Has the engine integration test been merged (including backport-needed/*)?
    The engine automation PR is at

  • If labeled: require/manual-test-plan Has the manual test plan been documented?
    The updated manual test plan is at

  • If the fix introduces the code for backward compatibility Has a separate issue been filed with the label release/obsolete-compatibility?
    The compatibility issue is filed at

@derekbit
Copy link
Member

derekbit commented Jul 5, 2024

@a110605 Please update Pre Ready-For-Testing Checklist and update the status. Thank you.

@derekbit derekbit changed the title [TASK] Support volume cloning using UI [UI][TASK] Support volume cloning using UI Jul 5, 2024
@derekbit derekbit added the area/ui UI related like UI or CLI label Jul 5, 2024
@yangchiu yangchiu added require/manual-test-plan Require adding/updating manual test cases if they can't be automated require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated and removed require/manual-test-plan Require adding/updating manual test cases if they can't be automated labels Jul 5, 2024
@derekbit derekbit added the require/doc Require updating the longhorn.io documentation label Jul 8, 2024
@chriscchien
Copy link
Contributor

This ticket currently is blocked by #3692 for some clone action failure need to be solved first then verify UI.

@PhanLe1010
Copy link
Contributor Author

Thanks @chriscchien . FIxed. We can resume testing

@chriscchien
Copy link
Contributor

Verified pass on longhorn master(longhorn-ui 8d6025)

Following test steps, did not encounter any problems on volume cloning through UI, in addition, below colne path on attathed and detached source volume worked well too.

  • RWO to RWO
  • RWO to RWX
  • RWX to RWO
  • RWX to RWX

@innobead innobead changed the title [UI][TASK] Support volume cloning using UI [UI][FEATURE] Support volume cloning using UI Jul 12, 2024
@innobead innobead added kind/feature Feature request, new feature and removed kind/task General task request to fulfill another primary request labels Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui UI related like UI or CLI highlight Important feature/issue to highlight kind/feature Feature request, new feature priority/0 Must be implement or fixed in this release (managed by PO) require/auto-e2e-test Require adding/updating auto e2e test cases if they can be automated require/doc Require updating the longhorn.io documentation
Projects
Status: Closed
Development

No branches or pull requests

7 participants