Alt disk install cloning
From AIXWiki
Contents |
[edit] Cloning AIX using alt_disk_install
AIX has the ability to copy the contents of the root Volume Group to another harddisk. The disk that is being copied to will be completely erased and must be present in the system and not assigned to a Volume Group. During this guide the original LPAR with the running system will be referred to as LPAR1, and the new (or inoperative) LPAR will be referred to as LPAR2.
[edit] Check current configuration
On LPAR1 type the following command to check which harddisks are currently available.
lspv
This will produce the following output
hdisk0 000573927dcc83c6 rootvg active
Note down all hdisks present.
[edit] Assigning harddisk to system to be cloned
A prerequisite for cloning a system is that the harddisk can be moved between LPAR1 and LPAR2. In most cases this means that both LPARs are within the same physical server and served by the same VIOS. The harddisk can be moved to LPAR1 by assigning the harddisk or hdiskpower to the vhost of LPAR1. We will assume that LPAR2 is to be a new LPAR without virtual devices assigned in the VIOS. Assign the logical volume / hdiskpower / harddisk that will belong to LPAR2 to the vhost of LPAR1 by using the command:
mkvdev -vdev lpar2_rvg -vadapter vhost1 -dev temp_rvg
note: this example assumes that the logical volume for LPAR2 is lpar2_rvg, and that LPAR1 is attached to vhost1. If multiple VIOS are used, only one path needs to be set as this is a temporary connection.
the following output will be given
temp_rvg Available
[edit] Check new disk availability
Connect to LPAR1 and log in to root account (sudo may also be used). Again check the harddisks available.
lspv
This will produce the following output
hdisk0 000573927dcc83c6 rootvg active hdisk1 00057392eef16b88 None
By checking with the list noted down in step 1 it is visible that hdisk1 has been newly added to the system.
[edit] Clone the rootvg to new disk
As seen in the previous step the new harddisk added is hdisk1.
To copy the rootvg type the following command:
alt_disk_install -C -O hdisk1
The -C option is to indicate that copy must be made to another harddisk rather than a mksysb. The -O option indicates that all server specific data (such as TCP/IP configuration) is to be removed. note: It is advisable to ensure that at least one account with access to root privilages has a standard password and is not based on log-in servers.
After about 30 minutes to an hour the cloning should be compleet but this is mainly dependent on the system being cloned.
[edit] Restore LPAR1 to the original settings
alt_disk_install moves the boot partition to the new harddisk and has to be moved back to the original harddisk.
alt_rootvg_op -X
the -X removes the cloned disk definition from the ODM database and moves it back to the old rootvg. note: you can also use:
alt_disk_install -X
This will call the other command and indicate that this is an old command.
[edit] Disconnect the cloned harddisk
In the VIOS that was used to map the harddisk, the harddisk now has to be mapped to the vhost belonging to the new server. Note: if the server does not exist yet, this will have to be created before executing this step
[edit] Delete harddisk from LPAR1
In LPAR1 execute the following command with root privilages:
rmdev -dl hdisk1
note: hdisk1 is the hdisk referred to in the alt_disk_install command
the following output is generated:
hdisk1 deleted
[edit] remove the harddisk link to the server
in the VIOS type the following command to dubblecheck you are removing the correct harddisk:
lsmap -vadapater vhost1
this command shows us that lpar2_rvg is the disk we added before. To actually sever the link between the device and the server the following command is used
rmvdev -vdev lpar2_rvg
result:
temp_rvg deleted
[edit] connecting the harddisk to LPAR2
Now it is time to connect the harddisk, containing the cloned install, to the intended LPAR:
mkvdev -vdev lpar2_rvg -vadapter vhost2 -dev vlpar2_rvg
resulting in the following output
lpar2 Available
Note: in this case the server is connected to vhost2, please use the correct vhost assigned to the new LPAR
[edit] Start the new LPAR
The new LPAR can now be started from the HMC, opening a virtual console when starting. It is necessary to configure LPAR2 through this virtual console as it has no TCP/IP settings and will request input when starting for the first time. Once the basic settings are in place the server can be futher configured through any preferred method (virtual console, ssh connection etc.).
