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

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

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).

Piyush Jain (piyushjain@in.ibm.com), Staff Software Engineer, IBM  

Piyush JainPiyush Jain is a staff software engineer at IBM. He is currently working on VMControl under IBM Systems Director. He has six years of experience overall and holds a bachelor's degree in information technology engineering from the Institute of Engineering and Technology (IET) Alwar, Rajasthan, India.



06 May 2013

Also available in Chinese

Before you start

Learn what to expect from this tutorial, and how to get the most out of it.

About this series

The IBM Systems Director VMControl advanced manager simplifies the management of virtual environments across multiple virtualization technologies and hardware platforms. VMControl is a leading multi-platform virtualization management solution that is included with IBM Systems Director Editions. VMControl has support for three types of interfaces (GUI, CLI, and REST APIs). This series has the following topics:

  • Multi-disk management for virtual server: This tutorial addresses the problems faced by the end user while performing operations related to multi-disk management of a virtual server. End users with little knowledge on the customization table parameters finds it difficult to add or remove disk, to or from the virtual servers.
  • Multi-disk management to create virtual appliance and revision control: This tutorial addresses the problems faced by the end user while performing multi-disk management to create virtual appliance and revision control while capture. End users with little knowledge on the customization table parameters finds it difficult to perform multi-disk capture and version control of a virtual appliance while capture.
  • Multi-disk management to deploy workload: This tutorial addresses the problems faced by the end user while performing multi-disk management to deploy a workload. End users with little knowledge on the customization table parameters finds it difficult to perform modification and mapping of the disk while deploy.

This series can help all VMControl users to understand the VMControl multi-disk management functionality through REST and CLI.

About this tutorial

Multi-disk management for virtual server includes the following major operations, both using REST APIs and CLI:

  • Create a virtual server and add an existing disk
  • Create a virtual server and add a new disk
  • Edit a virtual server to add an existing disk
  • Edit a virtual server to add a new disk
  • Edit a virtual server to remove a disk

This tutorial covers all these functions on both IBM Power® and kernel-based virtual machine (KVM) resource features.

Figure 1 shows the flow diagram for multi-disk management for virtual server using IBM Systems Director VMControl.

Figure 1. Multi-disk management for a virtual server
fig1

Objectives

The main objective of this tutorial is to help users understand the virtual server multi-disk functionality. Multi-disk management for virtual servers differs with respect to different resource features. This tutorial mainly concentrates on KVM and Power resource features. It can help users with some real-time examples for adding a new and existing disk to a virtual server.

Prerequisites

You should have IBM Systems Director V6.x.x installed on your system before proceeding. This tutorial assumes that you are familiar with using IBM Systems Director. It also assumes that you have a reasonable understanding of JavaScript Object Notation (JSON) and how to make HTTP GET, POST, PUT, and DELETE calls using your favorite HTTP client and fair understanding of the smcli command of VMControl. This tutorial also assumes that you have a fair understanding of the virtual server resources of VMControl.

System requirements

You should have the following components on your system:

  • Installed and configured copy of IBM Systems Director
  • IBM Systems Director VMControl advanced manager activated
  • HTTP Client to run remote requests
  • Putty to run the CLI commands

Multi-disk management while creating virtual server through REST APIs

1. On the IBM Power platform:

  • Create 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. 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 the 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 the host unique ID 7751:

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

      Listing 1. Sample response representation

    Note: The customization properties for creating 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 new or existing disks while creating a virtual server on the KVM platform.

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

    To add an existing disk, while creating a virtual server on the Power resource feature, use the following table parameters:

    • npivdisks
    • diskphysicalvolumes
    • disks

    To add a new disk, while creating a virtual server on the Power resource feature, use the following table parameters:

    • storagepools
    • npivstoragepools

    Find below the real-time examples for the same:

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

      Create a virtual server on the host unique ID 7751 on the Power platform:

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

      Listing 2 shows the sample JSON to create a new virtual server using the npivdisks table parameter to add an existing disk.

      Listing 2. Sample request representation 1 using npivdisks
      {
          "virtualServer": {
              "properties": [
                  {
                      "name": "name",
                      "value": "VS3"
                  },
                  {
                      "name": "gos",
                      "value": "IBM Power - AIXLINUX"
                  },
                  {
                      "name": "cpudedicated",
                      "value": 1
                  },
                  {
                      "name": "cpumode",
                      "value": "DEDICATED"
                  },
                  {
                      "name": "memsize",
                      "value": "512"
                  }
              ],
              "addRowProperties": [
                  {
                      "assigneddisks": [
                          {
                              "name": "diskpriority",
                              "value": 2
                          },
                          {
                              "name": "addexistingdisk",
                              "value": "npivdisks[16424]"
                          }
                      ]
                  }
              ]
          }
      }

      Listing 3 shows the sample JSON to create a new virtual server using the diskphysicalvolumes table parameter to add an existing disk.

      Listing 3. Sample request representation 2 using diskphysicalvolumes
      {
          "virtualServer": {
              "properties": [
                  {
                      "name": "name",
                      "value": "VS3"
                  },
                  {
                      "name": "gos",
                      "value": "IBM Power - AIXLINUX"
                  },
                  {
                      "name": "cpudedicated",
                      "value": 1
                  },
                  {
                      "name": "cpumode",
                      "value": "DEDICATED"
                  },
                  {
                      "name": "memsize",
                      "value": "512"
                  }
              ],
              "addRowProperties": [
                  {
                      "assigneddisks": [
                          {
                              "name": "diskpriority",
                              "value": 2
                          },
                          {
                              "name": "addexistingdisk",
                              "value": "diskphysicalvolumes[19501]"
                          }
                      ]
                  }
              ]
          }
      }

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

      Listing 4. Sample request representation 3 using storagepools
      {
          "virtualServer": {
              "properties": [
                  {
                      "name": "name",
                      "value": "VS3"
                  },
                  {
                      "name": "gos",
                      "value": "IBM Power - AIXLINUX"
                  },
                  {
                      "name": "cpudedicated",
                      "value": 1
                  },
                  {
                      "name": "cpumode",
                      "value": "DEDICATED"
                  },
                  {
                      "name": "memsize",
                      "value": "512"
                  }
              ],
              "addRowProperties": [
                  {
                      "assigneddisks": [
                          {
                              "name": "diskname",
                              "value": "piyush_disk2"
                          },
                          {
                              "name": "disksize",
                              "value": 2
                          },
                          {
                              "name": "diskpriority",
                              "value": 1
                          },
                          {
                              "name": "adddisklocation",
                              "value": "storagepools[16343]"
                          }
                      ]
                  }
              ]
          }
      }

      Listing 5 shows the sample JSON to create a new virtual server using the npivstoragepools table parameter to add a new disk.

      Listing 5. Sample request representation 4 using npivstoragepools
      {
          "virtualServer": {
              "properties": [
                  {
                      "name": "name",
                      "value": "VS3"
                  },
                  {
                      "name": "gos",
                      "value": "IBM Power - AIXLINUX"
                  },
                  {
                      "name": "cpudedicated",
                      "value": 1
                  },
                  {
                      "name": "cpumode",
                      "value": "DEDICATED"
                  },
                  {
                      "name": "memsize",
                      "value": "512"
                  }
              ],
              "addRowProperties": [
                  {
                      "assigneddisks": [
                          {
                              "name": "diskname",
                              "value": "piyush_disk1"
                          },
                          {
                              "name": "disksize",
                              "value": 2
                          },
                          {
                              "name": "diskpriority",
                              "value": 1
                          },
                          {
                              "name": "adddisklocation",
                              "value": "npivstoragepools[16343]"
                          }
                      ]
                  }
              ]
          }
      }

      Listing 6 shows the sample response after running the above request.

      Listing 6. Sample response
      HTTP/1.1 201 OK
      Cache-Control: no-store
      Set-Cookie: JSESSIONID_ibm_console_80=0000RKkZt6lgPMwBhSZe9IhR7dl;Path=/; Secure
      Set-Cookie: AUTH_JSESSIONID=24mcoj9cotsd8m3r7k7r1lir9dr;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 10:43:24 GMT
      Location: https://1.2.3.4: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/353/
      	activations/1"
      }

2. On the KVM platform:

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

    To add an existing disk, while creating a virtual server on the KVM resource feature, use the following table parameters:

    • existingdisks

    To add a new disk, while creating a virtual server on the KVM resource feature, use the following table parameters:

    • disklocationandsize

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

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

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

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

      Listing 7 shows the sample JSON to create a new virtual server using the existingdisks table parameter to add an existing disk.

      Listing 7. Sample response representation using existingdisks
      {
          "virtualServer": {
              "properties": [
                  {
                      "name": "name",
                      "value": "VS3"
                  },
                  {
                      "name": "cpumin",
                      "value": 1
                  },
                  {
                      "name": "memminvu[MB]",
                      "value": "vmemsize:64"
                  },
                  {
                      "name": "ethernet",
                      "value": " Discovered/br500/0:Auto set"
                  }
              ],
              "addRowProperties": [
                  {
                      "assigneddisks": [
                          {
                              "name": "diskpriority",
                              "value": 2
                          },
                          {
                              "name": "addexistingdisk",
                              "value": "existingdisks[File/6875/6821]"
                          }
                      ]
                  }
              ]
          }
      }

      Listing 8 shows the sample JSON to create a new virtual server using the disklocationandsize table parameter to add a new disk.

      Listing 8. Sample response representation using disklocationandsize
      {
          "virtualServer": {
              "properties": [
                  {
                      "name": "name",
                      "value": "VS3"
                  },
                  {
                      "name": "cpumin",
                      "value": 1
                  },
                  {
                      "name": "memminvu[MB]",
                      "value": "vmemsize:64"
                  },
                  {
                      "name": "ethernet",
                      "value": " Discovered/br500/0:Auto set"
                  }
              ],
              "addRowProperties": [
                  {
                      "assigneddisks": [
                          {
                              "name": "diskname",
                              "value": "VS3"
                          },
                          {
                              "name": "disksize",
                              "value": 10
                          },
                          {
                              "name": "virtualbustype",
                              "value": "ide"
                          },
                          {
                              "name": "virtualdiskemulation",
                              "value": "Hard Disk"
                          },
                          {
                              "name": "adddisklocation",
                              "value": "disklocationandsize[13219]"
                          }
                      ]
                  }
              ]
          }
      }

      Listing 9 shows the sample response after running the above request.

      Listing 9. 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 "
      }

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

    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.


Multi-disk management while creating a virtual server through CLI

