Skip to content

[FEATURE] Longhorn UI supports orphaned instance CRs management #10760

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

Closed
COLDTURNIP opened this issue Apr 21, 2025 · 6 comments
Closed

[FEATURE] Longhorn UI supports orphaned instance CRs management #10760

COLDTURNIP opened this issue Apr 21, 2025 · 6 comments
Assignees
Labels
area/orphan Longhorn orphaned resource related like replica, backup area/ui UI related like UI or CLI kind/feature Feature request, new feature priority/1 Highly recommended to implement or fix in this release (managed by PO) require/doc Require updating the longhorn.io documentation require/manual-test-plan Require adding/updating manual test cases if they can't be automated
Milestone

Comments

@COLDTURNIP
Copy link
Contributor

COLDTURNIP commented Apr 21, 2025

Is your feature request related to a problem? Please describe (👍 if you like this request)

Longhorn UI supports orphan instance CRs

  • List
  • Deletion

Initial story: #6764
LEP: #10675

Describe the solution you'd like

The existing LH manager orphan API returns all types of orphans:

  • replica: orphaned data
  • engine-instance: orphaned engine instance
  • replica-instance: orphaned replica instance

To the existed orphaned data page, it should filter and list only the replica orphans.

Add a new page for instance orphans, and shows the details of orphaned instances:

  • name
  • node (OrphanSpec.NodeID)
  • instance name (OrphanSpec.Parameters["InstanceName"])
  • instance type (OrphanSpec.Type)
  • data engine type (OrphanSpec.DataEngine)

Also provides delete operation for orphaned instances.

Describe alternatives you've considered

No response

Additional context

No response

@COLDTURNIP COLDTURNIP added area/orphan Longhorn orphaned resource related like replica, backup area/ui UI related like UI or CLI kind/feature Feature request, new feature require/doc Require updating the longhorn.io documentation require/lep Require adding/updating enhancement proposal require/manual-test-plan Require adding/updating manual test cases if they can't be automated labels Apr 21, 2025
@COLDTURNIP COLDTURNIP added this to the v1.9.0 milestone Apr 21, 2025
@github-project-automation github-project-automation bot moved this to New Issues in Longhorn Sprint Apr 21, 2025
@derekbit derekbit added priority/1 Highly recommended to implement or fix in this release (managed by PO) and removed require/lep Require adding/updating enhancement proposal labels Apr 21, 2025
@houhoucoop houhoucoop moved this from New Issues to Analysis and Design in Longhorn Sprint Apr 22, 2025
@houhoucoop
Copy link

@COLDTURNIP @derekbit
For instance orphans, do we want to display Instance Manager in the table?

{
  "dataEngine": "v1",
  "name": "orphan-e13d8ae15d8bd350b6077b8fd9aab06679af08646c41cde7689e6b6c90af0b56",
  "nodeID": "libvirt-ubuntu-k3s-worker2",
  "orphanType": "engine-instance",
  "parameters": {
    "InstanceManager": "instance-manager-b87f10b867cec1dca2b814f5e78bcc90",
    "InstanceName": "pvc-db8a930f-1f88-473e-bf45-b49232d6eb70-e-0"
  },
  "type": "orphan",
  ...
}

@derekbit
Copy link
Member

Why not? Sounds good to me. ;)

@COLDTURNIP @derekbit For instance orphans, do we want to display Instance Manager in the table?

{
  "dataEngine": "v1",
  "name": "orphan-e13d8ae15d8bd350b6077b8fd9aab06679af08646c41cde7689e6b6c90af0b56",
  "nodeID": "libvirt-ubuntu-k3s-worker2",
  "orphanType": "engine-instance",
  "parameters": {
    "InstanceManager": "instance-manager-b87f10b867cec1dca2b814f5e78bcc90",
    "InstanceName": "pvc-db8a930f-1f88-473e-bf45-b49232d6eb70-e-0"
  },
  "type": "orphan",
  ...
}

@houhoucoop houhoucoop moved this from Analysis and Design to Ready For Testing in Longhorn Sprint Apr 28, 2025
@houhoucoop houhoucoop moved this from Ready For Testing to New Issues in Longhorn Sprint Apr 28, 2025
@houhoucoop houhoucoop moved this from New Issues to Review in Longhorn Sprint Apr 28, 2025
@longhorn-io-github-bot
Copy link
Collaborator

longhorn-io-github-bot commented Apr 28, 2025

