共用方式為


從資源庫建立新的 VM 角色實例 [SPFSDK][VMROLE]

 

適用于:Windows Azure Pack

VM 角色是從 VM 角色資源庫專案建立。 資源庫專案提供必須自訂的範本。 然後,建立 VM 角色物件之後,物件會傳送至服務管理 API 租使用者服務,並在其中驗證及處理。

若要從資源庫專案建立新的 VM 角色,請遵循下列步驟,如下所述:

  1. 取得或建立雲端服務物件

  2. 取得 VM 角色資源庫專案的參考

  3. 從 VM 角色資源庫專案取得資源定義

  4. 收集資源定義參數

  5. 從資源定義參數建置資源組態 JSON 物件

  6. 建置和提交 VM 角色實例 JSON 物件

提示

如需 URL 中使用的預留位置詳細資訊,請參閱 VM 角色 [SPFSDK][VMROLE] 的 URL 速查表

重要

每當您在雲端服務記憶體取資源時,都必須附加 api-version=2013-03 查詢字串。 查詢字串一律以 URL 之後的 字元開頭。

取得或建立雲端服務物件

首先,您必須取得或建立雲端服務。 如需詳細資訊,請參閱建立雲端服務以裝載 VM 角色 [SPFSDK][VMROLE]。 這是必要步驟,因為每個 VM 角色都裝載在雲端服務中。 只有在您想要擷取 VM 角色實例,或建立新的 VM 角色實例時,才會使用雲端服務。 識別出要使用的雲端服務之後,請尋找 VM 角色資源庫專案,其作用就像範本一樣。 您可以使用 VM 角色資源庫專案來建立 VM 角色。

您想要具現化的 VM 角色必須提供給您目前正在運作的租使用者訂用帳戶。 搭配Gallery/GalleryItems集合使用 HTTP GET作業。 此集合位於 HTTPs:// server-nameserver-port/subscription-id/Gallery/GalleryItems/$/MicrosoftCompute.VMRoleGalleryItem?api-version=2013-03。

HTTP POST 要求

GET https://smapi-server:30006/01274684-6afa-4f3f-b62f-353c6202fed1/Gallery/GalleryItems/$/MicrosoftCompute.VMRoleGalleryItem?api-version=2013-03 HTTP/1.1
x-ms-principal-id: user@domain.com
Accept: application/json
Host: smapi-server:30006
Connection: Keep-Alive

HTTP POST 回應

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 973
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Content-Language: en-US
Server: Microsoft-IIS/8.5
X-Content-Type-Options: nosniff
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Mon, 16 Sep 2013 22:32:49 GMT

{
    "odata.metadata": "https://spf-server:8090/SC2012R2/VMM/GalleryService.svc/$metadata#GalleryItems/MicrosoftCompute.VMRoleGalleryItem",
    "value": [{
        "ContentUrl": "Gallery/GalleryItems(Name%3d%27CentOS6LAMP%27,Version%3d%271.0.0.0%27,Publisher%3d%27Microsoft%27)/Content",
        "Description": "Deploy a CentOS 6 VM role with Apache, MySQL and PHP installed.",
        "IconUrl": null,
        "Label": "CentOS6 LAMP Role",
        "Name": "CentOS6LAMP",
        "PublishDate": "2013-09-05T18:35:00.967",
        "Publisher": "Microsoft",
        "PublisherLabel": "Microsoft",
        "ResourceDefinition@odata.mediaContentType": "application/json",
        "ResourceDefinitionUrl": "Gallery/GalleryItems(Name%3d%27CentOS6LAMP%27,Version%3d%271.0.0.0%27,Publisher%3d%27Microsoft%27)/MicrosoftCompute.ResourceDefinitionGalleryItem/ResourceDefinition",
        "Version": "1.0.0.0",
        "ViewDefinitionUrl": "Gallery/ViewDefinitions(Name%3d%27CentOS6LAMP%27,Version%3d%271.0.0.0%27,Publisher%3d%27Microsoft%27)/%24value",
        "odata.type": "MicrosoftCompute.VMRoleGalleryItem"
    }]
}

VM 角色資源庫專案 MicrosoftCompute.VMRoleGalleryItem具有名為 ResourceDefinitionUrl的屬性。 此 URL 代表資源庫專案的資源定義位置。 資源定義是當您建立 VM 角色的新實例時所使用的範本。 一般而言,資源定義具有您必須提供值的參數清單。 這些參數可用來在建立實例時設定 VM 角色。

