VMware Cloud Community
A_S
Enthusiast
Enthusiast
Jump to solution

How to get IP/MAC info of ILO board as shown in hardware status tab

Hi,

I know that there are HP scripts to collect IPC/MAC info of ILO board (hpconfg get_network.xml) and then use VMware powercli IPMI script to feed DPM.

as published on http://www.vpeeling.com/?tag=scripting

Add-PSSnapin vmware.VimAutomation.core -ErrorAction SilentlyContinue

Connect-VIserver -Server your.vcenter.server

$VMHosts = @(Import-Csv "C:\scripts\host-info.csv")

$IPMIUser = "dpmuser"
$IPMIPass = "dpmpass"

foreach ($VMhost in $VMHosts) {

$esxMoRef = get-vmhost $VMHost.Hostname | % {Get-View $_.Id}
$IpmiInfo = New-Object Vmware.Vim.HostIpmiInfo
$IpmiInfo.BmcIpAddress = $VMHost.iLOIP
$IpmiInfo.BmcMacAddress = $VMHost.iLOMAC
$IpmiInfo.Login = $IPMIUser
$IpmiInfo.Password = $IPMIPass
$esxMoRef.UpdateIpmi($IpmiInfo)

}

But, the question i got recently. How can we pull this info through vCenter? The vClient has the tab named Hardware status and we see that info.

hw_status.PNG

Has anyone tried this path?

Powercli or SDK (C#), its doesn't matter.

thanks in advance

A.S.

Reply
0 Kudos
1 Solution

Accepted Solutions
kll
Contributor
Contributor
Jump to solution

You may have got a solution by now...

Anyway, I found this function (Get-VMHostWSManInstance) which works great:


http://blogs.vmware.com/vipowershell/2009/03/monitoring-esx-hardware-with-powershell.html

The hard part is to identify which CIM class contains the BMC IP/MAC address (in my case I just need IP address). After digging into this doc:

http://www.vmware.com/support/developer/cim-sdk/smash/u3/ga/apirefdoc/OMC_IPMIIPProtocolEndpoint.htm...

I was fortunate to locate it: OMC_IPMIIPProtocolEndpoint


Calling Get-VMHostWSManInstance:

Get-VMHostWSManInstance -VMHost (get-vmhost "vmhost1") -class OMC_IPMIIPProtocolEndpoint -ignoreCertFailures | Select IPv4Address, MACAddress

will give BMC IP/MAC address.

BTW, I'm using PowerCLI 5.0.1 on Windows 7, the host is ESX 4.x

View solution in original post

Reply
0 Kudos
8 Replies
LucD
Leadership
Leadership
Jump to solution

Have a look at IPMI Settings using PowerCLI.


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

Reply
0 Kudos
A_S
Enthusiast
Enthusiast
Jump to solution

Well, we are both refering to the same script. As far as i understand is: you need info (IP/MAC/Host) on csv file in order to feed DPM (that is where the script of vpeeling.com comes in picture)

I want to be able to collect info without using HP tool hpconfg. I know that this info can be retrieved by VMware API (i guess WSMAN) because it's shown there as part of Hardware-status info.

thanks for supporting this community

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Oops, didn't notice it was the same link.

There is also an ILO PS library ,perhaps that offers some possibilities.

Or else you could connect with SSH to the ILO board.


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

A_S
Enthusiast
Enthusiast
Jump to solution

Almost, nice tips.

I'll stick with this... It's not the way i want though.

for /f %i in (enclosures.txt) do @echo %i >> result.txt & plink -ssh -l myuserid -pw "mypwd" %i hponcfg all ftp://myftpserver/Scripts/Get_Network.xml >> result.txt

and pull the info from XML result .

    <MAC_ADDRESS VALUE="<ILO_BOARD_MAC>"/>
    <IP_ADDRESS VALUE="<ILO_IP"/>
    <DNS_NAME VALUE="<ESX_HOST_NAME>"/>

and save them to CSV file which in turn can be used to feed DPM with IPMI settings by using csv file.

I'm still curious how does vmware show the info on hardware-status tab. It must be there.

thanks for pointing me to these pages/sites.

Reply
0 Kudos
dan13476
Contributor
Contributor
Jump to solution

I was also after the MAC of the BMC, and couldn't find a way to get the data from Hardware status. As I know the IP I resorted to this in a loop for all my hosts:

$bmcip = "yourbmcipaddress"

if (ping -n 1 $bmcip) {
$bmcmac = (arp -a $bmcip | select-string $bmcip | %{ $_.ToString().Split(' ')[14] })
$bmcmac = $bmcmac.Replace('-',':')
}
else { Write-Host "Can't find BMC MAC address, sorry. Exiting." ;exit }

Dan.

Reply
0 Kudos
kll
Contributor
Contributor
Jump to solution

You may have got a solution by now...

Anyway, I found this function (Get-VMHostWSManInstance) which works great:


http://blogs.vmware.com/vipowershell/2009/03/monitoring-esx-hardware-with-powershell.html

The hard part is to identify which CIM class contains the BMC IP/MAC address (in my case I just need IP address). After digging into this doc:

http://www.vmware.com/support/developer/cim-sdk/smash/u3/ga/apirefdoc/OMC_IPMIIPProtocolEndpoint.htm...

I was fortunate to locate it: OMC_IPMIIPProtocolEndpoint


Calling Get-VMHostWSManInstance:

Get-VMHostWSManInstance -VMHost (get-vmhost "vmhost1") -class OMC_IPMIIPProtocolEndpoint -ignoreCertFailures | Select IPv4Address, MACAddress

will give BMC IP/MAC address.

BTW, I'm using PowerCLI 5.0.1 on Windows 7, the host is ESX 4.x

Reply
0 Kudos
A_S
Enthusiast
Enthusiast
Jump to solution

Fantastic, i knew it was possible!

This is definitily important for those admins out there utilizing DPM functionality.

Thank you!

Reply
0 Kudos
kll
Contributor
Contributor
Jump to solution

Good to know it helps!

Reply
0 Kudos