knatesan
Contributor
Contributor

To identify the BMC IP address in ESXi console

Jump to solution

hi,

Is there any esxcli command to identify the BMC IP address of the ESXI booted node?

In Linux machine, "ipmitool lan print" will list the IP address of BMC assigned to the node ..

any insights?


0 Kudos
1 Solution

Accepted Solutions
MKguy
Virtuoso
Virtuoso

Unfortunately there doesn't seem to exist a standard builtin esxcli command to query the management controller IP.

But you can query the local CIM providers from the ESXi shell and get the IP like this:

# enum_instances OMC_IPMIIPProtocolEndpoint root/cimv2 | grep IPv4Address

                   IPv4Address = 10.2.1.17

What you can also do is querying the host's CIM information remotely, for example like this:

$ curl -sk https://myesxihost.local:5989/cimom --user root -X POST \

-H 'Content-type: application/xml; charset="utf-8"' \

-H 'CIMMethod: EnumerateInstances' \

-H 'CIMOperation: MethodCall' \

-H 'CIMProtocolVersion: 1.0' \

-H 'CIMObject: root/cimv2' \

--data '<?xml version="1.0" encoding="UTF-8"?>

<CIM CIMVERSION="2.0" DTDVERSION="2.0">

  <MESSAGE ID="882670" PROTOCOLVERSION="1.0">

    <SIMPLEREQ>

      <IMETHODCALL NAME="EnumerateInstances">

        <LOCALNAMESPACEPATH>

          <NAMESPACE NAME="root"/>

          <NAMESPACE NAME="cimv2"/>

        </LOCALNAMESPACEPATH>

        <IPARAMVALUE NAME="ClassName">

          <CLASSNAME NAME="OMC_IPMIIPProtocolEndpoint"/>

        </IPARAMVALUE>

      </IMETHODCALL>

    </SIMPLEREQ>

  </MESSAGE>

</CIM>' | grep -A1 IPv4Address

Enter host password for user 'root':

<PROPERTY NAME="IPv4Address" TYPE="string">

<VALUE>10.2.1.17</VALUE>


These are generic CIM methods that should work with any standard IPMI device and do not require any special drivers/extensions by a hardware vendor.

-- http://alpacapowered.wordpress.com

View solution in original post

0 Kudos
8 Replies
admin
Immortal
Immortal

Hi,

You need to configure BMC from ESXi, Please follow the steps to configure as below

http://blog.rchapman.org/post/17480234232/configuring-bmc-drac-from-esxi-or-linux

Regards,

Nitesh

0 Kudos
MKguy
Virtuoso
Virtuoso

What kind of hardware are you running?

On a HP server with ILO you can use the hponcfg utility that comes with the HP utility bundle (e.g. if you installed it with an HP-branded ISO):

# /opt/hp/tools/hponcfg -g

HP Lights-Out Online Configuration utility

Version 4.0-12 (c) Hewlett-Packard Company, 2011

Firmware Revision = 1.51 Device type = iLO 4 Driver name = hpilo

iLO IP Address: 10.2.1.11

Host Information:

                        Server Name: someesxihost.local

                        Server Serial Number: xxxxxxxx

Otherwise you probably have to resort to compiling the ipmi binary yourself as explained in the link above.

-- http://alpacapowered.wordpress.com
knatesan
Contributor
Contributor

Thanks for the response!..

I have DELL,Supermicro,IBM server..

is there any ESXCLI command to discover the BMC ip address in In-band. ?

0 Kudos
MKguy
Virtuoso
Virtuoso

Unfortunately there doesn't seem to exist a standard builtin esxcli command to query the management controller IP.

But you can query the local CIM providers from the ESXi shell and get the IP like this:

# enum_instances OMC_IPMIIPProtocolEndpoint root/cimv2 | grep IPv4Address

                   IPv4Address = 10.2.1.17

What you can also do is querying the host's CIM information remotely, for example like this:

$ curl -sk https://myesxihost.local:5989/cimom --user root -X POST \

-H 'Content-type: application/xml; charset="utf-8"' \

-H 'CIMMethod: EnumerateInstances' \

-H 'CIMOperation: MethodCall' \

-H 'CIMProtocolVersion: 1.0' \

