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

Incomplete list of VMs returned with ls #1173

Closed
stv-io opened this issue Jul 10, 2018 · 2 comments
Closed

Incomplete list of VMs returned with ls #1173

stv-io opened this issue Jul 10, 2018 · 2 comments

Comments

@stv-io
Copy link

stv-io commented Jul 10, 2018

I'm not sure if this is a case of RTFM (or lack thereof) but it seems that when I try and get a list of all VMs, the number of machines returned is not the total number of machines in the Datacentre.

To reproduce (tried it on different instances / datacentres)

[~] govc ls -l '*' | grep "VirtualMachine" |wc -l
     170

(should be 228, vcentre 6.5)

[~] govc ls -l '*' | grep "VirtualMachine" |wc -l
     96

(should be 124, vcentre 5.5)

Is this a govc issue? Or a human error?

Alternatively,

[~] govc ls /<DC name>/vm | wc -l returns 177 (for the first cluster)

@stv-io
Copy link
Author

stv-io commented Jul 10, 2018

further update, same information is returned from datacentre.info

[~] govc datacenter.info
Name:                Name
  Path:              Path
  Hosts:             9
  Clusters:          2
  Virtual Machines:  170
  Networks:          13
  Datastores:        18

@dougm
Copy link
Member

dougm commented Jul 10, 2018

ls does not recurse into folders by default. You can use one of:

% govc ls -t VirtualMachine /...
% govc find / -type m

The datacenter.info command does need fixing, let's leave this issue open for that.

@dougm dougm closed this as completed in 43ff04f Feb 7, 2019
dougm added a commit that referenced this issue Feb 7, 2019
dougm added a commit to dougm/govmomi that referenced this issue Sep 6, 2019
With nested folders, the cluster and host count was 0.

Issue vmware#1173 fix the VM count in this case, but clusters and hosts count did not include folders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants