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 1

Remote virtual server 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 server lifecycle using the VMControl Representational State Transfer (REST) application programming interfaces (APIs).

View more content in this series

Date:  17 Jan 2013
Level:  Intermediate PDF:  A4 and Letter (338 KB | 16 pages)Get Adobe® Reader®

Activity:  20966 views
Comments:  

Creating a virtual server

Listing available hosts for creating a virtual server

The first step in creating a virtual server is to retrieve a list of hosts that can be used in the creation of a virtual server. A host is a physical server capable of supporting virtual computers. It is likely managed by a hypervisor. Select the appropriate host from the list and save the value of its object identifier (OID) property. This value will be used in the next request.

Note: The URLs in these examples all start with https://myserver:port. You should replace myserver with the hostname or IP address of the system where VMControl resides and replace the port number with the secure port used when installing IBM Systems Director. The default value for the secure port is 8422.

  • URL
    • https://myserver:port/ibm/director/rest/VMControl/hosts
  • HTTP method
    • GET
  • Sample request

    Get the list of all hosts:

    GET https://myserver:port/ibm/director/rest/VMControl/hosts



    Listing 1. Sample response representation
            
    {
        "hosts": [
            {
                "name": "Server-7998-61X-SN0689CEA",
                "customization": {
                    "uri": "/ibm/director/rest/VMControl/hosts/6649/customization"
                },
                "properties": {},
                "uri": "/ibm/director/rest/VMControl/hosts/6649",
                "oid": 6649,
                "virtualServers": {
                    "uri": "/ibm/director/rest/VMControl/hosts/6649/virtualServers"
                }
            },
            {
                "name": "Server-7998-61X-SN0689D0A",
                "customization": {
                    "uri": "/ibm/director/rest/VMControl/hosts/6838/customization"
                },
                "properties": {},
                "uri": "/ibm/director/rest/VMControl/hosts/6838",
                "oid": 6838,
                "virtualServers": {
                    "uri": "/ibm/director/rest/VMControl/hosts/6838/virtualServers"
                }
            }
        ],
        "uri": "/ibm/director/rest/VMControl/hosts"
    }
    

Lising the customization for creating a virtual server

Customization parameters are unique, platform-specific properties that allow a user to customize the action that the user is performing. Customization parameters are available in many different types, but are all specified in a similar fashion. Using the OID collected from the previous step, make a GET request to the URL specified below. The result will be a list of customization parameters that can be used to create a virtual server.

The following example shows customization parameters in a typical Power environment. Customization parameters for other platforms (KVM, IBM z/VM®, and so on) will be different.

Note: For more information about customization parameters, refer to the VMControl programming topics section of the IBM Systems Director 6.3.x SDK Information Center.

  • URL
    • https://myserver:port/ibm/director/rest/VMControl/hosts/{hostOID}/virtualServers/customization
  • HTTP method
    • GET
  • Sample request

    Get the virtualization properties available when creating a new virtual server on host unique ID 6649:

    GET https://myserver:port/ibm/director/rest/VMControl/hosts/6649/virtualServers/customization



    Listing 2. Sample response representation
    View Listing 2

Creating a virtual server

The next step is to make an HTTP request to create a new virtual server. The first step is to populate the JSON for your request. Using the above listed customization, create a JSON string containing name/value pairs of customization properties for the virtual server.

Using this JSON string, create an HTTP POST request to the URL below. Creating a virtual server is an asynchronous operation, meaning that you will receive a response stating that the operation has begun and will need to monitor it to completion. The response will contain two URLs. The URL in the location header points to the temporary holding place for the virtual server. As the virtual server is not yet created, the name chosen in the request is used as a placeholder for ID. The URL in the message points to the job activation record for the create virtual server task. The job activation record contains the status of the create virtual server request, including percentage complete and any status or error messages.

  • URL
    • https://myserver:port/ibm/director/rest/VMControl/hosts/{hostOID}/virtualServers
  • HTTP method
    • POST
  • Sample request

    Create a new virtual server on host with unique ID of 6649:

    POST https://myserver:port/ibm/director/rest/VMControl/hosts/6649/virtualServers



    Listing 3. Sample response representation
            
    {
        "virtualServer":{
            "properties":[{
                    "name":"name",
                    "value":"NEW_VS1"
                },
                {
                    "name":"gos",
                    "value":"IBM Power - AIXLINUX"
                },
                {
                    "name":"cpumode",
                    "value":"SHARED"
                },
                {
                    "name":"cpushared",
                    "value":1
                },
                {
                    "name":"memsize",
                    "value":128
                },
                {
                    "name":"networks",
                    "value":"Discovered-1014-0"
                }
            ]
        }
    }



    Listing 4. HTTP response:
            
    HTTP/1.1 201 OK
    Cache-Control: no-store
    Set-Cookie: JSESSIONID_ibm_console_80=00007ID-HpF24AAYtRxUDiikVk4;Path=/; Secure; 
    									HTTPOnly
    Expires: Thu, 01 Dec 1994 16:00:00 GMT
    Content-Type: application/octet-stream; charset=UTF-8
    Content-Length: 190
    Date: Mon, 14 May 2012 02:34:13 GMT
    Location: https://9.9.9.9:8422/ibm/director/rest/VMControl/hosts/6649
    							/virtualServers/NEW_VS1
    Accept-Ranges: bytes
    Server: Noelios-Restlet-Engine/1.1.4
    Content-Language: en-US
    
    {
      "MessageText": "DNZEMW066I New "Create Virtual Server" job [1] started.\nRefer 
    	to the following URI for status: /ibm/director/rest/jobs/153/activations/1 ",
      "MessageID": "DNZEMW066I"
    }
    }


Monitoring the create virtual server job

The final step in creating a virtual server is to monitor its progress to completion. The recommended method to monitor virtual server creation is through the job activation record. As shown above, 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 Java Message Service (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.

2 of 6 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX, Linux
ArticleID=855006
TutorialTitle=IBM Systems Director VMControl resource lifecycle management: part 1
publish-date=01172013
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