Export

Export all of the workload data (storage, images, files) to an external host, set up the utility host, and transform the boot disk.

Export Boot Disk

Copy the boot disk from the source environment to a utility server that will be used to prepare the image for upload to PCA.

The method you use depends on the source hypervisor and management platform. For example, on Oracle VM or PCA 2.4, obtain the .img file for the boot disk by copying it from the storage repository shown in the VM's vm.cfg file. Run the command on the compute node or Oracle VM Server (OVS). For example:

cd /OVS/Repositories/0004fb00000300007b2cd14ca0d48e8b/VirtualDisks
scp 0004fb0000120000fcd80512881d4979.img
utilityhost:/data/0004fb0000120000fcd80512881d4979.raw

In this example, the output file is renamed with the file extension .raw, an optional change that indicates that the Oracle VM .img file uses the 'raw disk' image format.

Speed Up Export by Compressing Disk Image Files

Disk image files are large and copying them to other hosts can take a long time. This may go much faster if you use compression, especially for sparse disk images.

You can optionally compress the disk image file using a command like gzip or lzop to reduce the time to copy to the utility host. For example, using lzop and piping output to scp:

lzop -1 < 0004fb0000120000fcd80512881d4979.img | ssh utilityhost 'lzop -d > /data/0004fb0000120000fcd80512881d4979.raw' 

We use lzop for compression in this case because a fast network is available, so compression speed was more important than compression ratio. If you have a slower network, you may opt for another approach such as using gzip or bzip2:

gzip 0004fb00001200008190ce0329fdacdf.img
scp 0004fb00001200008190ce0329fdacdf.img.gz utilityhost:/data/

All of these methods, or using no compression at all, are equally valid and depend on your preferences.

Set Up the Utility Host

Create a utility host that runs Oracle Linux. This can be a virtual machine or a bare metal instance.

Prepare the utility host by installing the OCI CLI. See the section 1.2 of the Oracle Private Cloud Appliance User Guide for instructions.

Use the following commands to install qemu-img and virt-sparsify. This example assumes an Oracle Linux 7 host:

$ sudo yum upgrade 
$ sudo yum-config-manager --enable ol7_kvm_utils 
$ sudo yum install qemu-img libguestfs-tools

Transform Boot Disk

You may need to convert the boot disk to the open standard qcow2 format used by the PCA hypervisor.

  1. You convert the boot disk on utility host that has access to OCI CLI, qemu-img command and other optional utilities.
  2. Process the boot disk on the boot disk being prepared for PCA. This is a necessary step for disk images from Oracle VM on Exalogic or PCA 2.x.
  3. On the utility node, enter a command like the following, substituting in the actual filename for the disk image file:
    $ qemu-img convert -f raw -O qcow2 0004fb0000120000fcd80512881d4979.raw
        output.QCOW2

    Note:

    1. You must name the output file output.QCOW2.
    2. The qemu-img command can take a substantial time to run depending on the image file size and the system speed. You can use the flag "-p" to show progress displayed as a percentage in the form (nn.nn/100%).
  4. You may be able to reduce the size of the disk image by using the virt-sparsify tool. This tool works on many file systems: ext2/3/4. xfs, btrfs, NTFS, LVM. and reduces sparse disk image size by eliminating disk blocks not owned by a file. The amount of reduction varies based on the contents of the disk image before exporting. Depending on your utility environment, you may have to also issue export LIBGUESTFS_BACKEND=direct before running the command:
    $ virt-sparsify --in-place output.QCOW2 

Prepare the OCI File Type for Import

Private Cloud Appliance X9-2 image and OCI images use the file type .oci, which has two components:

  • An image_metadata.json file that describes the image in JSON format, and the actual disk image named output.QCOW2 you created.
  • The image_metadata.json file describes the image's settings (BIOS vs. UEFI, how virtual devices are implemented), and what operating system it runs.

Select the BIOS or UEFI version based on the source and change the operating system description.

Oracle Exalogic images will be in BIOS mode.

$ tar zcf MyImage.oci image_metadata.json output.QCOW2

Example image_metadata.json Files

Use this example image_metadata.json file included in a .oci bundle for upload.

Review the following BIOS and UEFI metadata file versions and use whichever is relevant. Set the BIOS or UEFI version as determined by the source environment values for operatingSystem and operatingSystemVersion based on the imported image.

BIOS images


{
   "version": 2,
   "externalLaunchOptions": {
       "firmware": "BIOS",
       "networkType": "PARAVIRTUALIZED",
       "bootVolumeType": "PARAVIRTUALIZED",
       "remoteDataVolumeType": "PARAVIRTUALIZED",
       "localDataVolumeType": "PARAVIRTUALIZED",
       "launchOptionsSource": "CUSTOM",
       "pvAttachmentVersion": 1,
       "pvEncryptionInTransitEnabled": false,
       "consistentVolumeNamingEnabled": false
    },
    "imageCapabilityData": null,
    "imageCapsFormatVersion": null,
    "operatingSystem": "Oracle Linux",
    "operatingSystemVersion": "8.5"
}

UEFI images


{
    "version": 2,
    "externalLaunchOptions": {
        "firmware": "UEFI_64",
        "networkType": "PARAVIRTUALIZED",
        "bootVolumeType": "PARAVIRTUALIZED",
        "remoteDataVolumeType": "PARAVIRTUALIZED",
        "localDataVolumeType": "PARAVIRTUALIZED",
        "launchOptionsSource": "CUSTOM",
        "pvAttachmentVersion": 1,
        "pvEncryptionInTransitEnabled": false,
        "consistentVolumeNamingEnabled": false
     },
     "imageCapabilityData": null,
     "imageCapsFormatVersion": null,
     "operatingSystem": "Oracle Linux",
     "operatingSystemVersion": "7.9"
}