Automation

 View Only
  • 1.  How to get the Number of Socket Information

    Posted Nov 07, 2011 08:42 PM

    Hi, I am trying to get the number of sockets and cores per socket information from Powershell. I am using the get-vmhost cmdlet. If, I pipe the output to the get-member cmdlet, I dont see any option wherein I can specify the sockets.
    Can any one please tell me how to get this information.

    Thanks



  • 2.  RE: How to get the Number of Socket Information

    Posted Nov 07, 2011 08:48 PM

    Maybe http://communities.vmware.com/thread/261745 will help you to build the script you need.

    André



  • 3.  RE: How to get the Number of Socket Information

    Posted Nov 07, 2011 08:57 PM

    That info is hidden in the HostSystem object, which you reach through the ExtensionData property

    Get-VMHost | Select Name,@{N="Cores/CPU";E={$_.Extensiondata.Summary.Hardware.NumCpuCores/$_.Extensiondata.Summary.Hardware.NumCpuPkgs}}


  • 4.  RE: How to get the Number of Socket Information

    Posted Nov 07, 2011 09:03 PM

    Can you please explain what you just did :smileyhappy: I am still learning powershell and I am not that advance



  • 5.  RE: How to get the Number of Socket Information

    Posted Nov 07, 2011 09:35 PM

    The Get-VMHost cmdlet retrieves each ESX(i) server from the vCenter to which you are connected.

    That object is passed though the pipeline to the Select-Object cmdlet, which allows us to extract specific properties from the object.

    In this case the information you want to retrieve is not directly available in the .Net object returned by Get-VMHost.

    But it is available in the server-side HostSystem object.

    Through the ExtensionData property we have access to that HostSystem object.

    Finally it a matter of dividing the total number of cores by the number of processor blocks.

    That is done in a so-called calculated property (the @{N="...";E={}} construct, where N stands for Name and E for Expression) on the Select-Object cmdlet.

    I hope this makes it a bit clearer.



  • 6.  RE: How to get the Number of Socket Information

    Posted Nov 07, 2011 10:06 PM

    Thanks for the explanation. Can you please tell me where can I find more information about this.

    Thanks



  • 7.  RE: How to get the Number of Socket Information

    Posted Nov 07, 2011 10:15 PM

    Have a look at the My PS Library post on my blog, it contains a number of pointers to learning resources.

    The recent thread called How to get started?, contains a number of other resources with valuable links