Previous Topic: iso2class: Appliance Distro Creation UtilityNext Topic: hvm2pv: Hardware Emulation to Paravirtualized Appliance Conversion Utility


image2class: Virtual Machine Image Import Utility

This section contains the following topics:

Overview

Usage

Limitations

Operation

Overview

The image2class utility imports virtual machine images as appliance classes. This makes it easy for users to migrate workloads from existing virtualization deployments to AppLogic. The virtual machine image that is being imported may be located on either the grid impex volume or on a remote site accessible over HTTP/HTTPS. The appliance class that is created from the virtual machine can either be unmanaged or managed:

image2class currently supports only virtual machines that comply with the Open Virtualization Format (OVF). For managed appliances, only redhat/debian based OVF images are currently supported. image2class will eventually be extended to support other image formats such as Virtual Hard Disk (VHD). image2class automatically detects the type of image by the file extension of the image.

The image2class utility supports only OVA-style packaging. When importing an OVA image, image2class uses the configuration provided in the .ovf descriptor to generate a class descriptor for the appliance (either a singleton or a catalog class). Because the .ovf descriptor does not provide all of the information needed to properly create an appliance class, image2class provides command line options for specifying/overriding the class configuration (default values are also used where appropriate). If the OVF image contains an appliance class descriptor in ADL format, the utility uses this descriptor for the appliance.

Usage

Import virtual machine images as CA AppLogic appliance classes.

Syntax
util image2class <class> <image> <--managed|--unmanaged|--upgrade> 
        [virt_mode=<xen_pv|xen_hvm|vmware>] [os=<os_name>] [boot_vol=<id>]
        [desc=<desc>] [mem=<value>] [cpu=<value>] [bw=<value>] 
        [--external_iface] [user=<username>] [pwd=<password>] [--force]

Options
<class>

The name of the appliance class that will be created. It can be specified either as a singleton, such as my_app:MYCLASS, or as a catalog class, such as /user:MYCLASS.. If the class is given as a singleton, the application is created, if it does not exist. This parameter is mandatory.

<image|volumes>

The image or volumes to be imported. These can be either on the grid impex volume, such as my-appliance.ova, or URL, such as https://my-server.com/my-appliance.ova.

When importing an OVA image, you should specify only one file or url.

When importing raw volumes, up to 4 can be specified separated with spaces. The volumes will be imported in the order specified. This parameter is mandatory.

--managed

Create a managed appliance that sends success or failure events on appliance start and stop, automatically configures the virtual network interfaces that corresponds to terminals, has resource and performance counters that are collected and sent out the mon terminal (if present and connected), and has property settings, which values are retrieved on appliance start and made available for configuration scripts.

--unmanaged

Create an unmanaged appliance. No modifications are done to the appliance volumes.

--upgrade

Replace the volumes of the specified existing <class> with those from <image>. The original volumes of the appliance class are overwritten (upon failure the old volumes are restored). The descriptor of <class> is not modified during an upgrade. If the existing <class> is managed, the imported boot volume is modified accordingly so that the class remains managed after the import is complete. This option will fail if the number of volumes in <class> is different than the number of volumes in <image>. To override this behavior, use the --force parameter. This parameter cannot be used with either the --managed or the --unmanaged parameter.

virt_mode=<xen_pv|xen_hvm|vmware>

Virtualization mode when --managed is used. Valid values are 'xen_pv', 'xen_hvm' and 'vmware'. More than one value can be specified, separated by a coma. Default: 'xen_pv,xen_hvm,vmware'. This has no effect when creating an unmanaged appliance, in which case virtualization mode will be set to 'xen_hvm,vmware'.

os=<os_name>

Name of the OS. This will be put in the descriptor of the appliance. See the 'Supported Operating Systems' section for list of allowed values. If an invalid or no value is specified, image2class will print the list of supported operating systems and prompt for a choice.

user=<username>

The username used to authenticate with a web server if the <image> parameter is specified as a URL. The username is also used when retrieving additional files as part of the import. This parameter is optional.

pwd=<password>

The password used to authenticate with a web server if the <image> parameter is specified as a URL. The password is also used when retrieving additional files as part of the import. If <password> is specified as -, image2class will prompt the user for the password. If standard input 'stdin' is not a terminal device, a prompt is not displayed and one copy of the password is expected as input to 'stdin' (this can be used for batch operations, to set the password from a script). This parameter is optional.

--force

Do not prompt for user confirmation when <class> already exists (with or without --upgrade being specified). Also, do not fail on upgrade when <class> has a different number of volumes than the existing <image> (instead update the descriptor for <class> so that it contains the volumes present in <image>). This parameter is optional.

desc=<desc>

An class descriptor to be associated with the imported class. This can be either on the grid's impex volume (that is, APPPLIANCE.desc) or a URL (that is, https://my-server.com/APPPLIANCE.desc). If this is used with an OVA image, the configuration in the ovf descriptor is ignored. The component name within this descriptor is ignored, the value specified in <class> is used instead. This parameter cannot be used with any of the following: --upgrade, boot_vol, cpu, mem, bw or --external_iface. This parameter is optional.

boot_vol=<id>

When used with an OVF image, specifies which volume to configure as the boot volume. This could either be a disk id as specified in the ovf descriptor or a number between 1 and 4 in the ordered list of volumes in the .ovf descriptor. If this parameter is not specified, the first volume is configured as the boot volume. If the specified volume does not exist, the operation will fail. This parameter can only be used with OVA images, if you use it while importing raw volume(s), the operation will fail. This parameter is optional.

cpu=<value>
mem=<value>
bw=<value>

CPU, Memory, and bandwidth resources to be set on the boundary of the appliance class. Minimum, maximum and default resources are set to the same value.

If not specified as a parameter and the <image> contains a configuration for the resources, the values for cpu and mem are taken from the <image>.

If a resource is not specified either as a parameter or in the <image>, the following values are used: memory=512M, cpu=1.0, bw=100M.

These parameters are optional.

--external_iface

Enable the external interface for the created class. The network configuration must be created manually and is not handled by this utility. This parameter is optional.

Note: The current version only supports ovf images packaged as OVA files.

Supported Operating Systems

For the latest list of the supported operating systems, please refer to the Release Notes or Appliance Developer Guide.

Examples
util image2class my_app:TOMCAT tomcat.ova --unmanaged

Import an OVA image from the grid's impex volume as an unmanaged singleton class.

util image2class /proto:TOMCAT http://example.com/tomcat.ova user=some-user pwd=- --managed cpu=2 mem=512M

Import an OVA image from a URL, creating a managed catalog class, overriding resources specified in the .ovf descriptor.

util image2class /proto:TOMCAT tomcat.ova --upgrade

Upgrade a managed catalog class by replacing its volumes with those from an OVA image

Limitations
Managed Appliances

To create a managed appliance from the specified virtual machine image, the image must conform to the following requirements. If not, the import will fail.

General limitations of image2class

Notes:

Image2class does not support vmdk files of type streamOptimized. This is the default disk type when exporting from an ESX server. If you need to export an OVA image from an ESX server, you need to use the ovfexport.sh utility which is provided as part of the AppLogic release. The utility is located in the download folder for the release on your Backbone Fabric Controller server.

To use ovfexport.sh:

ovfexport.sh <source> <target>

Where <source> is the source URL locator to an OVF package, VMX file, or virtual machine in vCenter or on ESX Server and <target> is the local file that will be created

Example:

ovfexport.sh vi://localhost/my_vm my_vm
Operation
Importing an OVF virtual machine as an appliance

The image2class utility creates a new class from an OVA packaged appliance by performing the following steps: