0
  <PersistentVMRole xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <RoleName>SomeName</RoleName>
      <RoleType>PersistentVMRole</RoleType>
      <ConfigurationSets>
        <!--Include either a WindowsProvisioningConfigurationSet or a LinuxProvisioningConfigurationSet, but not both -->
        <ConfigurationSet>
          <ConfigurationType>WindowsProvisioningConfiguration</ConfigurationType>
          <ComputerName>cedvill00</ComputerName>
          <AdminPassword>MyPassword!</AdminPassword>
          <EnableAutomaticUpdates>true</EnableAutomaticUpdates>
          <TimeZone></TimeZone>
          <DomainJoin>
            <Credentials>
              <Username>user-name-in-the-domain</Username>
              <Password>password-for-the-user-name</Password>
            </Credentials>
            <JoinDomain></JoinDomain>
            <MachineObjectOU></MachineObjectOU>
          </DomainJoin>
          <StoredCertificateSettings>
            <CertificateSetting>
              <StoreLocation>LocalMachine</StoreLocation>
              <StoreName>teststorageaccounts</StoreName>
              <Thumbprint>DD3914C952CAC255C1CB15D5A0A35C3C3D008FCC</Thumbprint>
            </CertificateSetting>
          </StoredCertificateSettings>
          <WinRm>
            <Listeners>
              <Listener>
                <Type>Http</Type>
              </Listener>
              <Listener>
                <Type>Https</Type>
              </Listener>
            </Listeners>
          </WinRm>
          <AdminUsername>Cedvill00112233!</AdminUsername>
        </ConfigurationSet>
        <!--<ConfigurationSet>
          <ConfigurationType>LinuxProvisioningConfiguration</ConfigurationType>
          <HostName>host-name-for-the-vm</HostName>
          <UserName>new-user-name</UserName> 
          <UserPassword>password-for-the-new-user</UserPassword> 
          <DisableSshPasswordAuthentication>true|false</DisableSshPasswordAuthentication>           
          <SSH>
            <PublicKeys>
              <PublicKey>
                <FingerPrint>certificate-fingerprint</FingerPrint>
                <Path>SSH-public-key-storage-location</Path>     
              </PublicKey>
            </PublicKeys>
            <KeyPairs>
              <KeyPair>
                <FingerPrint>certificate-fingerprint</FingerPrint>
                <Path>SSH-public-key-storage-location</Path>
              </KeyPair>
            </KeyPairs>
          </SSH>
        </ConfigurationSet>-->
        <ConfigurationSet>
          <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>          
          <InputEndpoints>
            <InputEndpoint>
              <LoadBalancedEndpointSetName>Remote Desktop</LoadBalancedEndpointSetName>
              <LocalPort>3389</LocalPort>
              <Name>RemoteDesktop</Name>
              <Port>80</Port>
              <LoadBalancerProbe>
                <Path></Path>
                <Port></Port>
                <Protocol></Protocol>
                <IntervalInSeconds></IntervalInSeconds>
                <TimeoutInSeconds></TimeoutInSeconds>
              </LoadBalancerProbe>
              <Protocol>TCP</Protocol>                    
            </InputEndpoint>
          </InputEndpoints>
          <SubnetNames>
            <SubnetName>FrontEndSubnet1</SubnetName>
            <SubnetName>BackEndSubnet1</SubnetName>
          </SubnetNames>
        </ConfigurationSet>
      </ConfigurationSets>
      <AvailabilitySetName></AvailabilitySetName>
      <DataVirtualHardDisks>
        <DataVirtualHardDisk>
          <HostCaching>ReadWrite</HostCaching>
          <DiskLabel>myDiskLabel</DiskLabel>
          <DiskName>newname</DiskName>
          <Lun>3</Lun>
          <LogicalDiskSizeInGB>16gb</LogicalDiskSizeInGB>
          <MediaLink>http://teststorageaccounts.blob.core.windows.net/vhds/TestsRock.vhd</MediaLink>
        </DataVirtualHardDisk>
      </DataVirtualHardDisks>
      <OSVirtualHardDisk>
        <HostCaching>ReadWrite</HostCaching>
        <DiskLabel>myosdisklabel</DiskLabel>
        <DiskName>newname</DiskName>
        <MediaLink>http://teststorageaccounts.blob.core.windows.net/vhds/TestsRockets.vhd</MediaLink>
        <SourceImageName>03f55de797f546a1b29d1b8d66be687a__Visual-Studio-2013-Preview-Ultimate-12.0.20617.1</SourceImageName>
      </OSVirtualHardDisk>
      <RoleSize>Small</RoleSize>
    </PersistentVMRole>

我有这个请求正文来创建 VM。我想要完成的是在一个云服务上创建多个虚拟机,但不幸的是我的请求正文无效,我找不到什么问题。任何人都可以在这里帮助我或提供一些工作样本。我遵循了这个文档。谢谢

4

2 回答 2

1

我只是想向您保证,Windows Azure VMRole 已经退役,现在您可以使用更多的 Windows Azure IaaS 虚拟机,以下链接可以为您提供更多帮助:

什么是 Windows Azure 虚拟机: http: //www.windowsazure.com/en-us/services/virtual-machines/

将 Windows Azure VMRole 迁移到 Windows Azure 虚拟机:http: //msdn.microsoft.com/en-us/library/windowsazure/dn133483.aspx

于 2013-07-31T02:57:28.997 回答
0

我相信文档不是最新的。请尝试添加以下节点

<AdminUsername>adminusername</AdminUsername>

<AdminPassword>MyPassword!</AdminPassword>

节点。

此外,如果您收到 WebException,您可以尝试读取该 WebException 的响应,这应该会为您提供有关错误的更多详细信息。例如:

    catch (WebException webEx)
    {
        using (var respStream = new System.IO.StreamReader(webEx.Response.GetResponseStream()))
        {
            var detailedErrorMessage = respStream.ReadToEnd();
        }
    }

在这里,detailedErrorMessage应该为您提供一个包含有关错误的更多详细信息的 XML。

于 2013-07-28T07:38:40.333 回答