1. On the Power platform:

  • Create virtual server customization:

    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. Use the lsvrtcap smcli command with the mkvs option as 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.

    Listing 20. Sample response representation

    Note: The customization properties for creating 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 new or existing disks while creating a virtual server on the KVM platform.

  • Add an existing disk while creating a virtual server:
    • Add an existing disk while creating a virtual server using npivdisks: This example illustrates how to use the npivdisks table parameter to add an existing disk while creating a virtual server.
      Listing 21. Sample response representation
      USERID@c598n34:~> smcli mkvs -n Server-7895-23X-SN103607B -A "name=VS4,
      	gos=IBM Power - AIXLINUX,cpumode=DEDICATED,cpudedicated=1,memsize=512,
      	memunitsize=MB" -s "assigneddisks=addexistingdisk:npivdisks[16424];
      	diskpriority:1" -v
      Attempt to get capabilities.
      Attempt to create virtual server.
      Create virtual server operation completed successfully.
      USERID@c598n34:~>
    • Add an existing disk while creating a virtual server using diskphysicalvolumes: This example illustrates how to use the diskphysicalvolumes table parameter to add an existing disk while virtual server creation:
      Listing 22. Sample response representation
      USERID@c598n34:~> smcli mkvs -n Server-7895-23X-SN103607B -A "name=VS4,
      	gos=IBM Power - AIXLINUX,cpumode=DEDICATED,cpudedicated=1,memsize=512,
      	memunitsize=MB" -s "assigneddisks=addexistingdisk:diskphysicalvolumes
      	[19501];diskpriority:1" -v
      Attempt to get capabilities.
      Attempt to create virtual server.
      Create virtual server operation completed successfully.
      USERID@c598n34:~>
  • Add a new disk while creating a virtual server:
    • Add a new disk while creating a virtual server using storagepools: This example illustrates how to use the storagepools table parameter to add a new disk while creating a virtual server.
      Listing 23. Sample response representation
      USERID@c598n34:~> smcli mkvs -n Server-7895-23X-SN103607B -A "name=VS5,
      	gos=IBM Power - AIXLINUX,cpumode=DEDICATED,cpudedicated=1,memsize=512,
      	memunitsize=MB" -s "assigneddisks=adddisklocation:storagepools[16343];
      	diskpriority:1;diskname:piyush_disk3;disksize:2" -v
      Attempt to get capabilities.
      Attempt to create virtual server.
      Create virtual server operation completed successfully.
      USERID@c598n34:~>
    • Add a new disk while creating a virtual server using npivstoragepools: This example illustrates how to use the npivstoragepools table parameter to add a new disk while creating a virtual server.
      Listing 24. Sample response representation
      USERID@c598n34:~> smcli mkvs -n Server-7895-23X-SN103607B -A "name=VS6,
      	gos=IBM Power - AIXLINUX,cpumode=DEDICATED,cpudedicated=1,memsize=512,
      	memunitsize=MB" -s "assigneddisks=adddisklocation:npivstoragepools
      	[16343];diskpriority:1;diskname:piyush_disk3;disksize:2" -v
      Attempt to get capabilities.
      Attempt to create virtual server.
      Create virtual server operation completed successfully.
      USERID@c598n34:~>

2. On the KVM platform:

  • Add an existing disk while creating a virtual server:
    • Add an existing disk while creating a virtual server using existingdisks: This example illustrates how to use the existingdisks table parameter to add an existing disk while creating a virtual server.
      Listing 25. Sample response representation
      xnl1207:~ # smcli mkvs -A "name=VS1,cpumin=1,memminvu[MB]=vmemsize:64,
      	ethernet=Discovered/br500/0:Auto set" -s "assigneddisks=addexistingdisk:
      	existingdisks[File/6875/6821];diskpriority:2" -i 9.12.32.159 -v
      Attempt to get capabilities.
      Attempt to create virtual server.
      Create virtual server operation completed successfully.
      xnl1207:~ #
  • Add a new disk while creating a virtual server:
    • Add a new disk while creating a virtual server using disklocationandsize: This example illustrates how to use the disklocationandsize table parameter to add a new disk while creating a virtual server.
      Listing 26. Sample response representation
      xnl1207:~ # smcli mkvs -A "name=VS1,cpumin=1,memminvu[MB]=vmemsize:64,
      	ethernet=Discovered/br500/0:Auto set" -s "assigneddisks=adddisklocation:
      	disklocationandsize[13219];diskname:VS1;disksize:10;virtualbustype:ide;
      	virtualdiskemulation:Hard Disk" -i 9.12.32.159 -v
      Attempt to get capabilities.
      Attempt to create virtual server.
      Create virtual server operation completed successfully.
      xnl1207:~ #

Multi-disk management while editing a virtual server through CLI

1. On the Power platform:

  • Edit virtual server customization:

    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. Use the lsvrtcap smcli command with the chvs option as specified below.

    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. IBM 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.

    Listing 27. Sample response representation

    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 to an existing virtual server:
    • Add an existing disk to an existing virtual server using npivdisks: This example illustrates how to use the npivdisks table parameter to add an existing disk to the existing virtual server.
      Listing 28. Sample response representation
      USERID@c598n34:~> smcli chvs -n VS3 -s "assigneddisks=addexistingdisk:npivdisks
      							[16424];diskpriority:1" -v
      Attempt to get capabilities.
      Attempt to modify virtual server 25710 (0x646e).
      Edit virtual server operation completed successfully.
      USERID@c598n34:~>
    • Add an existing disk to an existing virtual server using diskphysicalvolumes: This example illustrates how to use the diskphysicalvolumes table parameter to add an existing disk to the existing virtual server.
      Listing 29. Sample response representation
      USERID@c598n34:~> smcli chvs -n VS3 -s "assigneddisks=addexistingdisk:
      				diskphysicalvolumes[19501];diskpriority:1" -v
      Attempt to get capabilities.
      Attempt to modify virtual server 25710 (0x646e).
      Edit virtual server operation completed successfully.
      USERID@c598n34:~>
  • Add a new disk to an existing virtual server:
    • Add a new disk to an existing virtual server using storagepools: This example illustrates how to use the storagepools table parameter to add a new disk to the existing virtual server.
      Listing 30. Sample response representation
      USERID@c598n34:~> smcli chvs -n VS3 -s "assigneddisks=adddisklocation:
      	storagepools[16343];diskpriority:1;diskname:piyush_disk3;disksize:2" -v
      Attempt to get capabilities.
      Attempt to modify virtual server 25710 (0x646e).
      Edit virtual server operation completed successfully.
      USERID@c598n34:~>
  • Remove a disk from an existing virtual server:
    • Remove a disk from an existing virtual server using assigneddisks: This example illustrates how to remove a disk from an existing virtual server.
      Listing 31. Sample response representation
      USERID@c598n34:~> smcli chvs -A "assigneddisks=-25652" -n 0x646e -v
      Attempt to get capabilities.
      Attempt to modify virtual server 25710 (0x646e).
      Edit virtual server operation completed successfully.
      USERID@c598n34:~>

2. On the KVM platform:

  • Add an existing disk to an existing virtual server:
    • Add existing disk to an existing virtual server using existingdisks: This example illustrates how to use the existingdisks parameter table to add an existing disk to the existing virtual server.
      Listing 32. Sample response representation
      xnl1207:~ # smcli chvs -s "assigneddisks=addexistingdisk:existingdisks
      				[File/23382/18807];diskpriority:7" -n 0x7834 -v
      Attempt to get capabilities.
      Attempt to modify virtual server 30772 (0x7834).
      Edit virtual server operation completed successfully.
      xnl1207:~ #
  • Add a new disk to an existing virtual server:
    • Add a new disk to an existing virtual server using disklocationandsize: This example illustrates how to use the disklocationandsize table parameter to add a new disk to the existing virtual server.
      Listing 33. Sample response representation
      xnl1207:~ # smcli chvs -s "assigneddisks=adddisklocation:disklocationandsize
      		[18807];diskname:new6.3disk;disksize:1;virtualbustype:ide;
      		virtualdiskemulation:Hard Disk" -n 0x7834 -v
      Attempt to get capabilities.
      Attempt to modify virtual server 30772 (0x7834).
      Edit virtual server operation completed successfully.
      xnl1207:~ #
  • Remove a disk from an existing virtual server:
    • Remove a disk from an existing virtual server using assigneddisks: This example illustrates how to remove a disk from an existing virtual server.
      Listing 34. Sample response representation
      xnl1207:~ # smcli chvs -A "assigneddisks[751AF9A46B2C34128EEA164CDA6184DD]=
      					DataDiskRemoved:true" -n 0x7834 -v
      Attempt to get capabilities.
      Attempt to modify virtual server 30772 (0x7834).
      Edit virtual server operation completed successfully.
      xnl1207:~ #

Resources

Learn

Get products and technologies

Discuss

  • Get involved in the My developerWorks community. Connect with other developerWorks users while exploring the developer-driven blogs, forums, groups, and wikis.

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

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.

Choose your display name



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.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

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

 


All information submitted is secure.

Dig deeper into AIX and Unix on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX, Linux
ArticleID=900562
ArticleTitle=Multi-disk management for IBM Systems Director VMControl: Part 1
publish-date=05062013