Pre Ready-For-Testing Checklist

  • Where is the reproduce steps/test steps documented?
    The reproduce steps/test steps are at:
  • Navigate to the orphaned data page
  • Verify that the tabs Replica Orphans and Instance Orphans are visible
  • Ensure the Replica Orphans tab displays orphan type replica data
  • Click the Instance Orphans tab and ensure it shows orphan type engine-instance and replica-instance data
  • Verify that the filter functionality works correctly
  • Ensure the delete action works correctly
Screen.Recording.2025-04-28.at.5.15.08.PM.mov
  • 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 feat: Longhorn UI supports orphaned instance CRs management longhorn-ui#905

  • If labeled: require/doc Has the necessary document PR submitted or merged (including backport-needed/*)?
    The documentation issue/PR is at

  • 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

@houhoucoop houhoucoop moved this from Review to Ready For Testing in Longhorn Sprint Apr 30, 2025
@yangchiu yangchiu moved this from Ready For Testing to Testing in Longhorn Sprint May 5, 2025
@yangchiu
Copy link
Member

yangchiu commented May 5, 2025

Tested on master-head (longhorn-ui 2dcfe4a). Replica Data Orphans and Instance Orphans can be displayed without problems, but there are some issues related to orphaned data deletion:

(1) Given multiple replica data orphans, select one replica data orphan, and click the bulk delete button, all replica data orphans will disappear. Need to refresh the page to make the remaining replica data orphans be displayed again:

Image

(2) Given multiple replica data orphans, select one replica data orphan, and click the delete button in the hamburger icon, instance orphans will be displayed instead. Need to refresh the page to make the remaining replica data orphans be displayed correctly:

Image

(3) Given multiple instance orphans, select one instance orphan, and click the bulk delete button, the selected instance orphans is still displayed. Need to refresh the page to make it disappear:

Image

@yangchiu yangchiu moved this from Testing to Review in Longhorn Sprint May 5, 2025
@houhoucoop
Copy link

Tested on master-head (longhorn-ui 2dcfe4a). Replica Data Orphans and Instance Orphans can be displayed without problems, but there are some issues related to orphaned data deletion:

The delete issues are known and should be handled in #10803.

@yangchiu
Copy link
Member

yangchiu commented May 5, 2025

Verification passed on master-head (longhorn-ui 2dcfe4a) and v1.9.x-head (longnorn-ui 16c7409). Creating Replica Data Orphans and Instance Orphans using the following commands:

# Create a volume, and ssh into the instance manager pod on replica's node
$ kubectl exec -it instance-manager-503fdc3c632cd24b477d92f9411260bd -n longhorn-system -- /bin/sh

sh-4.4# cd /host/var/lib/longhorn/replicas/
sh-4.4# ls
test-1-1ee97eee

# Create a replica data orphan by copying the replica folder and give it a random name
sh-4.4# cp -r test-1-1ee97eee test-1-1ee97450
sh-4.4# cp -r test-1-1ee97eee test-1-1ee97451
sh-4.4# cp -r test-1-1ee97eee test-1-1ee97452

# Create an orphan engine instance by instance-manager command
sh-4.4# instance-manager process create \
       --name orphan-engine-01-e-0 \
       --binary /engine-binaries/longhornio-longhorn-engine-master-head/longhorn \
       -- \
         --engine-instance-name orphan-engine-01-e-0 \
         controller orphan-engine-01-e-0 \
         --frontend tgt-blockdev \
         --disableRevCounter \
         --size 10485760 \
         --current-size 10485760

# Create an orphan replica instance by instance-manager command
sh-4.4# mkdir -p /host/var/lib/longhorn/replicas/orphan-replica-01-r-0
sh-4.4# instance-manager process create \
       --name orphan-replica-01-r-0 \
       --binary /engine-binaries/longhornio-longhorn-engine-master-head/longhorn \
       -- \
         --volume-name orphan-test-01 \
         replica \
         /host/var/lib/longhorn/replicas/orphan-replica-01-r-0

Replica Data Orphans and Instance Orphans can be displayed correctly, and the filters work as expected, but the Delete operation has issues, which will be tracked in #10803.

@yangchiu yangchiu closed this as completed May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/orphan Longhorn orphaned resource related like replica, backup area/ui UI related like UI or CLI kind/feature Feature request, new feature priority/1 Highly recommended to implement or fix in this release (managed by PO) require/doc Require updating the longhorn.io documentation require/manual-test-plan Require adding/updating manual test cases if they can't be automated
Projects
Status: Closed
Development

No branches or pull requests

5 participants