Azure REST API用于创建Windows VM

时间:2016-04-29 14:39:22

标签: rest azure provisioning

我一直在发送“经典”Azure Service Manager REST调用来配置Windows VM。我发送的XML如下:

<Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Name>server20160427</Name>
<DeploymentSlot>Production</DeploymentSlot>
<Label>c2VydmVyMjAxNjA0Mjc=</Label>  
<RoleList>
    <Role>
        <RoleName>server20160427</RoleName>
        <RoleType>PersistentVMRole</RoleType>
        <LicenseType>Windows_Client</LicenseType>
        <ConfigurationSets>
            <ConfigurationSet i:type="WindowsProvisioningConfigurationSet">
                <ConfigurationSetType>WindowsProvisioningConfiguration</ConfigurationSetType>
                <ComputerName>server20160427</ComputerName>
                <AdminUsername>HMCBuser</AdminUsername>
                <AdminPassword>P@$$w0rD2016!!</AdminPassword>
            </ConfigurationSet>
            <ConfigurationSet> 
                <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>
                <InputEndpoints>
                    <InputEndpoint>
                        <LocalPort>3389</LocalPort>
                        <Name>Remote Desktop</Name> 
                        <Port>3389</Port>
                        <Protocol>TCP</Protocol>                    
                    </InputEndpoint>
                </InputEndpoints>
            </ConfigurationSet>
        </ConfigurationSets>
        <OSVirtualHardDisk>
            <MediaLink>http://server20160427031136.blob.core.windows.net/vhds/a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-R2-20151022-en.us-127GB.vhd</MediaLink>     
            <SourceImageName>03f55de797f546a1b29d1b8d66be687a__Windows-7-Enterprise-N-x64-en.us-201507.20</SourceImageName>
        </OSVirtualHardDisk>
        <RoleSize>Basic_A0</RoleSize>     
    </Role>
</RoleList>
<ReservedIPName>ip-server20160427</ReservedIPName>

我尝试过Azure论坛的一些解决方案。如果我包含<LicenseType>响应文档说The x-ms-version header value '2014-05-01' is not one of the supported version headers.

响应文档说An administrator password must be specified.没有<LicenseType>

此代码之前正在运行,它遵循the documentation for Service Manager Create VM,但在azure论坛上,我发现糟糕的密码错误可能来自格式错误或“乱序”的XML。我在这里错过了依赖性论点吗?

0 个答案:

没有答案