使用現有 VM 角色資源庫專案的參考,請在從ResourceDefinitionUrl屬性識別的 URL 上使用 HTTP GET作業。 此 URL 會附加在租使用者 URL 的訂用帳戶之後:HTTPs:// server:30006/subscription-id/ResourceDefinitionUrl?api-version=2013-03。 如需 ResourceDefinition 物件的詳細資訊,請參閱 ResourceDefinition [SPFSDK][VMROLE]

HTTP POST 要求

GET https://smapi-server:30006/01274684-6afa-4f3f-b62f-353c6202fed1/Gallery/GalleryItems(Name%3d%27CentOS6LAMP%27,Version%3d%271.0.0.0%27,Publisher%3d%27Microsoft%27)/MicrosoftCompute.ResourceDefinitionGalleryItem/ResourceDefinition?api-version=2013-03 HTTP/1.1
x-ms-principal-id: user@domain.com
Accept: application/json
Host: smapi-server:30006

HTTP POST 回應

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 2009
Content-Type: application/json
Content-Language: en-US
Server: Microsoft-IIS/8.5
X-Content-Type-Options: nosniff
DataServiceVersion: 1.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Thu, 19 Sep 2013 20:00:23 GMT

{
    "IntrinsicSettings": {
        "HardwareProfile": { "VMSize": "[Param.VMRoleVMSize]" },
        "NetworkProfile": { ... removed for brevity ... }
    },
    "Name": "CentOS6LAMP",
    "Publisher": "Microsoft",
    "ResourceExtensionReferences": [{ ... removed for brevity ... }],
    "ResourceParameters": [{
            "Description": "Computer size",
            "Name": "VMRoleVMSize",
            "Type": "String"
        },
        {
            "Description": "Operating system disk",
            "Name": "VMRoleOSVirtualHardDiskImage",
            "Type": "String"
        },
        {
            "Description": "Network reference",
            "Name": "VMRoleNetworkRef",
            "Type": "String"
        },
        {
            "Description": "Resource Extension CentOS6LAMP. Parameter MySQLRootPassword. Run conce command parameter",
            "Name": "CentOS6LAMPMySQLRootPassword",
            "Type": "SecureString"
        },
        {
            "Description": "Compute name pattern",
            "Name": "VMRoleComputerNamePattern",
            "Type": "String"
        },
        {
            "Description": "Time zone",
            "Name": "VMRoleTimeZone",
            "Type": "String"
        },
        {
            "Description": "Administrator credential",
            "Name": "VMRoleAdminCredential",
            "Type": "Credential"
        },
        {
            "Description": "DNS domain name",
            "Name": "VMRoleDNSDomainName",
            "Type": "String"
        },
        {
            "Description": "SSH public key",
            "Name": "VMRoleSSHPublicKey",
            "Type": "String"
        }
    ],
    "SchemaVersion": "1.0",
    "Type": "Microsoft.Compute/VMRole/1.0",
    "Version": "1.0.0.0"
};

收集資源定義參數

每個資源定義都可以有一份參數清單,您必須提供值。 首先,您必須檢查是否有任何參數。 如果有,您可以為每個參數提供值,並將產生的清單封裝到另一個物件。 從上一個步驟擷取資源定義之後,請檢查 ResourceParameters 屬性。 此屬性會保存資源定義所定義及使用的參數清單。 此清單可以是空白的。 如果沒有,您必須為每個參數提供一個值。

資源定義參數和您提供的值會封裝成 JSON 編碼字串。 字串的格式為: { 「parameter1 name」 : 「parameter1 value」, 「parameter2 name」 : 「parameter2 value」, ... }。

"ResourceParameters": [{
        "Description": "Computer size",
        "Name": "VMRoleVMSize",
        "Type": "String"
    },
    {
        "Description": "Operating system disk",
        "Name": "VMRoleOSVirtualHardDiskImage",
        "Type": "String"
    }
]

例如,如果資源定義的參數如先前的程式碼範例所示,封裝的 JSON 編碼字串可能如下所示。

"{\"VMRoleVMSize\":\"ExtraSmall\",\"VMRoleOSVirtualHardDiskImage\":\"CentOS Linux 6 (64-bit):1.0.0.0\"}"

