Import an Image

Overview

The Image Templates screen in the Customer Portal allows users to upload an existing image from a Swift based Object Storage account.  After being imported as an Image Template, images may be used to provision or boot an existing virtual server. Images imported from an Object Storage account may be either VHDs or custom ISOs. VHD imports are restricted to the following 64-bit operating systems:

  •  CentOS 6 and 7
  •  RedHat Enterprise Linux 6 and 7
  •  Ubuntu 14.04, and 16.04
  •  Microsoft Server Standard 2012, R2 2012, and 2016

VHD imports are limited to 100GB disks. VHDs should be named as follows: filename.vhd-0.vhd.

Converting images to VHD

VHD format is the only supported image format for IBM Bluemix Virtual Servers. To convert images to VHD, use the qemu-img tool with the convert option:

  • qemu-img 2.7.0 or newer is required
  • Convert the image with the following command: qemu-img convert -f <image format> <image name> -O vpc -o force_size <image name>
  • Example command: qemu-img convert -f qcow2 test -O vpc -o force_size test

For more information, see Converting image formats in the QEMU documentation.

ISO Templates

At this time, only IBM Bluemix Supported Operating Systems can be used to load an ISO Template onto a VSI. A list of Supported Operating Systems can be found here: http://www.softlayer.com/services/software/

ISOs imported using this tool must be bootable in order for the image to be eligible for import.

Configure an Image for Virtual Servers

To ensure that an image can be successfully deployed in the IBM Bluemix Infrastructure environment, virtual server images must be configured to the following specifications:

  • /boot must be first partition
  • /boot and / must be ext3 or ext4 file system
  • /etc  and /root must be on the same partition as /
  • /etc/fstab -> LABEL=SWAP-xvdb1 swap swap : to mount swap disk we attach to the system
  • wget must be installed
  • Latest xe-guest-utilities Xen tools must be installed. Complete the following steps:
  1. Download the XenServer ISO from Citrix: https://www.citrix.com/downloads/xenserver/product-software/xenserver-72-standard-edition.html
  2. Mount the ISO by running this command: mount -o loop xenserver.iso /mnt
  3. Locate the RPM for the ISO by running this command: ls -l /mnt/Packages/xenserver-pv*
  4. The output should list an RPM similar to: xenserver-pv-tools-7.1.0-137222c.2185.noarch.rpm. 
  5. You can copy the RPM and then extract the ISO for xentools. Run the following command to create a directory structure that houses the ISO: rpm2cpio xenserver-pv-tools-7.1.0-137222c.2185.noarch.rpm | cpio -idv
  6. From the resulting directory structure, you can mount the guest-tools ISO and locate rpm/debs to install xentools. See the following example directory structure:

[root@mysystem user1]# rpm2cpio ../xenserver-pv-tools-7.1.0-137222c.2185.noarch.rpm | cpio -idv
./opt/xensource/bin/sr_rescan
./opt/xensource/libexec/unmount_halted_xstools.sh
./opt/xensource/packages/iso/guest-tools-7.1.0-137222c.iso
139264 blocks
[root@mysystem user1]#

For more information about cloud-init enabled images, see Provision with a cloud-init enabled image.

Import an Image

Complete the following steps to import an image in the Customer Portal.

  1. Locate and record the following details for the image from the Object Storage account.  Refer to View and Edit Object Storage File Details.
    • Account Name
    • Cluster
    • Container
    • Image Filename
       
  2. Access the Image Templates screen in the Customer Portal. Refer to Access the Image Templates Screen.
  3. Click the Import Image tab to open the Import tool.
  4. Select the Object Storage Account for the desired image from the Account drop down list.
  5. Select the Object Storage Cluster for the desired image from the Cluster drop down list.
  6. Select the Object Storage Container for the desired image from the Container drop down list.
  7. Select the Image Filename as it is listed in Object Storage from the Image File drop down list.
  8. Enter the desired Image Name for the new Image Template in the Image Name field.
  9. Enter any applicable notes in the Notes text box, if desired.
  10. Select the image's Operating System from the Operating System drop down list.
    Note: The Operating System drop down list will be grayed out if the image for import is a custom ISO. This step is only required when the import involves a VHD.
  11. If the image that you are importing is cloud-init enabled, select the Cloud Init checkbox. For more information, see Provision with a cloud-init enabled image.
  12. If you plan to provide your own operating system license, select the Your License checkbox. For more information, see Provide your own operating system license.
  13. Click the Import button to import the image to the Image Templates screen. Click the Cancel button to cancel the action.

What Happens Next

After the import has begun, the system will located the image file in the Object Storage account using the specified path (Account > Cluster > Container > Image File) and will import the image file as an image template, which will be stored on the Image Templates screen. After the import has completed, the image may be used to order a new device or to boot an existing device. Additionally, the image may be deleted at any time. Image import times vary based on file size, but generally take from several minutes to an hour.