Skip to content

govc: add disk.ls '-a' flag #3659

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

Merged
merged 1 commit into from
Dec 19, 2024
Merged

govc: add disk.ls '-a' flag #3659

merged 1 commit into from
Dec 19, 2024

Conversation

dougm
Copy link
Member

@dougm dougm commented Dec 19, 2024

Deleting an FCD file backing can create an orphan FCD. An orphaned ID is returned by the ListVStorageObject API, but calling RetrieveVStorageObject with an orphan ID results in a NotFound fault. The disk.ls command would return an error and suggest: use 'disk.ls -R' to reconcile datastore inventory The -R flag calls ReconcileDatastoreInventory, which normally cleans up such orphans, but we have seen cases where it does not.

This change ignores orphans by default. The new '-a' flag will list all orphans (if any) and includes the disk.ls -R suggestion.

Fixes #3639

Example output before change:

% govc disk.ls
govc: 1ad1b6b7-b6e9-4c93-ba4d-bb4139acc08f not found: use 'disk.ls -R' to reconcile datastore inventory

After change:

% govc disk.ls
43acf8ed-9a90-40fe-8ab8-e1102d162eb1  pvc-63f37324-d318-47a8-951b-6e41ab55a509

% govc disk.ls -a
1ad1b6b7-b6e9-4c93-ba4d-bb4139acc08f  not found: use 'disk.ls -R' to reconcile datastore inventory
43acf8ed-9a90-40fe-8ab8-e1102d162eb1  pvc-63f37324-d318-47a8-951b-6e41ab55a509
aa2ec397-330e-4ca1-9367-f803aa6fc571  not found: use 'disk.ls -R' to reconcile datastore inventory

Deleting an FCD file backing can create an orphan FCD. An orphaned ID is returned by the ListVStorageObject API,
but calling RetrieveVStorageObject with an orphan ID results in a NotFound fault.
The disk.ls command would return an error and suggest: use 'disk.ls -R' to reconcile datastore inventory
The -R flag calls ReconcileDatastoreInventory, which normally cleans up such orphans, but we have seen cases where it does not.

This change ignores orphans by default. The new '-a' flag will list *all* orphans (if any) and includes the disk.ls -R suggestion.

Fixes vmware#3639

Signed-off-by: Doug MacEachern <[email protected]>
@dougm dougm merged commit d43d428 into vmware:main Dec 19, 2024
11 checks passed
@dougm dougm deleted the issue-3639 branch December 19, 2024 23:35
Copy link
Contributor

I'm going to lock this pull request because it has been closed for 30 days. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Unable to run govc disk.ls or govc disk.ls -R
2 participants