如需 ResourceParameters 屬性的詳細資訊,請參閱 ResourceDefinition [SPFSDK][VMROLE]

從資源定義參數建置資源組態 JSON 物件

ResourceConfiguration物件代表用來建立 VM 角色的參數值。 ResourceConfiguration物件也包含版本欄位,代表提供的參數值版本。 例如,使用上一節的參數值,範例程式碼會顯示 ResourceConfiguration 物件。

{
    "Version": "1.0.0.0",
    "ParameterValues": "{\"VMRoleVMSize\":\"ExtraSmall\",\"VMRoleOSVirtualHardDiskImage\":\"CentOS Linux 6 (64-bit):1.0.0.0\"}"
}

如需 ResourceConfiguration 物件的詳細資訊,請參閱 ResourceConfiguration [SPFSDK][VMROLE]

建置和提交 VM 角色實例 JSON 物件

使用現有 ResourceDefinition 物件的參考和您所建立的 ResourceConfiguration 物件,即可建立新的 VirtualMachineRole 物件。 VirtualMachineRole物件接著會提交至伺服器做為 HTTP POST作業的主體。 的 POST URL 是 https://server:30006/subscription-id/CloudServices/cloudservice-name/Resources/MicrosoftCompute/VMRoles?api-version=2013-03

下列 JSON 物件是提交至伺服器的 VM 角色範例。 請注意,已提供 ResourceConfigurationResourceDefinitionLabelName 屬性。 如需 VirtualMachineRole 物件的詳細資訊,請參閱 VirtualMachineRole (實例) [SPFSDK][VMROLE]

{
    "InstanceView": null,
    "Label": "Description of the VM Role Instance",
    "Name": "MyVMRole",
    "ProvisioningState": null,
    "ResourceConfiguration": {
        "ParameterValues": "{\"VMRoleVMSize\" : \"ExtraSmall\",\"VMRoleOSVirtualHardDiskImage\" : \"CentOS Linux 6 (64-bit):1.0.0.0\",\"VMRoleNetworkRef\" : \"My VM Network\",\"CentOS6LAMPMySQLRootPassword\" : \"!!pass3abc12\",\"VMRoleComputerNamePattern\" : \"LAMP###\",\"VMRoleTimeZone\" : \"Pacific Standard Time\",\"VMRoleAdminCredential\" : \"root:!!pass3abc12\",\"VMRoleDNSDomainName\" : \"mydns\",\"VMRoleSSHPublicKey\" : \"key123\"}",
        "Version": "1.0.0.0"
    },
    "ResourceDefinition": {
        "IntrinsicSettings": {
            "HardwareProfile": { "VMSize": "[Param.VMRoleVMSize]" },
            "NetworkProfile": {
                "NetworkAdapters": [{
                    "IPAddresses": [{
                        "AllocationMethod": "Dynamic",
                        "ConfigurationName": "IPV4Configuration",
                        "LoadBalancerConfigurations": [],
                        "Type": "IPV4"
                    }],
                    "Name": "NIC1",
                    "NetworkRef": "[Param.VMRoleNetworkRef]"
                }]
            },
            "OperatingSystemProfile": {
                "AdminCredential": "[Param.VMRoleAdminCredential]",
                "ComputerNamePattern": "[Param.VMRoleComputerNamePattern]",
                "LinuxOperatingSystemProfile": {
                    "DNSDomainName": "[Param.VMRoleDNSDomainName]",
                    "SSHPublicKey": "[Param.VMRoleSSHPublicKey]"
                },
                "TimeZone": "[Param.VMRoleTimeZone]",
                "WindowsOperatingSystemProfile": null
            },
            "ScaleOutSettings": {
                "InitialInstanceCount": "1",
                "MaximumInstanceCount": "5",
                "MinimumInstanceCount": "1",
                "UpgradeDomainCount": "1"
            },
            "StorageProfile": {
                "DataVirtualHardDisks": [],
                "OSVirtualHardDiskImage": "[Param.VMRoleOSVirtualHardDiskImage]"
            }
        },
        "Name": "CentOS6LAMP",
        "Publisher": "Microsoft",
        "ResourceExtensionReferences": [{
            "Name": "CentOS6LAMP",
            "Publisher": "Microsoft",
            "ReferenceName": "CentOS6LAMP",
            "ResourceExtensionParameterValues": "{\"MySQLRootPassword\":\"[Param.CentOS6LAMPMySQLRootPassword]\"}",
            "Version": "1.0.0.0"
        }],
        "ResourceParameters": [{
            "Description": "Computer size",
            "Name": "VMRoleVMSize",
            "Type": "String"
        },
            {
                "Description": "Operating system disk",
                "Name": "VMRoleOSVirtualHardDiskImage",
                "Type": "String"
            },
            {
                "Description": "Network reference",
                "Name": "VMRoleNetworkRef",
                "Type": "String"
            },
            {
                "Description": "Resource Extension CentOS6LAMP. Parameter MySQLRootPassword. Run conce command parameter",
                "Name": "CentOS6LAMPMySQLRootPassword",
                "Type": "SecureString"
            },
            {
                "Description": "Compute name pattern",
                "Name": "VMRoleComputerNamePattern",
                "Type": "String"
            },
            {
                "Description": "Time zone",
                "Name": "VMRoleTimeZone",
                "Type": "String"
            },
            {
                "Description": "Administrator credential",
                "Name": "VMRoleAdminCredential",
                "Type": "Credential"
            },
            {
                "Description": "DNS domain name",
                "Name": "VMRoleDNSDomainName",
                "Type": "String"
            },
            {
                "Description": "SSH public key",
                "Name": "VMRoleSSHPublicKey",
                "Type": "String"
            }
        ],
        "SchemaVersion": "1.0",
        "Type": "Microsoft.Compute/VMRole/1.0",
        "Version": "1.0.0.0"
    },
    "Substate": null
}

