Installing HMC in VirtualBox or VMWare

From AIXWiki

Jump to: navigation, search

In the instructions below I will explain how to install the Hardware Management Console Software into a Virtual Machine. This should also work for VMWare but the instructions are based on VirtualBox.


The instructions is based on the latest HMC version available at the time of writing, which is HMC v7.7 (with Service Pack 1). At the end of the page you will find the modified files for HMC v7.7 (SP1).


1. Download HMC recovery images from Fix Central:

http://www-933.ibm.com/support/fixcentral/

Product Group: System p
Product: Firmware and HMC
Processor type: POWER5 and POWER6 class
Machine Type-Model: 9117-MMA (Power6 - 570, does not really matter.)

Fix Type: HMC Firmware

HMC firmware release levels: V7R7.1.0

Download:

HMC V7R7.1.0M0 - MH01205
HMC V7R7.1.0M1 - MH01213 

Do NOT download:

Mandatory efix for HMCV7R710 - MH01214 (Service Pack 1 superceeds this efix)


Download using DownloadDirector or FTP.

You will get the following files:

HMC_Recovery_V7R710_1.iso
HMC_Recovery_V7R710_2.iso
HMC_Update_V7R710_SP1.iso


2.Download latest Knoppix version (v6.2 at the time of writing)

KNOPPIX-ADRIANE_V6.2CD-2009-11-18-EN.iso

ftp://ftp.knoppix.nl/pub/os/Linux/distr/knoppix/


3. Download & Install MagicISO and enter license code (v5.5 Build 0281 at the time of writing).

http://www.magiciso.com/download.htm


4. Download and install latest VirtualBox (v3.1.6 at the time of writing)

http://www.virtualbox.org/


5. Create a Linux Profile with at least 512M of memory and IDE controller (1024 MB RAM recommended like original HMCs).

Name: HMC
Operating System: Linux
Version: Linux 2.6

Memory: 1024 MB (Recommended, 512 MB minimum)
Harddisk: Dynamic, 160 GB (Installed HMC size is 12-13GB (with SP1))

Controller: IDE (default in this profile)


6. Extract the file initrd.gz from first HMC install-DVD using MagicISO (or WinRAR, 7-Zip):

CDROM:/isolinux/initrd.gz to a local directory.


7. Add Knoppix to VirtualBox and boot Linux 2.6 from this ISO.


8. Start sshd and transfer initrd.gz from the local computer to the virtual computer: Choose Option 10: Shell

Run the following commands to start sshd:

su -
/etc/init.d/ssh start

Check the IP-address of Knoppix:

ifconfig -a

In our case: 10.0.2.15

Set root password: passwd

Enter 'abc123' twice.


9. Modify initrd using Knoppix.

Copy the file initrd.gz using a SCP-client to the IP-address of virtual machine. Use account login: root with password 'abc123'.

Be aware that you might not be able to connect when the network adapter of the virtualbox is not set to Bridged Adapter or Host-only Adapter. Bridge Adapter is the most useful especially if you want to be able to connect to real POWER-systems.


