dmidecode - Checking a Host is VM or Physical One?

When you are accessing a server via ssh (in this case linux), sometimes you would like to know if the host is a 'vm' or a 'physical' server.

dmidecode -s system-manufacturer

[VMware Workstation]
dmidecode -s system-manufacturer
VMware, Inc.

[Physical Server]
# dmidecode -s system-manufacturer
HP

Other useful dmidecode commands.

# dmidecode -type {Number}

0 BIOS
1 System
2 Base Board
3 Chassis
4 Processor
5 Memory Controller
6 Memory Module
7 Cache
8 Port Connector
9  System Slots
10 On Board Devices
11 OEM Strings
12 System Configuration Options
13 BIOS Language
14 Group Associations
15 System Event Log
16 Physical Memory Array
17 Memory Device
18 32-bit Memory Error
19 Memory Array Mapped Address
20 Memory Device Mapped Address
21 Built-in Pointing Device
22 Portable Battery
23 System Reset
24 Hardware Security
25 System Power Controls
26 Voltage Probe
27 Cooling Device
28 Temperature Probe
29 Electrical Current Probe
30 Out-of-band Remote Access
31 Boot Integrity Services
32 System Boot
33 64-bit Memory Error
34 Management Device
35 Management Device Component
36 Management Device Threshold Data
37 Memory Channel
38 IPMI Device
39 Power Supply

hpacucli - Checking Serial Number for Failed HDD

If you do not have access to an iLO to check your failed HDD serial number, you can get it from your host, in this case linux, using hpacucli.

HPACUCLI --> HP Array Configuration Utility CLI

Display Controller and Disk Status
=> ctrl all show config

Smart Array P410i in Slot 0 (Embedded)    (sn: 50123456789ABCDE)

   array A (SAS, Unused Space: 0  MB)


      logicaldrive 1 (273.4 GB, RAID 1+0, Interim Recovery Mode)

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 146 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 146 GB, Failed)
      physicaldrive 1I:1:3 (port 1I:box 1:bay 3, SAS, 146 GB, OK)
      physicaldrive 1I:1:4 (port 1I:box 1:bay 4, SAS, 146 GB, OK)

   array B (SAS, Unused Space: 0  MB)


      logicaldrive 2 (136.7 GB, RAID 1, OK)

      physicaldrive 2I:1:5 (port 2I:box 1:bay 5, SAS, 146 GB, OK)
      physicaldrive 2I:1:6 (port 2I:box 1:bay 6, SAS, 146 GB, OK)

   SEP (Vendor ID PMCSIERA, Model  SRC 8x6G) 250 (WWID: 50123456789ABCED)

Display Serial number for failed HDD
=> ctrl slot=0 pd 1I:1:2 show detail

Smart Array P410i in Slot 0 (Embedded)

   array A

      physicaldrive 1I:1:2
         Port: 1I
         Box: 1
         Bay: 2
         Status: Failed
         Last Failure Reason: Hardware error
         Drive Type: Data Drive
         Interface Type: SAS
         Size: 146 GB
         Rotational Speed: 10000
         Firmware Revision: HPD5
         Serial Number: 3NM0FD9900009723E8CM
         Model: HP      DG146ABAB4
         Current Temperature (C): 47
         Maximum Temperature (C): 54
         PHY Count: 1
         PHY Transfer Rate: 3.0Gbps

Other useful hpacucli commands.


hponcfg - Configure iLO IP and Password from Linux

Make sure hponcfg already installed.

To configure iLO need to prepare a XML script (i.e: ilo-ip-setting.xml) as below,

<RIBCL VERSION="2.0">
 <LOGIN USER_LOGIN="xxx" PASSWORD="xxx">
 <RIB_INFO MODE="WRITE" >
 <MOD_NETWORK_SETTINGS>
 <IP_ADDRESS VALUE = "10.10.10.10"/>
 <SUBNET_MASK VALUE = "255.255.255.0"/>
 <GATEWAY_IP_ADDRESS VALUE = "10.10.10.1"/>
 <PRIM_DNS_SERVER value = "0.0.0.0"/>
 <DHCP_ENABLE VALUE = "N"/>
 </MOD_NETWORK_SETTINGS>
 </RIB_INFO>
 </LOGIN>
</RIBCL>

Set IP via hponcfg.
[root@mylnx]# /sbin/hponcfg -f ilo-ip-setting.xml
HP Lights-Out Online Configuration utility
Version 4.6.0 Date 09/28/2015 (c) Hewlett-Packard Company, 2015
Firmware Revision = 1.78 Device type = iLO 2 Driver name = hpilo
<INFORM>Integrated Lights-Out will reset at the end of the script.</INFORM>

Please wait while the firmware is reset. This might take a minute
Script succeeded

To set a password, prepare a XML file something like below,
<RIBCL VERSION="2.0">
  <LOGIN USER_LOGIN="xxx" PASSWORD="xxx">
  <USER_INFO MODE="write">
    <MOD_USER USER_LOGIN="Administrator">
      <PASSWORD value="pa$$word"/>
    </MOD_USER>
  </USER_INFO>
  </LOGIN>

</RIBCL>
Note: the <LOGIN> element must be there, but could be anything such above example.

To get current configuration,
[root@mylnx]# /sbin/hponcfg -w myilo.xml
HP Lights-Out Online Configuration utility
Version 4.6.0 Date 09/28/2015 (c) Hewlett-Packard Company, 2015
Firmware Revision = 1.78 Device type = iLO 2 Driver name = hpilo
Management Processor configuration is successfully written to file "myilo.xml"

And we can read our current configuration in the myilo.xml file.
[root@mylnx]# cat myilo.xml

Ref:
https://support.hpe.com/hpsc/doc/public/display?docId=emr_na-a00007610en_us