HTTP POST 要求

POST https://smapi-server:30006/01274684-6afa-4f3f-b62f-353c6202fed1/CloudServices/TestVM/Resources/MicrosoftCompute/VMRoles?api-version=2013-03 HTTP/1.1
x-ms-principal-id: user@domain.com
Accept: application/json
Content-Type: application/json
Host: smapi-server:30006
Content-Length: 2676
Expect: 100-continue
Connection: Keep-Alive

{"InstanceView":null,"Label":"Description Value Here","Name":"ExampleVMRole","ProvisioningState":null,"ResourceConfiguration":{"ParameterValues":"{\"VMRoleVMSize\" : \"ExtraSmall\",\"VMRoleOSVirtualHardDiskImage\" : \"CentOS Linux 6 (64-bit):1.0.0.0\",\"VMRoleNetworkRef\" : \"My VM Network\",\"CentOS6LAMPMySQLRootPassword\" : \"!!pass3abc12\",\"VMRoleComputerNamePattern\" : \"LAMP###\",\"VMRoleTimeZone\" : \"Pacific Standard Time\",\"VMRoleAdminCredential\" : \"root:!!pass3abc12\",\"VMRoleDNSDomainName\" : \"mydns\",\"VMRoleSSHPublicKey\" : \"andy\"}","Version":"1.0.0.0"},"ResourceDefinition":{"IntrinsicSettings":{"HardwareProfile":{"VMSize":"[Param.VMRoleVMSize]"},"NetworkProfile":{"NetworkAdapters":[{"IPAddresses":[{"AllocationMethod":"Dynamic","ConfigurationName":"IPV4Configuration","LoadBalancerConfigurations":[],"Type":"IPV4"}],"Name":"NIC1","NetworkRef":"[Param.VMRoleNetworkRef]"}]},"OperatingSystemProfile":{"AdminCredential":"[Param.VMRoleAdminCredential]","ComputerNamePattern":"[Param.VMRoleComputerNamePattern]","LinuxOperatingSystemProfile":{"DNSDomainName":"[Param.VMRoleDNSDomainName]","SSHPublicKey":"[Param.VMRoleSSHPublicKey]"},"TimeZone":"[Param.VMRoleTimeZone]","WindowsOperatingSystemProfile":null},"ScaleOutSettings":{"InitialInstanceCount":"1","MaximumInstanceCount":"5","MinimumInstanceCount":"1","UpgradeDomainCount":"1"},"StorageProfile":{"DataVirtualHardDisks":[],"OSVirtualHardDiskImage":"[Param.VMRoleOSVirtualHardDiskImage]"}},"Name":"CentOS6LAMP","Publisher":"Microsoft","ResourceExtensionReferences":[{"Name":"CentOS6LAMP","Publisher":"Microsoft","ReferenceName":"CentOS6LAMP","ResourceExtensionParameterValues":"{\"MySQLRootPassword\":\"[Param.CentOS6LAMPMySQLRootPassword]\"}","Version":"1.0.0.0"}],"ResourceParameters":[{"Description":"Computer size","Name":"VMRoleVMSize","Type":"String"},{"Description":"Operating system disk","Name":"VMRoleOSVirtualHardDiskImage","Type":"String"},{"Description":"Network reference","Name":"VMRoleNetworkRef","Type":"String"},{"Description":"Resource Extension CentOS6LAMP. Parameter MySQLRootPassword. Run conce command parameter","Name":"CentOS6LAMPMySQLRootPassword","Type":"SecureString"},{"Description":"Compute name pattern","Name":"VMRoleComputerNamePattern","Type":"String"},{"Description":"Time zone","Name":"VMRoleTimeZone","Type":"String"},{"Description":"Administrator credential","Name":"VMRoleAdminCredential","Type":"Credential"},{"Description":"DNS domain name","Name":"VMRoleDNSDomainName","Type":"String"},{"Description":"SSH public key","Name":"VMRoleSSHPublicKey","Type":"String"}],"SchemaVersion":"1.0","Type":"Microsoft.Compute\/VMRole\/1.0","Version":"1.0.0.0"},"Substate":null}

