VMware Cloud Community
smcadmin
Contributor
Contributor

Validity/accuracy of data being returned??

I'm starting to create a script but the data doesn't look accurate.  I'm just pulling back the names of guest's that are running RHEL so I can create a list of them but comparing the results within vcenter doesn't seem to be accurate.  It may be something within vcenter but how can I refresh the data?  I'm getting most of the guests but I'm missing two of them.  Looking in vcenter, it shows the os the guest is running and everything looks okay compared to some of the other guests.  Here's the command:

get-vm | where-object {$_.guest.osfullname -like "*linux*"}

Any help would be appreciated.

Thanks

0 Kudos
5 Replies
LucD
Leadership
Leadership

Do you have VMware Tools installed on all these guests ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
smcadmin
Contributor
Contributor

I thought vmtools had been installed on all the guests but some where out of date but after looking, a few do not have tools installed.  This may very well be the issue.  I will see if I can install the tools on these vm's and see if that fixes the issue.  I will let you know once I get the tools installed.  Thanks for the quick response.  

0 Kudos
LucD
Leadership
Leadership

You can also check why the filter doesn't work by doing

Get-VM | Select Name,@{N="OS";E={$_.guest.osfullname}}

Perhaps some guests have a blank in the osfullname property.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
smcadmin
Contributor
Contributor

LucD,  there are several that are blank in the osfullname property.  How does this get populated?  Sorry for all the questions, I'm just learning power cli.

Thanks

0 Kudos
LucD
Leadership
Leadership

No problem, we all started at one point.Smiley Happy

Most of the properties under the Guest property are populated through the VMware Tools.

Or sometimes these properties are reset to blank when the guest has been powered off for a longer period.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos