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]

Multi-disk management for IBM Systems Director VMControl: Part 1

Multi-disk management for virtual server using IBM Systems Director VMControl

Piyush Jain (piyushjain@in.ibm.com), Staff Software Engineer, IBM  
Piyush Jain
Piyush Jain is a Staff Software Engineer at IBM. He is currently working on VMControl under IBM Systems Director, a critical product in the IBM product portfolio. He has an overall experience of around 6 years and holds a bachelor's degree in Information Technology Engineering from Institute of Engineering and Technology (IET) Alwar, Rajasthan, India. You can contact him at piyushjain@in.ibm.com.

Summary:  IBM® Systems Director is a platform management solution that is used to manage physical and virtual systems. IBM Systems Director provides systems management personnel with a single pane of glass, helping reduce IT management complexity and cost. IBM Systems Director VMControl™ is an advanced plug-in installed on top of IBM Systems Director to provide virtualization capabilities. This tutorial talks about multi-disk management for virtual server using the VMControl Representational State Transfer (REST) application programming interfaces (APIs) and command-line interface (CLI).

View more content in this series

Date:  06 May 2013
Level:  Intermediate PDF:  A4 and Letter (419 KB | 23 pages)Get Adobe® Reader®

Comments:  

Multi-disk management while editing a virtual server through REST APIs

1. On the Power platform:

  • Edit virtual server customization through REST APIs:

    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.

    The following example shows the customization parameters in a typical IBM Power Systems™ environment. Customization parameters for other platforms (such as KVM, z/VM, and so on) will be different. Additionally, there are different rules for retrieving customization on different platforms. For example, KVM requires the virtual server to be stopped in order to modify it. Power Systems server allows you to modify an active virtual server, but only a subset of the properties will be available if the virtual server is stopped.

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

      Get the virtualization properties for modifying virtual server 25641:

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



      Listing 10. Sample response representation
              
      Download
      

    Note: The customization properties for modifying a virtual server on KVM platform is not listed in the tutorial due to the constraints of the tutorial length, but included some real-time examples to add or remove disk while modifying virtual server on the KVM platform.

  • Add an existing disk or a new disk while editing a virtual server through REST APIs:

    Now, let us see some real-time examples for the same:

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

      Modify the virtual server with the unique ID of 25641:

      PUT https://myserver:port/ibm/director/rest/VMControl/hosts/7751/virtualServers/25641

      Listing 11 shows the sample JSON to modify a virtual server using the npivdisks table parameter to add an existing disk.



      Listing 11. Sample request representation 1 using npivdisks
      
              
      {
          "virtualServer":{
              "addRowProperties":[{
                      "assigneddisks":[{
                              "name":"diskpriority",
                              "value":"2"
                          },
                          {
                              "name":"addexistingdisk",
                              "value":"npivdisks[16424]"
                          }
                      ]
                  }
              ]
          }
      }
      

      Listing 12 shows the sample JSON to modify a virtual server using the diskphysicalvolumes table parameter to add an existing disk.



      Listing 12. Sample request representation 2 using diskphysicalvolumes
              
      {
          "virtualServer":{
              "addRowProperties":[{
                      "assigneddisks":[{
                              "name":"diskpriority",
                              "value":"2"
                          },
                          {
                              "name":"addexistingdisk",
                              "value":"diskphysicalvolumes[19501]"
                          }
                      ]
                  }
              ]
          }
      }
      

      Listing 13 shows the sample JSON to modify a virtual server using the storagepools table parameter to add a new disk.



      Listing 13. Sample request representation 3 using storagepools
              
      {
          "virtualServer":{
              "addRowProperties":[{
                      "assigneddisks":[{
                              "name": "diskname",
                              "value": "piyush_disk2"
                          },
                          {
                              "name": "disksize",
                              "value": 2
                          },
      					{
                              "name":"diskpriority",
                              "value":"2"
                          },
                          {
                              "name":"adddisklocation",
                              "value":"storagepools[16343]"
                          }
                      ]
                  }
              ]
          }
      }
      

      Listing 14 shows the sample response for the above request.



      Listing 14. Sample response
              
      HTTP/1.1 202 OK
      Cache-Control: no-store
      Set-Cookie: JSESSIONID_ibm_console_80=0000jZA5qqETCy0Mn6s5cw9MhPd;Path=/; Secure
      Set-Cookie: AUTH_JSESSIONID=53gq77ih3t07pb65epi2h10i3f4;Path=/; HTTPOnly
      Expires: Thu, 01 Dec 1994 16:00:00 GMT
      Content-Type: application/octet-stream; charset=UTF-8
      Content-Length: 200
      Date: Sun, 03 Feb 2013 12:27:11 GMT
      Location: https://1.2.3.4:8422/ibm/director/rest/jobs/359/activations/1
      Accept-Ranges: bytes
      Server: Noelios-Restlet-Engine/1.1.4
      Content-Language: en-US
      
      {
          "MessageID": "",
          "MessageText": "New job activation for updating the virtual server was 
      	started.\nRefer to the following URI for job activation status: 
      	/ibm/director/rest/jobs/359/activations/1"
      }
      

  • Remove a disk to an existing virtual server through REST APIs: This is again an edit virtual server operation.
    • URL
      • https://myserver:port/ibm/director/rest/VMControl/hosts/{hostOID}/virtualServers/{vsOID}
    • HTTP method
      • PUT
    • Sample request

      Modify the virtual server with the unique ID of 25641:

      PUT https://myserver:port/ibm/director/rest/VMControl/hosts/7751/virtualServers/25641

      Listing 15 shows the sample JSON to modify a virtual server to remove an assigned disk.



      Listing 15. Sample request representation
      
              
      {
          "virtualServer":{
              "properties":[{
                      "name":"assigneddisks",
                      "value":"removeRow:25663"
                  }
              ]
          }
      }
      

      Response will be the same as Listing 14.


