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:  

Delete a virtual appliance

List the virtual appliances available to delete

The first step in deleting a virtual appliance is to retrieve a list of available virtual appliances. This can be done by either retrieving all known virtual appliances or by retrieving a list of virtual appliances that exists on an image repository. This example can retrieve all virtual appliances. Select the appropriate virtual appliances from the list and save the value of its OID property. This value will be used in the subsequent requests.

  • URL
    • https://myserver:port/{webContext}/VMControl/virtualAppliances
  • HTTP method
    • GET
  • Sample request

    Get the list of all virtual appliances:

    GET https://myserver:port/{webContext}/VMControl/virtualAppliances



    Listing 16. Sample response representation
            
    {
        "candidates": {
            "uri": "/ibm/director/rest/VMControl/virtualAppliances/candidates"
        },
        "virtualAppliances": [
            {
                "properties": {},
                "oid": 28912,
                "name": "Virtual Appliance 1",
                "uri": "/ibm/director/rest/VMControl/virtualAppliances/28912"
            },
            {
                "properties": {},
                "oid": 29731,
                "name": "cap_nim",
                "uri": "/ibm/director/rest/VMControl/virtualAppliances/29731"
            },
            {
                "properties": {},
                "oid": 20495,
                "name": "cap_nim_aixmobb",
                "uri": "/ibm/director/rest/VMControl/virtualAppliances/20495"
            }
        ],
        "uri": "/ibm/director/rest/VMControl/virtualAppliances"
    }
    


Delete a virtual appliance

The next step is to request the virtual appliance to be deleted. Delete virtual appliance is an asynchronous operation.

The response will contain two copies of the same URL. Both, the URL in the location header and the URL in the response message point to the job activation record for the delete virtual appliance task. The job activation record contains the status of the delete virtual appliance request, including percentage complete and any status or error messages.

  • URL
    • https://myappliance:port/{webContext}/VMControl/virtualAppliances/{vaOID}
  • HTTP method
    • DELETE
  • Sample request

    Delete the virtual appliance with a unique ID of 28912:

    DELETE https://myappliance:port/{webContext}/VMControl/virtualAppliances/28912



    Listing 17. Sample response representation
            
    Status Code: 200 OK
    Accept-Ranges: bytes
    Cache-Control: no-store
    Content-Language: en-US
    Content-Length: 195	
    Content-Type: application/json; charset=UTF-8
    Date: Wed, 11 Jul 2012 12:34:45 GMT
    Location: https://9.9.9.9:8422/ibm/director/rest/jobs/540/activations/1
    Server: Noelios-Restlet-Engine/1.1.4
    
    {
        "MessageID": "DNZEMW299I",
        "MessageText": "DNZEMW299I New \"Delete Virtual Appliance\" job [1] 
    	started.\nRefer to the following URI for status: /ibm/director/rest/
    	jobs/540/activations/1"
    }
    


Monitor the delete virtual appliance job

The final step in deleting a virtual appliance is to monitor its progress to completion. The recommended way to monitor virtual appliance deletion is through the job activation record. As seen above, this URL is returned in response from the DELETE 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.

6 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