Cloning partition on IBM VIO server
From GoFacts
trocracrol rotrmonc
Cloning virtual disk or network installation?
Usually network installation will be a better way to deploy a new LPAR. Using network installation server and automated installation environment you will install AIX, SUSE or Red Hat base operating system in less then 10 minutes. Cloning LPAR can be used for deploying more software and all the post installation customization. It also can be used for keeping a snapshot of the system before making any changes or upgrading to the next release. With the copy of your virtual disk you can go back in minutes and boot it. There are some things to consider before you are going to clone the exported logical volume: if you are cloning AIX set your IP to some dummy address or remove your IP configuration. For Linux this is not necessary, as Red Hat and SUSE assign the configured IP according to the MAC of the NIC. You will also need to change the hostname of the cloned system. In the DLPAR environment you may need to reconfigure your RSCT Daemons as they need unique identifiers on all LPARs. On Linux this can be achieved through following command:
/usr/sbin/rsct/install/bin/recfgct
Copy your virtual disk
Login to your VIO server as user "padmin". Check your exported logical volumes:
- List volume groups:
$ lsvg rootvg datavg
- List logical volumes in your datavg
$ lsvg -lv datavg datavg: LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT vdisk0 jfs 272 272 1 open/syncd N/A vdisk1 jfs 272 272 1 open/syncd N/A vdisk2 jfs 272 272 1 open/syncd N/A vdisk3 jfs 272 272 1 open/syncd N/A vdisk4 jfs 272 272 1 open/syncd N/A
- Check the mapping of the virtual device
$ lsmap -vadapter vhost1 SVSA Physloc Client Partition ID vhost1 U9123.710.1008B2A-V1-C4 0x00000000 VTD vtscsi1 LUN 0x8100000000000000 Backing device vdisk1 Physloc
- Create a target logical volume:
mklv -lv vdisk1clone datavg 17G
- Shutdown your source LPAR (recommended)
- Become root on VIO
$ oem_setup_env
- List the device (this is a virtual disk, exported logical volume, do not confuse it with hdisk1 which is a second physical disk)
# ls -al /dev/*vdisk1 crw-rw---- 1 root staff 36, 2 Oct 18 15:31 /dev/rvdisk1 brw-rw---- 1 root staff 36, 2 Oct 18 15:31 /dev/vdisk1
- Clone it:
For cloning we will use the raw device starting with "r" /dev/rvdisk1, cloning buffered device with dd takes longer. We will also use 8MB block size, which significantly increases the cloning speed.
# time dd if=/dev/rvdisk1 of=/dev/rvdisk1clone bs=8M
It took 5 minutes to copy 17 GB disk (compared to 40 minutes using cplv command)
See also the diskussion at http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=748
