IBM Systems Director VMControl 的多磁盘管理: 第 2 部分

用于捕获虚拟设备和版本控制的多磁盘管理

IBM Systems Director 是一个用于管理物理系统和虚拟系统的平台管理解决方案。IBM Systems Director 为系统管理人员提供了一个虚拟管理平台,帮助降低 IT 管理的复杂性和开销。VMControl 是安装在 IBM Systems Director 上的一个高级插件,用于提供虚拟化功能。本教程将介绍多磁盘管理和版本控制,使用 VMControl 具象状态传输 (REST) 应用程序编程接口 (API) 和命令行接口 (CLI) 来捕获虚拟设备。

Piyush Jain, 高级软件工程师, IBM

http://www.ibm.com/developerworks/i/p-pjain.jpgPiyush Jain 是 IBM 的一名高级软件工程师,目前主要致力于 IBM Systems Director 中的 VMControl,这是 IBM 产品组合中的一个重要产品。他有 5 年的从业经验,从印度卡纳塔克邦的 IET Alwar 获得了信息技术工程学士学位。



2013 年 8 月 26 日

开始之前

了解您希望从本教程中学到的知识,以及如何充分利用该教程。

关于本系列

IBM Systems Director VMControl 高级管理器简化了对跨多种虚拟化技术和硬件平台的虚拟环境的管理。VMControl 是 IBM Systems Director 各个版本附带的领先的多平台虚拟化管理解决方案。VMControl 支持三种类型的接口(GUI、CLI 和 REST API)。本系列包含以下主题:

  • 虚拟服务器的多磁盘管理:对虚拟服务器执行与多磁盘管理有关的操作时,最终用户会面临一些问题,本教程将致力于解决这些问题。对自定义表参数有一定了解的最终用户会发现,很难向虚拟服务器中添加磁盘或从中删除磁盘。
  • 用于创建虚拟设备和版本控制的多磁盘管理:在捕获的同时执行多磁盘管理,以便创建虚拟设备和版本控制,此时最终用户会面临一些问题,本教程将致力于解决这些问题。对自定义表参数有一定了解的最终用户会发现,很难在捕获过程中执行对虚拟设备的多磁盘捕获和版本控制。
  • 用于部署工作负载的多磁盘管理:在执行多磁盘管理以部署工作负载时,最终用户会面临的问题,本教程将致力于解决这些问题。对自定义表参数有一定了解的最终用户会发现,很难在部署期间对磁盘进行修改和映射。

本系列将通过 REST 和 CLI 帮助所有 VMControl 使用者了解 VMControl 多磁盘 (multi-disk) 管理功能。

关于本教程

用于捕获虚拟设备的多磁盘管理和版本控制包括使用 REST API 和命令行接口进行的以下主要操作:

  • 捕获虚拟设备和磁盘
  • 捕获虚拟设备并执行版本控制

以下是用于使用 IBM Systems Director VMControl 捕获虚拟设备的多磁盘管理和版本控制的流程图。

图 1. 用于捕获虚拟设备的多磁盘管理
多磁盘管理
图 2. 用于捕获虚拟设备的版本控制
版本控制

目标

本教程的主要目标是帮助使用者了解如何使用多磁盘和版本控制捕获虚拟设备。本教程将通过使用磁盘和版本控制捕获虚拟设备的一些真实示例,为使用者提供帮助。

先决条件

在继续后面的操作之前,您应该在您的系统上安装 IBM Systems Director V6.x.x。本教程假定您熟悉 IBM Systems Director 的使用。还假定您对 JSON 以及如何使用您喜欢的 HTTP 客户端进行 HTTP GET、POST、PUT 和 DELETE 调用有一定的了解,并且非常了解 VMControl 的 smcli 命令。本教程还假定您对 VMControl 的虚拟设备资源有基本的了解。

系统要求

您应该在您的系统上安装以下组件:

  • 安装并配置 IBM Systems Director
  • 激活 IBM Systems Director VMControl 高级管理器
  • 用于运行远程请求的 HTTP 客户端
  • 用于运行 CLI 命令的 Putty

在通过 REST API 捕获虚拟设备的同时进行多磁盘管理

列出用于创建虚拟设备的自定义设置:

自定义参数是特定于平台的独特属性,它允许用户自定义自己执行的操作。有很多不同类型的自定义参数可供选择,但指定参数的方式都是类似的。使用可捕获的对象标识符 (OID),创建一个指向特定 URL 的 GET 请求。结果将是获得一个与捕获指定存储库中的指定候选虚拟服务器有关的自定义属性列表。

以下示例显示了典型 IBM Power Systems 环境中的自定义参数。其他平台(如 KVM、IBM z/VM 等)的自定义参数可能会有所不同。

用于捕获的典型自定义参数包括磁盘捕获选项、网络描述、操作系统类型以及虚拟设备版本信息。我们的示例指定除了虚拟设备版本信息以外的所有选项。

