Tips for Replacing HMC’s with Updated Hardware

Here are a few tips on how to replace a HMC with a newer model HMC.

The general idea behind these steps is if you have a single or dual HMC’s and you are replacing them with newer model HMC’s.

In general, I would recommend getting all the information you need off the old HMC’s, and then shutting them down before connecting up the new HMC’s.  This is because there have been several changes to the partition data stored on the managed systems between HMC versions lately, and in those cases you don’t want to have an old HMC connect to the systems after their partition data has been upgraded to the new format.   As always, read all of the release notes for the HMC levels.

Here is the general process:

  • Backup partition data for each managed system, and backup the HMC itself
  • Resolve any open serviceable events and/or amber lights on the HMC/managed systems.  It is best to start with a clean slate before throwing a HMC change in to the mix.
  • Review the HMC release notes for the version of HMC on the new HMC.   Make sure you understand any special requirements, and compatibility issues with the new HMC release.   For example, on HMC v8 and later it no longer supports POWER5 or earlier servers.
  • Check the HMC/Firmware matrix and verify that the firmware on each managed system will be compatible with the new HMC level.
  • Verify you know the ASMI HMC access password for each managed system.   If you don’t have the HMC access password, but you do have the ASMI admin password, you can login to the ASMI and reset the HMC access password.  If you don’t have the admin or HMC access passwords, open a PMR with IBM to have the admin password reset.
  • Go through the HMC configuration options on the old HMC’s and note any settings that you had previously customized, such as the welcome text and any other settings
  • Record all of the users on the old HMC’s.  You can use the “lshmcusr” command line option to do this.   Also see my post from yesterday for a script to assist with re-creating the users on the new HMC’s:
  • Backup any SSH public keys that users have setup on the old HMC’s if needed.   A command you can run from the HMC to help locate SSH authorized_keys files is “ls -alR /home | grep authorized_keys”
  • Record all network settings on the old HMC’s.   Make sure you note the private network’s DHCP ranges, and the public networks IP address, gateway, subnet mask, etc.  Also record the firewall settings on the old HMC’s.
  • Record a list of all the managed systems and their IP addresses on the old HMC’s by running “lssysconn -r all”
  • Shut down the old HMC’s
  • Connect up the new HMC’s
  • Recreate users on new HMC’s
  • Configure all settings on the new HMC’s previously noted on the old HMC’s
  • Configure the network interfaces on the new HMC’s.   Make sure to set the private DHCP ranges to what they were set on the old HMC.
  • On the new HMC’s all of the managed systems should automatically appear within about 15 or 30 minutes.   However, they will come in as a failed authentication or pending authentication state.   For each managed system, click the “update password” option, and put in the HMC access password you previously noted – after this the managed system will be accessible from the HMC.
  • Run lssysconn -r all on the new HMC’s and compare the output from the old HMC’s.   Verify that all managed systems are visible on the new HMC’s.   Note that systems with dual service processors will have 2 line items and 2 IP addresses.
  • Backup the new HMC and the partition profile data

If you have any other tips or suggestions on what to do when replacing an HMC, please post a comment.


One Liner HMC Script to Clone/Copy Users

Here is a quick one liner HMC script to clone users.   This is very handy when you are replacing an HMC with new hardware.  It can also be used to create a new user with matching permissions of the old user (just update the “name=” part of the command line).

The script doesn’t actually do anything – it just generates the commands to re-create all of the users (except hscroot and root).  You would take the output of the script, verify it, and then copy/paste the command lines on to the new HMC for each user you wanted to recreate.

The mkhmcusr command doesn’t take the “resources”, “password_encryption”, or “disabled” options as input, so the script drops those options.

As always, use at your own risk, and review the output of the script for accuracy.   I’ve only tried it on HMC 7.7.8, so it might need some tweaking to run on other HMC levels.

Here is the one liner:


Here is an example of running it:

As you can see the script generates the “mkhmcusr” commands.  I could then copy/paste these on a new HMC to recreate the users (the mkhmcusr will prompt for what you want to set the users password to).   Or if I wanted to copy a user, I could just edit the command and change the “name=” to something else, and it would effectively clone the user.


Using Brace Expansion in the Bash Shell

This post is all about the bash shell brace expansion.

The basics are you can put a list of items in braces, and the bash shell will expand them out, for example:

The {dev,test,prod} is just what it looks like, and the {01..04} means numbers 1-4 with a padded zero in front, and as you can see the shell expands it out with all of the possible combinations.

This can be helpful if you have a server naming convention and need to perform a task on a bunch of servers, but don’t want to have to type out all the server names, for example, to use SSH to check the /tmp filesystem:

{0..100} will expand to the numbers 0-100, but what if you wanted to count up by 5?  No problem, just use {0..100..5}

You can also expand letters:

You can use it to make multiple directories outside the directory you are in:

This creates /tmp/dir1, /tmp/dir2, and /tmp/dir3

You could even go further with this by creating nested subdirectories:

That will create /tmp/dir1/subdir1, /tmp/dir1/subdir2, /tmp/dir1/subdir3, /tmp/dir2/subdir1, /tmp/dir2/subdir2, /tmp/dir2/subdir3, /tmp/dir3/subdir1, /tmp/dir3/subdir2, and /tmp/dir3/subdir3.

You can also use it to backup files easily:

If your not sure what that one does, an easy way to test what it will do is to put an “echo” in front:

So we can see that “cp testfile{.txt,.backup}” will copy testfile.txt to testfile.backup.

What if we wanted to copy it to testfile.txt.backup?  No problem:

Putting a comma at the beginning of the brace expansion causes it to expand on to the previous word in front of the brace.   If we echo it out we can see what it is doing:

Bash brace expansion is one of those things that is easy to pick up and can save you a bunch of time typing!