VMware Cloud Community
Susie82
Contributor
Contributor
Jump to solution

FoundationCoreAndTiBUsage Script with vCenter in return

Hi there,

we are using William Lams Script FoundationCoreAndTiBUsage

from KB 95927 

Now I want to see the vCenter on return too I tried it that way:

 

 

$tmp = [pscustomobject] @{
                VCENTER = $global:DefaultVIServer.Name;
                CLUSTER = $clusterName;
                VMHOST = $vmhostName;
                NUM_CPU_SOCKETS = $sockets;
                NUM_CPU_CORES_PER_SOCKET = $coresPerSocket;
                FOUNDATION_LICENSE_CORE_COUNT = $vsphereLicenseCount;
                VSAN_CORE_COUNT = $coresPerSocket * $sockets;
                VSAN_LICENSE_CORE_COUNT = $vsanLicenseCount;
            }

 

 

But for multiple vcenter connection it only shows the last vcenter in my connected list.

Can anybody help with my problem?

 

Thank you in advance

Susie

 

 

 

Reply
0 Kudos
1 Solution

Accepted Solutions
Susie82
Contributor
Contributor
Jump to solution

Hi LucD,

thanks for your answer and your hint. They way you wrote it didn't work but I figured it out

 

VCENTER = ([System.uri](get-cluster $clustername).ExtensionData.Client.ServiceUrl).Host;

 

I don't know why it didn't work your way, because of my understanding that's almost the same 😁

cheers

Susie

View solution in original post

Reply
0 Kudos
4 Replies
robinjustin88
Contributor
Contributor
Jump to solution

Cool stuffs
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Assuming you did that change in the BuildFoundationUsage function, try with

   VCENTER = ([uri]$cluster.ExtensionData.Client.ServiceUrl).Host


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

Reply
0 Kudos
Susie82
Contributor
Contributor
Jump to solution

Hi LucD,

thanks for your answer and your hint. They way you wrote it didn't work but I figured it out

 

VCENTER = ([System.uri](get-cluster $clustername).ExtensionData.Client.ServiceUrl).Host;

 

I don't know why it didn't work your way, because of my understanding that's almost the same 😁

cheers

Susie

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Most probably because the $cluster variable didn't contain the cluster object.
The error message should give a hint


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

Reply
0 Kudos