Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

IBM Systems Director VMControl resource lifecycle management: part 2

Remote virtual appliance lifecycle management using the VMControl REST APIs

Piyush Jain (piyushjain@in.ibm.com), Staff Software Engineer, IBM  
author photo
Piyush Jain is a Staff Software Engineer at IBM currently working on VMControl under IBM Systems Director, a critical product in IBM's product portfolio. He has an overall experience of around 6 years and holds a bachelor's degree in Information Technology Engineering from IET Alwar, Rajasthan India. You can contact him at piyushjain@in.ibm.com
(An IBM developerWorks Contributing Author)
Nicholas Schambureck (nschambu@us.ibm.com), Advisory Software Engineer, IBM
Photo of Nick
Nick Schambureck is an Advisory Software Engineer and Team Leader for the IBM Systems Director VMControl command-line interface and REST API team. He has been working with the project since its inception.
Poornima Soundararajan (poornima.s@in.ibm.com), Staff Software Engineer, IBM
Photo of Poornima
Poornima Soundararajan is working as a Staff Software Engineer for the IBM Systems Director VMControl advanced manager. Poornima has more than 7 years of experience in Java/J2EE technologies.
Aparna Khare (apakhare@in.ibm.com), System Software Engineer, IBM
Photo of Aparna
Aparna Khare is working as a System Software Engineer for the IBM Systems Director VMControl advanced manager. Aparna has 4 years of experience in Java/J2EE technologies.

Summary:  IBM® Systems Director is a platform management solution that is used to manage physical and virtual systems in a multisystem environment. It supports various virtualization technologies and multiple operating systems across IBM and non-IBM platforms. IBM Systems Director VMControl™ is an advanced manager of IBM Systems Director, a free-to-own set of platform management tools. This tutorial is part of a series on VMControl resource lifecycle management. This tutorial explains the virtual appliance lifecycle using the VMControl Representational State Transfer (REST) application programming interfaces (APIs).

View more content in this series

Date:  25 Jan 2013
Level:  Intermediate PDF:  A4 and Letter (491 KB | 29 pages)Get Adobe® Reader®

Activity:  20680 views
Comments:  

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"
    }
    


Create a virtual appliance

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 representation
            
    Status 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.

4 of 8 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX, Linux
ArticleID=855964
TutorialTitle=IBM Systems Director VMControl resource lifecycle management: part 2
publish-date=01252013
author1-email=piyushjain@in.ibm.com
author1-email-cc=nissler@us.ibm.com
author2-email=nschambu@us.ibm.com
author2-email-cc=
author3-email=poornima.s@in.ibm.com
author3-email-cc=nissler@us.ibm.com
author4-email=apakhare@in.ibm.com
author4-email-cc=nissler@us.ibm.com