“capturedisks” 参数表将提供用于捕获与虚拟服务器连接的磁盘的选项,以及用于捕获这些磁盘上的数据的选项。

  • URL
    • https://myserver:port/{webContext}/VMControl/virtualAppliances/candidates/{candidateOID}/customization
  • HTTP 方法
    • GET
  • 样例请求

    获取在存储库的 OID 为 19546 中 OID 为 19698 的候选设备上创建虚拟设备时能够使用的自定义属性:

    GET https://myserver:port/{webContext}/VMControl/virtualAppliances/candidates/19698/customization?repository=19546

    清单 1. 样例响应表示
    {
      "name": "forCapture",
      "uri": "/ibm/director/rest/VMControl/virtualAppliances/candidates/19698/
    					customization?repository=19546",
      "description": "Customizable properties for capturing virtual server 
    					\"19,698\" into repository \"19,546\" ",
      "customizationProperties": [
        {
          "values": [
            {
              "property": [
                {
                  "changeable": false,
                  "type": "text",
                  "description": "Network",
                  "value": "Discovered/1069/0",
                  "columnId": "UNDEFINED",
                  "rules": {}
                },
                {
                  "changeable": true,
                  "type": "text",
                  "description": "Description",
                  "value": "Captured from virtual server IP10-32-73-125_AIX71D_10G 
    	connected to Discovered/1069/0 on host Server-7895-23X-SN10360DB ",
                  "columnId": "description",
                  "rules": {}
                }
              ],
              "id": "[Discovered/1069/0]"
            },
            {
              "property": [
                {
                  "changeable": false,
                  "type": "text",
                  "description": "Network",
                  "value": "Discovered/2/0",
                  "columnId": "UNDEFINED",
                  "rules": {}
                },
                {
                  "changeable": true,
                  "type": "text",
                  "description": "Description",
                  "value": "Captured from virtual server IP10-32-73-125_AIX71D_10G
    	 connected to Discovered/2/0 on host Server-7895-23X-SN10360DB ",
                  "columnId": "description",
                  "rules": {}
                }
              ],
              "id": "[Discovered/2/0]"
            }
          ],
          "options": [
            {
              "property": [
                {
                  "changeable": false,
                  "type": "text",
                  "description": "Network",
                  "value": "Discovered/1069/0",
                  "columnId": "UNDEFINED",
                  "rules": {}
                },
                {
                  "changeable": true,
                  "type": "text",
                  "description": "Description",
                  "value": "Captured from virtual server IP10-32-73-125_AIX71D_10G
    	 connected to Discovered/1069/0 on host Server-7895-23X-SN10360DB ",
                  "columnId": "description",
                  "rules": {}
                }
              ],
              "id": "[Discovered/1069/0]"
            },
            {
              "property": [
                {
                  "changeable": false,
                  "type": "text",
                  "description": "Network",
                  "value": "Discovered/2/0",
                  "columnId": "UNDEFINED",
                  "rules": {}
                },
                {
                  "changeable": true,
                  "type": "text",
                  "description": "Description",
                  "value": "Captured from virtual server IP10-32-73-125_AIX71D_10G
    	 connected to Discovered/2/0 on host Server-7895-23X-SN10360DB ",
                  "columnId": "description",
                  "rules": {}
                }
              ],
              "id": "[Discovered/2/0]"
            }
          ],
          "name": "virtualnetworks",
          "type": "table",
          "description": "Network Mapping",
          "rules": {
            "max": 0,
            "min": 0
          }
        },
        {
          "name": "revisioncomment",
          "type": "text",
          "description": "A text comment that you can use to describe this version 
    							operation.",
          "value": "null",
          "rules": {}
        },
        {
          "name": "parentid",
          "type": "text",
          "description": "The unique ID (OID) of the virtual appliance to be used 
    	as the parent version for the new virtual appliance. To use this 
    	attribute, the committype value must be 1.",
          "value": "null",
          "rules": {}
        },
        {
          "name": "committype",
          "type": "long",
          "description": "0: Create a new version tree with the new virtual 
    	appliance as the root. 1 : Set the version for the new virtual appliance, 
    	based on the virtual appliance from which the virtual server was 
    	originally deployed or the virtual appliance specified by parentID.",
          "value": 0,
          "rules": {
            "max": 1,
            "min": 0
          }
        },
        {
          "values": [{
            "property": [
              {
                "changeable": false,
                "type": "text",
                "description": "Disk Name",
                "value": "IP10-32-73-125_AIX71D_10G",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": false,
                "type": "text",
                "description": "Storage Server",
                "value": "1*7895-23X*10360DB",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": false,
                "type": "text",
                "description": "Size (MB)",
                "value": "10240",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": false,
                "type": "text",
                "description": "Compatible",
                "value": "Yes",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": true,
                "type": "boolean",
                "description": "Include Image",
                "value": true,
                "columnId": "image",
                "rules": {}
              },
              {
                "changeable": true,
                "type": "boolean",
                "description": "Capture Disk",
                "value": true,
                "columnId": "capturedisk",
                "rules": {}
              },
              {
                "changeable": true,
                "type": "text",
                "description": "Disk Description",
                "value": "",
                "columnId": "description",
                "rules": {}
              }
            ],
            "id": "[1]"
          }],
          "options": [{
            "property": [
              {
                "changeable": false,
                "type": "text",
                "description": "Disk Name",
                "value": "IP10-32-73-125_AIX71D_10G",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": false,
                "type": "text",
                "description": "Storage Server",
                "value": "1*7895-23X*10360DB",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": false,
                "type": "text",
                "description": "Size (MB)",
                "value": "10240",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": false,
                "type": "text",
                "description": "Compatible",
                "value": "Yes",
                "columnId": "UNDEFINED",
                "rules": {}
              },
              {
                "changeable": true,
                "type": "boolean",
                "description": "Include Image",
                "value": true,
                "columnId": "image",
                "rules": {}
              },
              {
                "changeable": true,
                "type": "boolean",
                "description": "Capture Disk",
                "value": true,
                "columnId": "capturedisk",
                "rules": {}
              },
              {
                "changeable": true,
                "type": "text",
                "description": "Disk Description",
                "value": "",
                "columnId": "description",
                "rules": {}
              }
            ],
            "id": "[1]"
          }],
          "name": "capturedisks",
          "type": "table",
          "description": "Capture Disks",
          "rules": {
            "max": 1,
            "min": 0
          }
        }
      ]
    }

通过磁盘捕获虚拟设备:

您会发现下面的一些真实示例有一些相同之处:

  • URL
    • https://myserver:port/ibm/director/rest/VMControl/virtualAppliances
  • HTTP 方法
    • POST
  • 样例请求

    使用 capturedisks 参数表创建虚拟设备:

    POST https://myserver:port/ibm/director/rest/VMControl/virtualAppliances

    清单 2. 样例请求表示:
    {
       "virtualAppliance" : 
       {
          "capturable" : "19698",
          "name" : "VA1",
          "description" : "My Virtual Appliance number 1",
          "repository" : 19546,
          "properties" : [
             {
                "name": "capturedisks", 
                "value": "[1]=capturedisk:true;image:true"
             }
          ]
       }
    }

    清单 3 显示了运行上述请求后的样例响应。

    清单 3. 样例响应:
    HTTP/1.1 201 OK
    Cache-Control: no-store
    Set-Cookie: JSESSIONID_ibm_console_80=0000iT9MsmPrKsPNl3UVfxGsRmY;Path=/; Secure
    Set-Cookie: AUTH_JSESSIONID=3tnhb9sfejc3ol9acr2c0memlpl;Path=/; HTTPOnly
    Expires: Thu, 01 Dec 1994 16:00:00 GMT
    Content-Type: application/json; charset=UTF-8
    Content-Length: 284
    Date: Thu, 07 Feb 2013 03:53:47 GMT
    Location: https://10.10.10.10:8422/ibm/director/rest/VMControl/virtualAppliances
    								/25744
    Accept-Ranges: bytes
    Server: Noelios-Restlet-Engine/1.1.4
    Content-Language: en-US
    
    {
        "MessageID": "DNZEMW349I",
        "MessageText": "DNZEMW349I Virtual Appliance \"25744\" is being captured: 
    	Capture/Import 'VA1': My Virtual Appliance number 1 will capture/import 
    	system '19698' into repository '19546' with customization [[ capturedisks[1], 
    	capturedisk:true;image:true ]] "
    }

    用户还将能够使用 https://10.10.10.10:8422/ibm/director/rest/VMControl/virtualAppliances/25744/progress URI 看到作业进度,如清单 4 所示。

    清单 4. 样例响应:
    {
      "logs": [
        {"message": "Start asynch work run for capture VA1"},
        {"message": "DNZLOP411I Capturing virtual server IP10-32-73-125_AIX71D_10G to 
    	virtual appliance VA1 in repository SCS_VIOS_10-32-73-56."},
        {"message": "DNZLOP912I Disk group to be captured: DG_12.20.2012-13:06:54:441 "},
        {"message": "DNZLOP900I Requesting SAN volume(s)"},
        {"message": "DNZLOP948I New disk group: DG_02.06.2013-22:58:48:874 "},
        {"message": "DNZLOP413I The virtual appliance is using disk group DG_02.06.2013
    	-22:58:48:874 with the following SAN volumes: [VA11]."},
        {"message": "DNZLOP414I The virtual server is using disk group DG_12.20.2012-13
    	:06:54:441 with the following SAN volumes: [IP10-32-73-125_AIX71D_10G]."},
        {"message": "DNZLOP909I Copying disk images"},
        {"message": "DNZLOP409I Creating the OVF for the virtual appliance."},
        {"message": "Complete asynch work run for capture VA1"},
        {"message": "OID of new virtual appliance: 25744"}
      ],
      "uri": "/ibm/director/rest/VMControl/virtualAppliances/25744/progress"
    }

    用户可以选择在捕获虚拟设备时指定多个磁盘(如果在捕获自定义中显示)。清单 5 显示指定了两个磁盘的样例请求:

    清单 5. 样例请求表示:
    {
       "virtualAppliance" : 
       {
          "capturable" : "19698",
          "name" : "VA1",
          "description" : "My Virtual Appliance number 1",
          "repository" : 19546,
          "properties" : [
             {
                "name": "capturedisks", 
                "value": "[1]=capturedisk:false;image:false"
             },
             {
                "name": "capturedisks", 
                "value": "[2]=capturedisk:true;image:true"
             }
          ]
       }
    }

在通过 REST API 捕获虚拟设备的同时进行版本控制:

在捕获虚拟设备的同时进行版本控制:

使用版本控制,用户可以管理虚拟设备的版本信息。用户可以设置新虚拟设备的版本或者将其保留为默认值。

用户可以执行以下操作之一:

  1. 创建一个具有新捕获的虚拟设备的新版本树。
  2. 在创建新的虚拟设备期间根据指定的父虚拟设备设置版本。
  3. 根据原来从中部署捕获的虚拟服务器的虚拟设备来设置版本。

同样有三个参数支持 REST API 中的版本控制:

  • committype:
    • 0:创建一个新的版本树,该树将新捕获的虚拟设备作为根。
    • 1:根据原来从中部署虚拟服务器的虚拟设备或由 parentid 参数指定的虚拟设备,为新的虚拟设备设置版本。
  • parentid: 将用作新虚拟设备的父版本的虚拟设备的 OID。若要使用该属性,必须将 committype 设置为 1。
  • revisioncomment: 用户可使用该参数来描述版本操作的注释。

下面是通过 REST API 演示版本控制的一组示例,其中我们捕获了一个虚拟设备三次,以便构建一个版本树。

  • URL
    • https://myserver:port/ibm/director/rest/VMControl/virtualAppliances
  • HTTP Method
    • POST
  • Sample Request

    创建一个虚拟设备:

    POST https://myserver:port/ibm/director/rest/VMControl/virtualAppliances

清单 6 显示了用于创建 committype 为 0 的默认版本的虚拟设备的样例请求。

清单 6. committype 为 0 的样例请求:
{
    "virtualAppliance": {
        "capturable": 19698,
        "name": "VA1",
        "description": "Virtual Appliance",
        "repository": 19546,
        "properties": [
            {
                "name": "revisioncomment",
                "value": "newVA"
            },
            {
                "name": "committype",
                "value": 0
            }
        ]
    }
}

清单 7 显示了 committype 为 0 时该请求的响应。

清单 7. 样例响应:
HTTP/1.1 201 OK
Cache-Control: no-store
Set-Cookie: JSESSIONID_ibm_console_80=0000flCLybSHx_45BDSs8Zq1MwL;Path=/; Secure; HTTPOnly
Set-Cookie: AUTH_JSESSIONID=8qg3l648kalglt30m07dot0h3f;Path=/; HTTPOnly
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 269
Date: Sun, 10 Feb 2013 16:11:47 GMT
Location: https://10.10.10.10:8422/ibm/director/rest/VMControl/virtualAppliances/25894
Accept-Ranges: bytes
Server: Noelios-Restlet-Engine/1.1.4
Content-Language: en-US

{
    "MessageID": "DNZEMW349I",
    "MessageText": "DNZEMW349I Virtual Appliance \"25894\" is being captured: 
	Capture/Import 'VA1': Virtual Appliance will capture/import system '19698' 
	into repository '19546' with customization [[ revisioncomment, newVA ], 
	[ committype, 0 ]] "
}

清单 8 显示虚拟设备的版本为 1.1 并且 TrunkName 为 VA1。

清单 8. 样例响应:
VA1
        TrunkId:5
        Notifiable:true
        ClassName:com.ibm.usmi.datamodel.virtual.VirtualAppliance
        RevisionVersion:1.1
        Description:Virtual Appliance
        ChangedDate:2013-02-10T11:11:57-05:00
        TrunkName:VA1
        DisplayName:VA1
        CreatedDate:2013-02-10T11:11:47-05:00
        RevisionComment:newVA
        SpecificationId:1
        SpecificationVersion:1.1
        OID:25894
        Guid:E606B2BC4002326E9E5BB67D68D20EFF
        ApplianceId:5a36406f-c81f-482e-8583-6d4dd00fff8a
        ObjectType:VirtualAppliance
        DisplayNameSpecified:false

清单 9 显示通过将 VA1 设置为父对象来创建虚拟设备的样例请求。

清单 9. 具有 parentid 和 committype 的样例请求:
{
    "virtualAppliance": {
        "capturable": 19698,
        "name": "VA2",
        "description": "Virtual Appliance",
        "repository": 19546,
        "properties": [
            {
                "name": "revisioncomment",
                "value": "fromVA1"
            },
            {
                "name": "parentid",
                "value": 25894
            },
            {
                "name": "committype",
                "value": 1
            }
        ]
    }
}

清单 10 显示当 parentid 为 25894 且 committype 为 1 时请求的响应。

清单 10. 样例响应:
HTTP/1.1 201 OK
Cache-Control: no-store
Set-Cookie: JSESSIONID_ibm_console_80=0000PcCyXk63XNVkLtYmMI6ASMe;Path=/; Secure; HTTPOnly
Set-Cookie: AUTH_JSESSIONID=jjgjgse8h5pnj4r9h5845jl438;Path=/; HTTPOnly
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 292
Date: Sun, 10 Feb 2013 16:13:34 GMT
Location: https://10.10.10.10:8422/ibm/director/rest/VMControl/virtualAppliances/25899
Accept-Ranges: bytes
Server: Noelios-Restlet-Engine/1.1.4
Content-Language: en-US

{
    "MessageID": "DNZEMW349I",
    "MessageText": "DNZEMW349I Virtual Appliance \"25899\" is being captured: 
	Capture/Import 'VA2': Virtual Appliance will capture/import system '19698' 
	into repository '19546' with customization [[ revisioncomment, fromVA1 ], 
	[ parentid, 25894 ], [ committype, 1 ]] "
}

清单 11 在 TrunkName 与 VA1 相同时将虚拟设备的版本显示为 1.2。

清单 11. 样例响应:
VA2
        TrunkId:5
        Notifiable:true
        ClassName:com.ibm.usmi.datamodel.virtual.VirtualAppliance
        RevisionVersion:1.2
        Description:Virtual Appliance
        ChangedDate:2013-02-10T11:13:42-05:00
        TrunkName:VA1
        DisplayName:VA2
        CreatedDate:2013-02-10T11:13:34-05:00
        RevisionComment:fromVA1
        SpecificationId:1
        SpecificationVersion:1.1
        OID:25899
        Guid:7A2666C8AC8233B6A3DFE327EBBE9DEF
        ApplianceId:c9723643-4f86-4b45-9d6e-d16e1f5796cd
        ObjectType:VirtualAppliance
        DisplayNameSpecified:false

清单 12 显示用于通过再次将 VA1 设置为父对象来创建虚拟设备 VA2 的样例请求。

清单 12. 具有 parentid 和 committype 的样例请求:
{
    "virtualAppliance": {
        "capturable": 19698,
        "name": "VA3",
        "description": "Virtual Appliance",
        "repository": 19546,
        "properties": [
            {
                "name": "revisioncomment",
                "value": "fromVA1"
            },
            {
                "name": "parentid",
                "value": 25894
            },
            {
                "name": "committype",
                "value": 1
            }
        ]
    }
}

清单 13 显示了当 parentid 为 25894 且 committype 为 1 时请求的响应。

清单 13. 样例响应:
HTTP/1.1 201 OK
Cache-Control: no-store
Set-Cookie: JSESSIONID_ibm_console_80=0000tCqnAtX5IJpnNkPhcv8nkIA;Path=/; Secure; HTTPOnly
Set-Cookie: AUTH_JSESSIONID=2rtsibe851tfkaa604rt7i0kadp;Path=/; HTTPOnly
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: application/json; charset=UTF-8
Content-Length: 292
Date: Sun, 10 Feb 2013 16:14:56 GMT
Location: https://10.10.10.10:8422/ibm/director/rest/VMControl/virtualAppliances/25904
Accept-Ranges: bytes
Server: Noelios-Restlet-Engine/1.1.4
Content-Language: en-US

{
    "MessageID": "DNZEMW349I",
    "MessageText": "DNZEMW349I Virtual Appliance \"25904\" is being captured: 
	Capture/Import 'VA3': Virtual Appliance will capture/import system '19698' 
	into repository '19546' with customization [[ revisioncomment, fromVA1 ], 
	[ parentid, 25894 ], [ committype, 1 ]] "
}

清单 14 在 TrunkName 与 VA1 相同时将虚拟设备的版本显示为 1.1.2.1。

清单 14. 样例响应:
VA3
        TrunkId:5
        Notifiable:true
        ClassName:com.ibm.usmi.datamodel.virtual.VirtualAppliance
        RevisionVersion:1.1.2.1
        Description:Virtual Appliance
        ChangedDate:2013-02-10T11:15:06-05:00
        TrunkName:VA1
        DisplayName:VA3
        CreatedDate:2013-02-10T11:14:56-05:00
        RevisionComment:fromVA1
        SpecificationId:1
        SpecificationVersion:1.1
        OID:25904
        Guid:F765FE06603439E7A47A851F1ACF04A6
        ApplianceId:c82cbb31-43ea-4ee8-ac0b-63e59c37fcd0
        ObjectType:VirtualAppliance
        DisplayNameSpecified:false

在通过 CLI 捕获虚拟设备的同时进行多磁盘管理:

列出创建虚拟设备的自定义:

自定义参数是特定于平台的特有属性,用户可以使用这些属性自定义用户执行的操作。有很多种不同类型的自定义参数可供选择,但指定这些参数的方式全都类似。在 lscustomization smcli 命令中使用可捕获的 OID 和存储库 OID,可以获取与捕获指定存储库中指定的候选虚拟服务器有关的自定义属性。

以下示例显示了典型 Power Systems 环境中的自定义参数。其他平台(如 KVM、z/VM 等)的自定义参数将会有所不同。

用于捕获的典型自定义参数包括磁盘捕获选项、网络描述、操作系统类型以及虚拟设备版本信息。我们的示例指定除了虚拟设备版本信息之外的所有内容。有关虚拟设备版本的详细信息,请参阅 IBM Systems Director 6.3.x SDK 信息中心的虚拟设备资源页面。

“capturedisks” 参数表将提供用于捕获与虚拟服务器连接的磁盘的选项,以及用于捕获这些磁盘上数据的选项。

清单 15. 样例响应表示
USERID@c598n34:~> smcli lscustomization -v -a capture -s 19698 -r 19546
Wed Feb 06 22:33:13 EST 2013  lscustomization Operation started.
Get capture customization data
virtualnetworks
        Description:    Network Mapping
        Changeable Columns:
                Column Name*    CLI Attribute
                Description     description

        Options:
        Key,    Network,        Description*
        [Discovered/1069/0] Discovered/1069/0 Captured from VS IP10-32-73-125_AIX71D_10G
        [Discovered/2/0] Discovered/2/0 Captured from VS IP10-32-73-125_AIX71D_10G

revisioncomment
        Value:  null
        Description:  A text comment that you can use to describe this version operation.

parentid
        Value:  null
        Description:    The unique ID (OID) of the virtual appliance to be used as the 
	parent version for the new virtual appliance. To use this attribute, the 
	committype value must be 1.

committype
        Value:  0
        Min:    0
        Max:    1
        Increment:      0
        IncrementType:  LINEAR
        Description:    0: Create a new version tree with the new virtual appliance as 
	the root. 1 : Set the version for the new virtual appliance, based on the virtual 
	appliance from which the virtual server was originally deployed or the virtual 
	appliance specified by parentID.

capturedisks
        Min:    0
        Max:    1
        Description:    Capture Disks
        Changeable Columns:
                Column Name*    CLI Attribute
                Include Image   image
                Capture Disk    capturedisk
                Disk Description        description

        Options:
        Key, Disk Name, Storage, Size (MB), Compatible, Include, Capture , Disk 
                        Server                          Image*   Disk*     Description*
        [1] IP10-32-73-125_AIX71D_10G 1*7895-23X*10360DB 10240   Yes     true    true

Wed Feb 06 22:33:14 EST 2013  lscustomization Operation took 1 seconds.
USERID@c598n34:~>

用户可以选择在捕获虚拟设备时指定一个磁盘。清单 16 显示指定了一个磁盘的样例请求:

清单 16. 样例响应:
USERID@c598n34:~> smcli captureva -s 19698 -r 19546 -n "VA1" 
		-A "capturedisks[1]=capturedisk:true;image:true" -v
Wed Feb 06 23:01:40 EST 2013  captureva Operation started.
Get capture customization data
Update collection with user entered attributes.
Call capture function
DNZLOP411I Capturing virtual server IP10-32-73-125_AIX71D_10G to virtual appliance VA1 in 
	repository SCS_VIOS_10-32-73-56.
DNZLOP912I Disk group to be captured: DG_12.20.2012-13:06:54:441
DNZLOP900I Requesting SAN volume(s)
DNZLOP948I New disk group: DG_02.06.2013-23:01:49:837
DNZLOP413I The virtual appliance is using disk group DG_02.06.2013-23:01:49:837 with the 
	following SAN volumes: [VA12].
DNZLOP414I The virtual server is using disk group DG_12.20.2012-13:06:54:441 with the 
	following SAN volumes: [IP10-32-73-125_AIX71D_10G].
DNZLOP909I Copying disk images
DNZLOP409I Creating the OVF for the virtual appliance.
Call capture command executed. Return code= 25,761
Wed Feb 06 23:01:54 EST 2013  captureva Operation took 14 seconds.
USERID@c598n34:~>

用户可以选择在捕获虚拟设备时指定多个磁盘(如果在捕获自定义中显示)。清单 17 显示指定了两个磁盘的样例请求:

清单 17. 样例请求表示:
USERID@c598n34:~> smcli captureva -s 19698 -r 19546 -n "VA1" 
	-A "capturedisks[1]=capturedisk:false;image:false,
	capturedisks[2]=capturedisk:true;image:true" -v
Sun Feb 10 11:43:06 EST 2013  captureva Operation started.
Get capture customization data
Update collection with user entered attributes.
Call capture function
DNZLOP411I Capturing virtual server IP10-32-73-125_AIX71D_10G to virtual appliance VA1 in
	 repository SCS_VIOS_10-32-73-56.
DNZLOP912I Disk group to be captured: DG_12.20.2012-13:06:54:441
DNZLOP900I Requesting SAN volume(s)
DNZLOP948I New disk group: DG_02.10.2013-11:43:11:856
DNZLOP413I The virtual appliance is using disk group DG_02.10.2013-11:43:11:856 with the 
	 following SAN volumes: [VA15].
DNZLOP414I The virtual server is using disk group DG_12.20.2012-13:06:54:441 with the
	 following SAN volumes: [IP10-32-73-125_AIX71D_10G].
DNZLOP909I Copying disk images
DNZLOP409I Creating the OVF for the virtual appliance.
Call capture command executed. Return code= 25,912
Sun Feb 10 11:43:15 EST 2013  captureva Operation took 9 seconds.
USERID@c598n34:~>

在通过 CLI 捕获虚拟设备的同时进行版本控制:

在捕获虚拟设备的同时进行版本控制

使用版本控制,用户可以管理虚拟设备的版本信息。用户可以设置新虚拟设备的版本或者将其保留为默认值。

用户可以执行以下操作之一:

  1. 创建一个具有新捕获的虚拟设备的新版本树。
  2. 在创建新的虚拟设备期间根据指定的父虚拟设备设置版本。
  3. 根据原来从中部署捕获的虚拟服务器的虚拟设备设置版本。

CLI 中支持版本控制的三个参数与 REST API 中支持的参数相同:

  • committype:
    • 0:创建一个将新虚拟设备为根的新版本树。
    • 1:根据原来从中部署虚拟服务器的虚拟设备或由 parentid 参数指定的虚拟设备,设置新的虚拟设备的版本。
  • parentid: 将用作新的虚拟设备的父版本的虚拟设备的 OID。要使用该属性,必须将 committype 设置为 1。
  • revisioncomment: 用户可使用该参数来描述版本操作的注释。

下面是用来演示通过 CLI 进行版本控制的一组示例。

清单 18 创建一个 committype 为 0 的默认版本的虚拟设备。

清单 18. 样例响应:
USERID@c598n34:~> smcli captureva -s 19698 -r 19546 -n "VA1" 
		-A "revisioncomment=newVA,committype=0" -v
Fri Feb 08 06:20:48 EST 2013  captureva Operation started.
Get capture customization data
Update collection with user entered attributes.
Call capture function
DNZLOP411I Capturing virtual server IP10-32-73-125_AIX71D_10G to virtual appliance VA1 in
		 repository SCS_VIOS_10-32-73-56.
DNZLOP912I Disk group to be captured: DG_12.20.2012-13:06:54:441
DNZLOP900I Requesting SAN volume(s)
DNZLOP948I New disk group: DG_02.08.2013-06:20:54:024
DNZLOP413I The virtual appliance is using disk group DG_02.08.2013-06:20:54:024 with the
		 following SAN volumes: [VA13].
DNZLOP414I The virtual server is using disk group DG_12.20.2012-13:06:54:441 with the
		 following SAN volumes: [IP10-32-73-125_AIX71D_10G].
DNZLOP909I Copying disk images
DNZLOP409I Creating the OVF for the virtual appliance.
Call capture command executed. Return code= 25,856
Fri Feb 08 06:20:57 EST 2013  captureva Operation took 9 seconds.
USERID@c598n34:~>

清单 19 将虚拟设备的版本显示为 1.1 且 TrunkName 为 VA1。

清单 19. 样例响应:
VA1
        TrunkId:4
        Notifiable:true
        ClassName:com.ibm.usmi.datamodel.virtual.VirtualAppliance
        RevisionVersion:1.1
        Description:VA1
        ChangedDate:2013-02-08T06:20:57-05:00
        TrunkName:VA1
        DisplayName:VA1
        CreatedDate:2013-02-08T06:20:57-05:00
        RevisionComment:newVA
        SpecificationId:1
        SpecificationVersion:1.1
        OID:25856
        Guid:7AB74E2EBF333AB9BA254AC4DCCB4066
        ApplianceId:6688bfc7-0101-45ae-b9d2-96e66fd522ce
        ObjectType:VirtualAppliance
        DisplayNameSpecified:true

清单 20 通过将 VA1 设置为父对象来创建一个虚拟设备 VA2。

清单 20. 样例响应:
USERID@c598n34:~> smcli captureva -s 19698 -r 19546 -n "VA2" 
		-A "revisioncomment=fromVA1,parentid=25856,committype=1" -v
Fri Feb 08 06:22:26 EST 2013  captureva Operation started.
Get capture customization data
Update collection with user entered attributes.
Call capture function
DNZLOP411I Capturing virtual server IP10-32-73-125_AIX71D_10G to virtual appliance VA2 in
		 repository SCS_VIOS_10-32-73-56.
DNZLOP912I Disk group to be captured: DG_12.20.2012-13:06:54:441
DNZLOP900I Requesting SAN volume(s)
DNZLOP948I New disk group: DG_02.08.2013-06:23:05:768
DNZLOP413I The virtual appliance is using disk group DG_02.08.2013-06:23:05:768 with the 
		following SAN volumes: [VA27].
DNZLOP414I The virtual server is using disk group DG_12.20.2012-13:06:54:441 with the 
		following SAN volumes: [IP10-32-73-125_AIX71D_10G].
DNZLOP909I Copying disk images
DNZLOP409I Creating the OVF for the virtual appliance.
Call capture command executed. Return code= 25,869
Fri Feb 08 06:23:09 EST 2013  captureva Operation took 43 seconds.
USERID@c598n34:~>

清单 21 在 TrunkName 与 VA1 相同时将虚拟设备的版本显示为 1.2。

清单 21. 样例响应:
VA2
        TrunkId:4
        Notifiable:true
        ClassName:com.ibm.usmi.datamodel.virtual.VirtualAppliance
        RevisionVersion:1.2
        Description:VA2
        ChangedDate:2013-02-08T06:23:09-05:00
        TrunkName:VA1
        DisplayName:VA2
        CreatedDate:2013-02-08T06:23:09-05:00
        RevisionComment:fromVA1
        SpecificationId:1
        SpecificationVersion:1.1
        OID:25869
        Guid:D4D860743A043874846CA71A90C6FF3B
        ApplianceId:d7520c31-132e-436a-8b5f-d24e80cda5d7
        ObjectType:VirtualAppliance
        DisplayNameSpecified:true

清单 22 通过再次将 VA1 设置为父对象来创建一个虚拟设备 VA3。

清单 22. 样例响应:
USERID@c598n34:~> smcli captureva -s 19698 -r 19546 -n "VA3" 
		-A "revisioncomment=fromVA1,parentid=25856,committype=1" -v
Fri Feb 08 06:23:38 EST 2013  captureva Operation started.
Get capture customization data
Update collection with user entered attributes.
Call capture function
DNZLOP411I Capturing virtual server IP10-32-73-125_AIX71D_10G to virtual appliance VA3 in
		 repository SCS_VIOS_10-32-73-56.
DNZLOP912I Disk group to be captured: DG_12.20.2012-13:06:54:441
DNZLOP900I Requesting SAN volume(s)
DNZLOP948I New disk group: DG_02.08.2013-06:23:43:658
DNZLOP413I The virtual appliance is using disk group DG_02.08.2013-06:23:43:658 with the
		 following SAN volumes: [VA33].
DNZLOP414I The virtual server is using disk group DG_12.20.2012-13:06:54:441 with the
		 following SAN volumes: [IP10-32-73-125_AIX71D_10G].
DNZLOP909I Copying disk images
DNZLOP409I Creating the OVF for the virtual appliance.
Call capture command executed. Return code= 25,882
Fri Feb 08 06:24:23 EST 2013  captureva Operation took 45 seconds.
USERID@c598n34:~>

清单 23 在 TrunkName 与 VA1 相同时将虚拟设备的版本显示为 1.1.2.1。

清单 23. 样例响应:
VA3
        TrunkId:4
        Notifiable:true
        ClassName:com.ibm.usmi.datamodel.virtual.VirtualAppliance
        RevisionVersion:1.1.2.1
        Description:VA3
        ChangedDate:2013-02-08T06:24:23-05:00
        TrunkName:VA1
        DisplayName:VA3
        CreatedDate:2013-02-08T06:24:23-05:00
        RevisionComment:fromVA1
        SpecificationId:1
        SpecificationVersion:1.1
        OID:25882
        Guid:C900B396697030E086741C1F000BC49B
        ApplianceId:e1933e72-4a1c-46d1-afd3-029820ee6a7d
        ObjectType:VirtualAppliance
        DisplayNameSpecified:true

参考资料

学习

获得产品和技术

讨论

条评论

developerWorks: 登录

标有星(*)号的字段是必填字段。


需要一个 IBM ID?
忘记 IBM ID?


忘记密码?
更改您的密码

单击提交则表示您同意developerWorks 的条款和条件。 查看条款和条件

 


在您首次登录 developerWorks 时,会为您创建一份个人概要。您的个人概要中的信息(您的姓名、国家/地区,以及公司名称)是公开显示的,而且会随着您发布的任何内容一起显示,除非您选择隐藏您的公司名称。您可以随时更新您的 IBM 帐户。

所有提交的信息确保安全。

选择您的昵称



当您初次登录到 developerWorks 时,将会为您创建一份概要信息,您需要指定一个昵称。您的昵称将和您在 developerWorks 发布的内容显示在一起。

昵称长度在 3 至 31 个字符之间。 您的昵称在 developerWorks 社区中必须是唯一的,并且出于隐私保护的原因,不能是您的电子邮件地址。

标有星(*)号的字段是必填字段。

(昵称长度在 3 至 31 个字符之间)

单击提交则表示您同意developerWorks 的条款和条件。 查看条款和条件.

 


所有提交的信息确保安全。


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=10
Zone=AIX and UNIX, Linux
ArticleID=942416
ArticleTitle=IBM Systems Director VMControl 的多磁盘管理: 第 2 部分
publish-date=08262013