2013-07-28 2 views
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을 만들 수 있습니다. 하나의 클라우드 서비스에서 많은 VM을 생성하고 싶지만 불행히도 내 요청 본문이 유효하지 않으며 무엇이 잘못 되었습니까? 아무도 나를 도와 줄 수 없거나 작동 샘플을 제공 할 수 있습니다. 나는 이것을 documentation에 따라 갔다. 감사합니다XML 요청 본문 : Windows Azure에서 유효하지 않습니다.

답변

0

나는 문서가 최신이 아닌 것 같아.

<AdminPassword>MyPassword!</AdminPassword> 

노드 다음에 다음 노드

<AdminUsername>adminusername</AdminUsername> 

를 추가하는 시도하십시오.

또한 WebException이 발생하면 해당 WebException의 응답을 읽으려고 시도 할 수 있으며 오류에 대한 자세한 정보를 제공해야합니다. 예를 들어 :

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

, detailedErrorMessage 당신에게 오류에 대한 자세한 내용과 XML을 제공해야합니다.

+0

여전히 같은 오류가 발생했습니다. detailedErrorMessage는 나에게 빈 공간 (공백)을 반환합니다. 요청 : https://management.core.windows.net/subscriptionID/services/hostedservices/CloudService/deployments/Production/roles 이게 맞습니까? –

+0

정확한 오류는 무엇입니까? 당신은'Add Role' 연산을 수행하고 있습니다. http://msdn.microsoft.com/en-us/library/windowsazure/jj157186.aspx 문서를 기반으로, 요청 URL에는'deploymentname'이 포함되어야합니다. 그러나'deployment slot'을 거기에 전달할 것입니다. 유효한 배포 이름을 제공하여 시도해 주시겠습니까? 현재 귀하의 요청에 많은 것을 시도하고 있습니다. 먼저 VM을 만들고 나머지는 모두 그대로 두는 것이 좋습니다. 오류를 더 빨리 찾아내는 데 도움이 될 수 있습니다. –

1

난 그냥 당신이 윈도우 Azure VMRole 은퇴 것을 알고 보장 할 지금 당신이 더 많은 윈도우 Azure IaaS를 가상 머신을 사용할 수 있습니다, 여기에 더 당신을 도울 수있는 다음과 같은 링크입니다 :

윈도우 무엇입니까는 푸른 가상 머신 : 윈도우 Azure 가상 머신에 http://www.windowsazure.com/en-us/services/virtual-machines/

마이그레이션 윈도우 Azure VMRole : http://msdn.microsoft.com/en-us/library/windowsazure/dn133483.aspx