HTTP POST 回應

HTTP/1.1 201 Created
Cache-Control: no-cache
Content-Length: 4839
Content-Type: application/json; odata=minimalmetadata; streaming=true; charset=utf-8
Location: https://spf-server:8090/SC2012R2/VMM/Microsoft.Management.Odata.svc/VMRole/ExampleVMRole
Server: Microsoft-IIS/8.5
x-ms-request-id: 01095ac2-df63-4930-8782-691a8c365319
X-Content-Type-Options: nosniff
request-id: 68d9b05b-a9da-0000-2f56-de68daa9ce01
DataServiceVersion: 3.0;
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ASP.NET
Date: Thu, 19 Sep 2013 22:17:57 GMT

{"odata.metadata":"https://spf-server:8090/SC2012R2/VMM/Microsoft.Management.Odata.svc/$metadata#VMRole/@Element","Name":"ExampleVMRole","Label":"Description Value Here","ResourceDefinition":{"Name":"CentOS6LAMP","Version":"1.0.0.0","Publisher":"Microsoft","SchemaVersion":"1.0","Type":"Microsoft.Compute/VMRole/1.0","ResourceParameters":[{"Name":"VMRoleVMSize","Type":"String","Description":"Computer size"},{"Name":"VMRoleOSVirtualHardDiskImage","Type":"String","Description":"Operating system disk"},{"Name":"VMRoleNetworkRef","Type":"String","Description":"Network reference"},{"Name":"CentOS6LAMPMySQLRootPassword","Type":"SecureString","Description":"Resource Extension CentOS6LAMP. Parameter MySQLRootPassword. Run conce command parameter"},{"Name":"VMRoleComputerNamePattern","Type":"String","Description":"Compute name pattern"},{"Name":"VMRoleTimeZone","Type":"String","Description":"Time zone"},{"Name":"VMRoleAdminCredential","Type":"Credential","Description":"Administrator credential"},{"Name":"VMRoleDNSDomainName","Type":"String","Description":"DNS domain name"},{"Name":"VMRoleSSHPublicKey","Type":"String","Description":"SSH public key"}],"ResourceExtensionReferences":[{"ReferenceName":"CentOS6LAMP","Name":"CentOS6LAMP","Version":"1.0.0.0","Publisher":"Microsoft","ResourceExtensionParameterValues":"{\"MySQLRootPassword\":\"[Param.CentOS6LAMPMySQLRootPassword]\"}"}],"IntrinsicSettings":{"ScaleOutSettings":{"InitialInstanceCount":"1","MaximumInstanceCount":"5","MinimumInstanceCount":"1","UpgradeDomainCount":"1"},"HardwareProfile":{"VMSize":"[Param.VMRoleVMSize]"},"StorageProfile":{"OSVirtualHardDiskImage":"[Param.VMRoleOSVirtualHardDiskImage]","DataVirtualHardDisks":[]},"OperatingSystemProfile":{"ComputerNamePattern":"[Param.VMRoleComputerNamePattern]","TimeZone":"[Param.VMRoleTimeZone]","AdminCredential":"[Param.VMRoleAdminCredential]","WindowsOperatingSystemProfile":{"WorkgroupName":null,"DomainJoin":null},"LinuxOperatingSystemProfile":{"DNSDomainName":"[Param.VMRoleDNSDomainName]","SSHPublicKey":"[Param.VMRoleSSHPublicKey]"}},"NetworkProfile":{"NetworkAdapters":[{"Name":"NIC1","NetworkRef":"[Param.VMRoleNetworkRef]","IPAddresses":[{"AllocationMethod":"Dynamic","Type":"IPV4","ConfigurationName":"IPV4Configuration","LoadBalancerConfigurations":[]}]}]}}},"ResourceConfiguration":{"Version":"1.0.0.0","ParameterValues":"{\"VMRoleVMSize\":\"ExtraSmall\",\"VMRoleOSVirtualHardDiskImage\":\"CentOS Linux 6 (64-bit):1.0.0.0\",\"VMRoleNetworkRef\":\"My VM Network\",\"CentOS6LAMPMySQLRootPassword\":\"__**__\",\"VMRoleComputerNamePattern\":\"LAMP###\",\"VMRoleTimeZone\":\"Pacific Standard Time\",\"VMRoleAdminCredential\":\"root:__**__\",\"VMRoleDNSDomainName\":\"mydns\",\"VMRoleSSHPublicKey\":\"andy\"}"},"ProvisioningState":"Provisioning","Substate":{"VMRoleMessages":[]},"InstanceView":{"VIPs":[],"InstanceCount":"0","ResolvedResourceDefinition":{"Name":"CentOS6LAMP","Version":"1.0.0.0","Publisher":"Microsoft","SchemaVersion":"1.0","Type":"Microsoft.Compute/VMRole/1.0","ResourceParameters":[{"Name":"VMRoleVMSize","Type":"String","Description":"Computer size"},{"Name":"VMRoleOSVirtualHardDiskImage","Type":"String","Description":"Operating system disk"},{"Name":"VMRoleNetworkRef","Type":"String","Description":"Network reference"},{"Name":"CentOS6LAMPMySQLRootPassword","Type":"SecureString","Description":"Resource Extension CentOS6LAMP. Parameter MySQLRootPassword. Run conce command parameter"},{"Name":"VMRoleComputerNamePattern","Type":"String","Description":"Compute name pattern"},{"Name":"VMRoleTimeZone","Type":"String","Description":"Time zone"},{"Name":"VMRoleAdminCredential","Type":"Credential","Description":"Administrator credential"},{"Name":"VMRoleDNSDomainName","Type":"String","Description":"DNS domain name"},{"Name":"VMRoleSSHPublicKey","Type":"String","Description":"SSH public key"}],"ResourceExtensionReferences":[{"ReferenceName":"CentOS6LAMP","Name":"CentOS6LAMP","Version":"1.0.0.0","Publisher":"Microsoft","ResourceExtensionParameterValues":"{\"MySQLRootPassword\":\"__**__\"}"}],"IntrinsicSettings":{"ScaleOutSettings":{"InitialInstanceCount":"1","MaximumInstanceCount":"5","MinimumInstanceCount":"1","UpgradeDomainCount":"1"},"HardwareProfile":{"VMSize":"ExtraSmall"},"StorageProfile":{"OSVirtualHardDiskImage":"CentOS Linux 6 (64-bit):1.0.0.0","DataVirtualHardDisks":[]},"OperatingSystemProfile":{"ComputerNamePattern":"LAMP###","TimeZone":"Pacific Standard Time","AdminCredential":"root:__**__","WindowsOperatingSystemProfile":{"WorkgroupName":null,"DomainJoin":null},"LinuxOperatingSystemProfile":{"DNSDomainName":"mydns","SSHPublicKey":"andy"}},"NetworkProfile":{"NetworkAdapters":[{"Name":"NIC1","NetworkRef":"My VM Network","IPAddresses":[{"AllocationMethod":"Dynamic","Type":"IPV4","ConfigurationName":"IPV4Configuration","LoadBalancerConfigurations":[]}]}]}}}}}

另請參閱

布建 VM 角色 [SPFSDK][VMROLE]
建立雲端服務來裝載 VM 角色 [SPFSDK][VMROLE]
檢查 VM 角色是否有布建錯誤 [SPFSDK][VMROLE]