If you did not specify the target directory then your file will be transferred your home-directory (in our case gunzip the file and mount it:

gunzip /root/initrd.gz
losetup /dev/loop0 /root/initrd
mkdir /mnt/initrd
mount /dev/loop0 /mnt/initrd

Go to /opt/hmc/bin of initrd, which is in this case:

/mnt/initrd/opt/hmc/bin

Please edit the file 'Install' within this directory using vi or nano. Add the following line (line-number 22):

VPDINFO="7042CR4"

Between

CMDLINE=`cat /proc/cmdline`

And

cd /

It should look like this:


FILES="bzImage initrd.gz disk1.img disk2.img disk3.img"

CMDLINE=`cat /proc/cmdline`

VPDINFO="7042CR4"

cd /
case "$VPDINFO" in

Save the file (:wq! in vi) and repack initrd (umount, gzip):

cd
umount /mnt/initrd
losetup -d /dev/loop0
gzip /root/initrd

Then, copy the file back to your workstation using scp/winscp.


9. Modify first HMC install-dvd using MagicISO: HMC_Recovery_V7R710_1.iso

Remove the original initrd.gz: CDROM:/isolinux/initrd.gz

And add the modified version you just copied over from the knoppix-virtualbox. Use 'Save As ..' to save the modified iso (HMC_Recovery_V7R710_1_modified.iso for example)


10. Boot from the modified dvd and install HMC v7.7.

After the installation you will be prompted for a login. Enter the default hmc username/password: hscroot/abc123

Now, you can get root access using 'su -'. The password is 'passw0rd'.


11. Change the start-up check file 'getHMCVPD' using nano or vi.

vi /opt/hsc/bin/getHMCVPD

Comment out line 5:

# /usr/sbin/dmidecode --string bios-version | sed -e 's/-\[//g' | sed -e 's/\]-//g'

And this add line under line 5:

echo "2AKT51A"

Comment out line 31:

# echo "$cmodel$mtype*$sn"

And add under this line:

echo "7042CR4*10-1234A"

Comment out line 34:

# echo "$cmodel$mtype"

And add user this line:

echo "7042CR4"


Save the file and reboot using the command 'reboot'.


12. Once your HMC is started, configure it.

Logon using hscroot/abc123.

You can install the service pack (HMC_Update_V7R710_SP1.iso) without any checks.



What about XF86Config? Well, it seems not to be needed for VirtualBox. It is possible that it is needed for VMWare but I did not test this.


Download modified files HMC v7.7

For the people that were not able to modify the files using the instructions above or for the ones that are just to lazy, download here the modified files for HMC v7.7.


Special thanks to the pseriestech.org forum and all contributors to thread:

Running HMC in VMware


Without them it would have been more difficult to get HMC v7.7 working in VirtualBox.



For the people who get "A critical error has prevented normal HMC startup. Please reboot the HMC and try again. If the problem persists, contact your support personnel. 1901: HMC Startup aborted due to a malfunction of a required module."

As far as I understand in the last release (R7.1.0) or can be last build of this release, VPD check is not only using the script /opt/hsc/getHMCVPD, but also the class of ccfw.jar (/opt/ccfw/ccfw.jar). Which directly calls dmidecode from the java code. GetInfo (com/ibm/hwmca/fw/util/GetInfo in ccfw.jar) class formed file /opt/ccfw/data/pciinfo/sys_info.out, which is used to validate the hardware.

In the log file /opt/ccfw/ccfw.out we see an error

"Java.lang.StringIndexOutOfBoundsException
    at java.lang.String.substring (String.java: 1092)
    at com.ibm.hwmca.fw.managed.HMC.getVpdInfo (HMC.java: 1358)
    at com.ibm.hwmca.fw.managed.HMC.getBiosMachineType (HMC.java: 1088)
... "

indicating that improper handling of type String. This error arises from the fact that the "dmidecode - string system-product-name"/"dmidecode - string bios-version" returns are not what is expected. Accordingly, the need to give what is expected of us.

For those with an error can help the following decision:

1) Move the original dmidecode

cd /usr/sbin 
mv dmidecode dmidecode.orig 

2) Create a script named /usr/sbin/dmidecode with this content:

 #!/bin/bash
 DMIDECODE=/usr/sbin/dmidecode.orig
 
 if [[ "$2" == "bios-version" ]]
 then
 echo "1234-123"
 elif [[ "$2" == "system-product-name" ]]
 then
 echo "1234-123"
 else
 $DMIDECODE "$@"
 fi

3) Make the script executable

chmod +x dmidecode

4) Reboot the HMC.

I've tested this solution on VMWare Server and old SuperMicro server.

P.S. Please, someone correct my grammatical mistakes )