2. On the KVM platform:

  • Add an existing disk or a new disk while modifying a virtual server through REST APIs:

    Now, let us see some real-time examples for the same:

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

      Modify a virtual server on the host unique ID 7751 on the KVM platform:

      PUT https://myserver:port/ibm/director/rest/VMControl/hosts/7751/virtualServers/12345

      Listing 16 shows the sample JSON to modify a virtual server using the existingdisks table parameter to add an existing disk.



      Listing 16. Sample response representation using existingdisks
              
      {
          "virtualServer":{
              "addRowProperties":[{
                      "assigneddisks":[{
                              "name":"diskpriority",
                              "value":7
                          },
                          {
                              "name":"addexistingdisk",
                              "value":"existingdisks[File/23382/18807]"
                          }
                      ]
                  }
              ]
          }
      }
      

      Listing 17 shows the sample JSON to modify a virtual server using the disk location and size table parameter to add a new disk.



      Listing 17. Sample response representation using disklocationandsize
              
      {
          "virtualServer":{
              "addRowProperties":[{
                      "assigneddisks":[                    {
                              "name": "diskname",
                              "value": "VS3"
                          },
                          {
                              "name": "disksize",
                              "value": 1
                          },
                          {
                              "name": "virtualbustype",
                              "value": "ide"
                          },
                          {
                              "name": "virtualdiskemulation",
                              "value": "Hard Disk"
                          },
                          {
                              "name":"adddisklocation",
                              "value":"disklocationandsize[18807]"
                          }
                      ]
                  }
              ]
          }
      }
      
      

      Listing 18 shows the sample response for the above request.



      Listing 18. Sample response
              
      HTTP/1.1 201 OK
      Cache-Control: no-store
      Set-Cookie: JSESSIONID_ibm_console_80=0000QuVv06sJFXlLL5LOjharXzq;Path=/; Secure
      Set-Cookie: AUTH_JSESSIONID=4e7q338gpg6pdteddf9m83d1ns8;Path=/; HTTPOnly
      Expires: Thu, 01 Dec 1994 16:00:00 GMT
      Content-Type: application/octet-stream; charset=UTF-8
      Content-Length: 190
      Date: Sun, 03 Feb 2013 12:38:00 GMT
      Location: https://1.2.3.5:8422/ibm/director/rest/VMControl/hosts/7751/
      								virtualServers/VS3
      Accept-Ranges: bytes
      Server: Noelios-Restlet-Engine/1.1.4
      Content-Language: en-US
      
      {
          "MessageID": "DNZEMW066I",
          "MessageText": "DNZEMW066I New \"Create Virtual Server\" job [1] started.
      	\nRefer to the following URI for status: /ibm/director/rest/jobs/359/
      	activations/1 "
      }
      
      

  • Remove a disk from an existing virtual server through REST APIs
    • URL
      • https://myserver:port/ibm/director/rest/VMControl/hosts/{hostOID}/virtualServers/{vsOID}
    • HTTP method
      • PUT
    • Sample request

      Modify the virtual server with the unique ID of 12345:

      PUT https://myserver:port/ibm/director/rest/VMControl/hosts/7751/virtualServers/12345

      Listing 19 shows the sample JSON to modify a virtual server to remove an assigned disk.



      Listing 19. Sample request representation
      
              
      {
          "virtualServer":{
              "properties":[{
                      "name":"assigneddisks",
                      "value":"removeRow:F958A577E8D1331CBC5925A8266D1FC8"
                  }
              ]
          }
      }
      

      Response will be the same as Listing 18.

3 of 7 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX, Linux
ArticleID=900562
TutorialTitle=Multi-disk management for IBM Systems Director VMControl: Part 1
publish-date=05062013
author1-email=piyushjain@in.ibm.com
author1-email-cc=nissler@us.ibm.com