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] DatacentersFolders.VmFolder is not a complete path when datacenter is in a datacenter folder. #3523

Closed
jcpowermac opened this issue Aug 16, 2024 · 3 comments · Fixed by #3524

Comments

@jcpowermac
Copy link

Describe the bug

DatacentersFolders.VmFolder is not a complete path when datacenter is in a datacenter folder.

using this snipit and output as the example

	dc, err := finder.Datacenter(ctx, failureDomain.Topology.Datacenter)
        if err != nil {
                return err
        }

        dcFolders, err := dc.Folders(ctx)
        if err != nil {
                return fmt.Errorf("unable to get datacenter folder: %w", err)
        }


        logrus.Debugf("datacenter inventory path: %s", dc.InventoryPath)

        logrus.Debugf("datacenter vm folder inventory path: %s\n", folderPath)

output

DEBUG datacenter inventory path: /dcfolder/dcfolder1/dcfolder2/nested8-datacenter 
DEBUG datacenter vm folder inventory path: /nested8-datacenter/vm/jcallen3-rlr9v 

To Reproduce
Steps to reproduce the behavior:

  1. always, see above

Expected behavior

The DatacenterFolders.VmFolder is the full complete path to /vm
(for our example that is /dcfolder/dcfolder1/dcfolder2/nested8-datacenter/vm)

Affected version
github.com/vmware/govmomi v0.37.2

Copy link
Contributor

Howdy 🖐   jcpowermac ! 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.

dougm added a commit to dougm/govmomi that referenced this issue Aug 17, 2024
The {vm,host,datastore,network} folders are always relative to a Datacenter InventoryPath.
However, the Datacenter.Folders method was using the Datacenter name, rather than InventoryPath.

Fixes vmware#3523
dougm added a commit to dougm/govmomi that referenced this issue Aug 17, 2024
The {vm,host,datastore,network} folders are always relative to a Datacenter InventoryPath.
However, the Datacenter.Folders method was using the Datacenter name, rather than InventoryPath.

Fixes vmware#3523
@dougm
Copy link
Member

dougm commented Aug 17, 2024

@jcpowermac , looks like you already worked around, but fix is merged. This bug has been there almost 9 years, sigh.

@jcpowermac
Copy link
Author

Thanks @dougm !

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.

2 participants