-H 'CIMObject: root/cimv2' \

--data '<?xml version="1.0" encoding="UTF-8"?>

<CIM CIMVERSION="2.0" DTDVERSION="2.0">

  <MESSAGE ID="882670" PROTOCOLVERSION="1.0">

    <SIMPLEREQ>

      <IMETHODCALL NAME="EnumerateInstances">

        <LOCALNAMESPACEPATH>

          <NAMESPACE NAME="root"/>

          <NAMESPACE NAME="cimv2"/>

        </LOCALNAMESPACEPATH>

        <IPARAMVALUE NAME="ClassName">

          <CLASSNAME NAME="OMC_IPMIIPProtocolEndpoint"/>

        </IPARAMVALUE>

      </IMETHODCALL>

    </SIMPLEREQ>

  </MESSAGE>

</CIM>' | grep -A1 IPv4Address

Enter host password for user 'root':

<PROPERTY NAME="IPv4Address" TYPE="string">

<VALUE>10.2.1.17</VALUE>


These are generic CIM methods that should work with any standard IPMI device and do not require any special drivers/extensions by a hardware vendor.

-- http://alpacapowered.wordpress.com

View solution in original post

0 Kudos
delagos
Contributor
Contributor

Late reply, but...  Note, this is definitely not the exact answer but I recently had the need for the same information.  This is a way of mining the BMC IP info from vcenter or the vmhost using powercli that's useful for dumping that info for a whole slew of hosts.  I got this from another thread somewhere and I thought it would be a good alternative for this question in case it didn't come up in a similar search:

$vmHostCol = Get-VMHost vmhostnames
foreach($h in $vmHostCol) {
    $hv = $h | Get-View
    $CIMServicesTicket = $hv.AcquireCimServicesTicket()
    $Password = ConvertTo-SecureString $CIMServicesTicket.SessionId -AsPlainText -Force
    $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $CIMServicesTicket.SessionId, $Password
    $CIOpt = New-CimSessionOption -SkipCACheck -SkipCNCheck -SkipRevocationCheck -Encoding Utf8 -UseSsl
    $Session = New-CimSession -Authentication Basic -Credential $Credential -ComputerName $hv.name -port 443 -SessionOption $CIOpt
    $ILO = Get-CimInstance -CimSession $Session -ClassName CIM_ServiceAccessPoint | Where {$_.SystemName -match "Management"}
    Write-Host "ESXi-System: "  $ILO.PSComputerName " BMC-IP: "  $ILO.IPv4Address
}

Hope this helps.

0 Kudos
krobertsIAA
Contributor
Contributor

This answer helped me and was much simpler than any other method. It can also be automated due to being through PowerCLI.

If it were sooner I'd vote this to be the correct answer. Tested with IBM RSA cards.

0 Kudos
jtessier72
Contributor
Contributor

(Tested with ESXi 6.7)

This works from a command line, and doesn't require Dell HW or any custom VIB. Tested on vanilla Intel SW2600.

Found: Dell - how to get the idrac ip address from vmware esxi 

If you have SSH access to the ESXi server, you can try these two that seem to use ipmi on the local machine:

localcli hardware ipmi bmc get

or

esxcli hardware ipmi bmc get

[root@vmhost:~] localcli hardware ipmi bmc get
IpmiBmcConfig:
BMC Firmware Version: 1.56
IPMI Version: 2.0
IPv4 Address: 172.16.0.2
IPv4 Gateway: 172.16.0.1
IPv4 Subnet: 255.255.255.0
IPv6 Addresses:
LAN ifAdminStatus: true
MAC Address: aa:aa:aa:aa:bc
Manufacturer: Intel Corporation
OS Name Reported:


[root@vmhost:~] esxcli hardware ipmi bmc get
BMC Firmware Version: 1.56
IPMI Version: 2.0
IPv4 Address: 172.16.0.2
IPv4 Gateway: 172.16.0.1
IPv4 Subnet: 255.255.255.0
IPv6 Addresses:
LAN ifAdminStatus: true
MAC Address: aa:aa:aa:aa:bc
Manufacturer: Intel Corporation
OS Name Reported:

0 Kudos
sikderatanu
Contributor
Contributor

try below command

esxcli hardware ipmi bmc get 

0 Kudos