Create a virtual appliance by import
You can use the IBM Systems Director VMControl REST APIs to import a virtual appliance package from the Internet or from other sources and store its component files to create a virtual appliance. You can then deploy the virtual appliance into your data center.
It is possible to import virtual appliance packages containing the following virtual server images:
- AIX mksysb images for IBM POWER® processor-based logical partitions
- AIX raw disk images for IBM POWER processor-based logical partitions
- IBM i raw disk images for IBM POWER processor-based logical partitions
- IBM Power Systems running Linux raw disk images for IBM POWER processor-based logical partitions
- Linux and Microsoft® Windows® images for Linux KVM
- Linux on System z® images for z/VM
The VMControl REST APIs allow you to import either an open virtual appliance (OVA) package or an Open Virtual Machine Format (OVF) file. The OVA package is a tape archive (tar) file containing the operating system image and the OVF file.
Unless your OVA package is small or you have a fast network connection, we do not recommend using the VMControl REST APIs to import an OVA package. This is because in order to import an OVA package using REST, you must send the entire OVA package over the network in the request body.
Note: VMControl will only validate whether the OVF file is syntactically correct. It is the responsibility of the developer to ensure that the OVF file will allow for the image to be deployed successfully.
List the repositories available to store the virtual appliance
The first step in creating a virtual appliance is to retrieve a list of image repositories that can be used to store the virtual appliance or an image. Select the appropriate repository from the list and save the value of its OID property. This value will be used in the next request.
- URL
- https://myserver:port/{webContext}/VMControl/repositories
- HTTP method
- GET
- Sample request
Get the list of all repositories:
GET https://myserver:port/{webContext}/VMControl/repositories
Listing 12. Sample response representation{ "customization": { "uri": "/ibm/director/rest/VMControl/repositories/customization" }, "repositories": [ { "properties": {}, "oid": 17621, "name": "Image_repo", "uri": "/ibm/director/rest/VMControl/repositories/17621" }, { "properties": {}, "oid": 27567, "name": "createRepos", "uri": "/ibm/director/rest/VMControl/repositories/27567" } ], "uri": "/ibm/director/rest/VMControl/repositories" }
The next step is to request a virtual appliance to be created. The import operation takes either an OVF descriptor file or an OVA package. When importing an OVF file, the HTTP Content-Type header must be set to application/ovf+xml. For importing the OVA package, it is set to application/x-tar.
The import operation is synchronous with one exception. That exception is import OVF when the ISDAPIVersion HTTP header is set to 6.3.2.0 or higher. This example performs this action.
When importing an OVF file, the image file referenced by the OVF file must either be available on the Systems Director server or must be referenced by a URL that is accessible from the Systems Director server.
To perform an import operation, use the repository OID from the previous step and make a POST request to the virtualAppliances resource, passing the OVF file as specified below.
The response message body and location header will contain a URL pointing to the job activation record for the create virtual server task. The job activation record contains the status of the create virtual appliance request, including percentage complete and any status or error messages.
- URL
- https://myserver:port/{webContext}/VMControl/virtualAppliances
- HTTP method
- POST
- Sample request
Create a new virtual appliance in the repository with a unique OID of 17621 by importing the OVF file:
POST https://myserver:port/{webContext}/VMControl/virtualAppliances?repository=17621
Listing 13. Sample response representationStatus Code: 202 OK Cache-Control: no-store Content-Type: text/html; charset=UTF-8 Set-Cookie: JSESSIONID_ibm_console_80=0000DMNZHEmiba05m3pvgMH8bZ4;Path=/; Secure; HTTPOnly Expires: Thu, 01 Dec 1994 16:00:00 GMT Content-Length: 196 Date: Fri, 13 Jul 2012 13:43:46 GMT Location: https://9.9.9.9:8422/ibm/director/rest/jobs/170/activations/1 Accept-Ranges: bytes Server: Noelios-Restlet-Engine/1.1.4 Content-Language: en-US { "MessageID": "DNZEMW456I", "MessageText": "DNZEMW456I New \"Import image \" job [1] started for [17621]. \nRefer to the following URI for status: /ibm/director/rest/jobs/170 /activations/1" }
Monitor the create virtual appliance job
The final step in creating a virtual appliance is to monitor its progress to completion. The recommended method to monitor virtual appliance creation is through the job activation record. As shown earlier, this URL is returned in the message text in the response from the POST request. The job activation record can be monitored by polling the URL, but the recommended method is to use the JMS provider.
IBM Systems Director server includes a JMS provider to communicate events and other important messages with interested client applications. It allows for asynchronous communication between two or more applications. Job activation records can be monitored asynchronously through the Director.jobs.activation JMS topic.
For more information on JMS, refer to the JMS Messaging Overview page of the IBM Systems Director 6.3.x SDK information center.







