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.
Has anyone tried this path?
Powercli or SDK (C#), its doesn't matter.
thanks in advance
A.S.
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:
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
Have a look at IPMI Settings using PowerCLI.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
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
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
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.
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"
Dan.
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:
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
Fantastic, i knew it was possible!
This is definitily important for those admins out there utilizing DPM functionality.
Thank you!
Good to know it helps!