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

[BUG] Unable to run govc disk.ls or govc disk.ls -R #3639

Closed
jespinosaitrs opened this issue Dec 5, 2024 · 6 comments · Fixed by #3659
Closed

[BUG] Unable to run govc disk.ls or govc disk.ls -R #3639

jespinosaitrs opened this issue Dec 5, 2024 · 6 comments · Fixed by #3659

Comments

@jespinosaitrs
Copy link

jespinosaitrs commented Dec 5, 2024

Describe the bug
I am unable to run govc disk.ls or govc disk.ls -R. Both fail with the same error:

$ govc disk.ls
govc: 0b5dfeb3-3b76-44c0-a183-6e082734eba5 not found: use 'disk.ls -R' to reconcile datastore inventory

$ govc disk.ls -R
govc: 0b5dfeb3-3b76-44c0-a183-6e082734eba5 not found: use 'disk.ls -R' to reconcile datastore inventory

To Reproduce
Steps to reproduce the behavior:

  1. Run govc disk.ls or govc disk-ls -R.
  2. Wait a few moments.
  3. The error govc: 0b5dfeb3-3b76-44c0-a183-6e082734eba5 not found: use 'disk.ls -R' to reconcile datastore inventory is shown.

Expected behavior
The commands should finish without errors and display the disks or reconcile the disks.

Affected version

$ brew info govc
==> govc: stable 0.46.2 (bottled)
Command-line tool for VMware vSphere

Screenshots/Debug Output

types.RetrieveVStorageObject{
    This: types.ManagedObjectReference{Type:"VcenterVStorageObjectManager", Value:"VStorageObjectManager", ServerGUID:""},
    Id:   types.ID{
        Id: "0b5dfeb3-3b76-44c0-a183-6e082734eba5",
    },
    Datastore:     types.ManagedObjectReference{Type:"Datastore", Value:"datastore-24", ServerGUID:""},
    DiskInfoFlags: nil,
}
&soap.Fault{
    XMLName: xml.Name{Space:"http://schemas.xmlsoap.org/soap/envelope/", Local:"Fault"},
    Code:    "ServerFaultCode",
    String:  "The object or item referred to could not be found.",
    Detail:  struct { Fault types.AnyType "xml:\",any,typeattr\"" }{},
}

Additional context
There are two other identical issues in the repository that were marked as closed:

Copy link
Contributor

github-actions bot commented Dec 5, 2024

Howdy 🖐   jespinosaitrs ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.

@tenthirtyam
Copy link
Contributor

Please update the title from "[BUG]", please.

@jespinosaitrs jespinosaitrs changed the title [BUG] [BUG] Unable to run govc disk.ls or govc disk.ls -R Dec 5, 2024
@jespinosaitrs
Copy link
Author

@tenthirtyam Sorry about that, I forgot to put something in it.

@dougm
Copy link
Member

dougm commented Dec 5, 2024

@jespinosaitrs what is your vCenter version? govc about | grep FullName

How are your disks created and managed, CNS Volumes or ?
iirc, there was a bug at some point (since fixed) with the ReconcileDatastoreInventory impl. We use that API with the disk.ls -R flag.

Either way, we can add a flag to change the error to warning and/or ignored as discussed here:
#2648 (comment)

@jespinosaitrs
Copy link
Author

@dougm Here are the details:

$ govc about | grep FullName
FullName:     VMware vCenter Server 8.0.3 build-24091160

As for the disks, I would say most of them are CNS volumes.

And as long as the tool can output the list of disk I'm fine with any fixes. What I'm trying to do is some scripting to identify and cleanup some orphan disks but not getting even a partial output is making that difficult.

dougm added a commit to dougm/govmomi that referenced this issue 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 vmware#3639

Signed-off-by: Doug MacEachern <dougm@broadcom.com>
dougm added a commit to dougm/govmomi that referenced this issue 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 vmware#3639

Signed-off-by: Doug MacEachern <dougm@broadcom.com>
@dougm dougm closed this as completed in e02de72 Dec 19, 2024
@dougm
Copy link
Member

dougm commented Dec 19, 2024

@jespinosaitrs please review #3659

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants