Introduction
IBM Power Virtual Server (PowerVS) is a great solution for running Power workloads off-premises or as an alternative to other remote data centers. There are several ways to migrate IBM i workloads into PowerVS each with their pros and cons. This blog introduces a method of copying all partition disks into PowerVS using an OVA image which can be used as a migration method or in conjunction with other methods.
Background
There are several ways to migrate IBM i partitions from on-premises servers or other data centers into IBM Power Virtual Server (PowerVS). Several of these methods involve creating a seed or target partition that the saved operating system and data are restored into. This target partition is normally created by using a PowerVS supplied image at the same release level as your intended restore. If the release level you need is not provided by PowerVS or you want custom restore target you can create your own image as an OVA and import it into the PowerVS image catalog. The flow is show in the following diagram:

OVAs used by IBM PowerVC and PowerVS are tar files containing an OVF (an XML metadata file) and RAW disk image files. PowerVS and PowerVC also support gzipped OVAs. Once the OVA is created it is transferred to IBM Cloud Object storage and then imported into the PowerVS Image catalog as a custom image. The image can then be used to create a virtual server instance (partition) in PowerVS.
While this method can be used to migrate clones of workload partitions, the space requirements for creating the OVA as discussed below can be prohibitive. This makes this method more suitable for creating custom “restore target” partitions.
Manual OVA creation
The easiest way to create an OVA image is to use IBM PowerVC. However, if IBM PowerVC is not available in the environment the OVA image can be created using manual steps. At its core the manual OVA creation steps consist of using the dd copy VIOS/AIX/Linux command to create raw image file copies of the disks, create an XML file listing the images, and put the XML and image files in a tar.
There are several prerequisites to be aware of and some preparation help automate the partition setup in PowerVS.
Prerequisites
Disk space
You will need enough disk space in the source environment to create raw image files of the source partition’s volumes. The size is the actual size of the volumes and not the “used space”. For example, if the source partition has three SAN volumes that are 100GB each, you need 300GB of free space for the image files and another 300GB to create a tar file containing the image files. Note that the maximum image size allowed for import into PowerVS is 10TB so if the sum of all the volume sizes is greater than 10TB this image import migration path cannot be used.
512-byte sector size volumes
This method only works with 512-byte sector volumes since that is the sector size in PowerVS. See this page to check the sector sizes of the disk units.
Preparing the system for capture
Install cloud-init
Cloud-init performs several important functions cloud in provisioned partitions including removing the network interfaces from the original partition and configuring the new network interfaces. If cloud-init is not installed in the image these tasks must be done manually from the partition console after the new instance is created. IBM PowerVC documents how to install cloud-init on IBM i.
Shutdown workloads
The partition should be as idle as possible while making the disk images. All workloads should be gracefully shutdown to avoid capturing inconsistent data in the disk images.
Create disk the images
Now that the system is prepared for image capture, the next step is to create raw disk copy images of the disks. This requires the disks be attached to a VIOS, AIX, or Linux partition so that the disks show up as devices in “/dev”. There are various ways to accomplish this:
1. If the volumes are already attached to the IBM i using vSCSI, the VIOS could be used for the disk image copy since the volumes show up as /dev/ disks in the VIOS.
2. The volumes could be copied using the SAN and the copies attached to a VIOS, AIX, or Linux partition.
3. The volumes could be temporarily attached to a VIOS, AIX, or Linux partition while the IBM i is stopped during the image copy and detached when the copy is finished.
Once the volumes are attached to a VIOS, AIX, or Linux partition the “dd” command is used to read the raw device and create an image file. If the dd copy command is run on AIX or VIOS then the “rhdisk” device should be used instead of the “hdisk” device. This provides better read performance for the raw disk access.
An example of dd command for copying the “rhdisk2” device to an image file in the /imagebuild directory is:
$ dd bs=1M if=/dev/rhdisk2 of=/imagebuild/hdisk2.img
25600+0 records in
25600+0 records out
Create the OVF
After all the disk images are created, create an OVF XML file. The OVF lists the disks required for the partition, the image files, and the correlation between the disk and the image. Here is an example OVF with two disks/images. The sections that need to be copy-paste-modified for additional disks are annotated with XML comments.
<ovf:Envelope xmlns:rasd="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1">
<ovf:References>
<!-- Add each disk image as an ovf:File in this section.
The href should point at the image file name, the id must be unique, and the size is in bytes. -->
<ovf:File href="hdisk0.img" id="file1" size=" 10737418240"/>
<ovf:File href="hdisk1.img" id="file2" size=" 10737418240"/>
</ovf:References>
<ovf:DiskSection>
<ovf:Info>Disk Section</ovf:Info>
<!-- Add each disk to the disk section. The capacity should be disk/volume size in bytes.
The diskIds should be unique, and the fileRef value should refer to the disk's file image ID
from the ovf:File above.-->
<ovf:Disk capacity=" 10737418240" capacityAllocationUnits="byte" diskId="disk1" fileRef="file1"/>
<ovf:Disk capacity=" 10737418240" capacityAllocationUnits="byte" diskId="disk2" fileRef="file2"/>
</ovf:DiskSection>
<ovf:VirtualSystemCollection>
<ovf:VirtualSystem ovf:id="vs0">
<ovf:Name>MYSYSTEMNAME</ovf:Name>
<ovf:Info> IBM i Image Product Export</ovf:Info>
<ovf:ProductSection>
<ovf:Info/>
<ovf:Product/>
</ovf:ProductSection>
<ovf:OperatingSystemSection ovf:id="11">
<ovf:Info/>
<ovf:Description> IBMI</ovf:Description>
<ns0:architecture xmlns:ns0="ibmpvc">ppc64</ns0:architecture>
</ovf:OperatingSystemSection>
<ovf:VirtualHardwareSection>
<ovf:Info>Storage resources</ovf:Info>
<!-- Each disk should have an ovf:Item specified. Here we have two items for our two disks.-->
<ovf:Item>
<rasd:Description>Temporary image asset</rasd:Description>
<rasd:ElementName>MYSYSTEMNAME</rasd:ElementName>
<!-- These ovf:/disk/ references should refer to the diskID from the DiskSection above -->
<rasd:HostResource>ovf:/disk/disk1</rasd:HostResource>
<!-- The rasd:InstanceID should be a unique integer for each ovf:Item you add for the disks. -->
<rasd:InstanceID>1</rasd:InstanceID>
<rasd:ResourceType>17</rasd:ResourceType>
<!-- The ns1:boot value should be set to True for all IBM i ASP1/*SYSBAS disks and False for iASP disks. -->
<ns1:boot xmlns:ns1="ibmpvc">True</ns1:boot>
</ovf:Item>
<ovf:Item>
<rasd:Description>Temporary image asset</rasd:Description>
<rasd:ElementName>MYSYSTEMNAME</rasd:ElementName>
<rasd:HostResource>ovf:/disk/disk2</rasd:HostResource>
<rasd:InstanceID>2</rasd:InstanceID>
<rasd:ResourceType>17</rasd:ResourceType>
<ns1:boot xmlns:ns1="ibmpvc">True</ns1:boot>
</ovf:Item>
</ovf:VirtualHardwareSection>
</ovf:VirtualSystem>
<ovf:Info></ovf:Info>
<ovf:Name>MYSYSTEMNAME</ovf:Name>
</ovf:VirtualSystemCollection>
</ovf:Envelope>
The OVF should be saved in the same directory as the image files and its extension should be .ovf.
Create the OVA
Now that the OVF and image files are created the next step is to create the OVA. The OVA is simply a tar and PowerVS supports importing both OVAs with a .ova extension or a gzipped OVA with the .ova.gz extension.
Create the OVA with the following command.
Note that the OVF must be the first file in the tar.
tar cvf partitionOVA.ova mysystem.ovf *.img
The OVA can now be uploaded to Cloud Object Storage and then imported into PowerVS’ image catalog. PowerVS documents how to create object storage, upload the image, and import it into your image catalog in this article.
Conclusion
Using these techniques an IBM i partition can benefit from the full system copy method of migrating into PowerVS from environments that lack IBM PowerVC.