locked
Test each instance of Web Role. RRS feed

  • Question

  • We have application which is on WebRole project. We have modified the instance count to 4.
    Is there any way to test application for each instance count in compute emulator.

    Monday, September 17, 2012 7:07 AM

Answers

  • Hi,

    You could use the Windows Azure Service Management API and use the Get Deployment operation:

    The Get Deployment operation returns configuration information, status, and system properties for a deployment.

    <?xml version="1.0" encoding="utf-8"?>
       <Deployment xmlns="http://schemas.microsoft.com/windowsazure">
          <Name>deployment-name</Name>
          <DeploymentSlot>current-deployment-environment</DeploymentSlot>
          <PrivateID>deployment-id<PrivateID>
          <Status>deployment-status</Status>
          <Label>base64-encoded-deployment-label</Label>
          <Url>deployment-url</Url>
          <Configuration>base-64-encoded-configuration-file</Configuration>
          <RoleInstanceList>
             <RoleInstance>
                <RoleName>role-name</RoleName>
                <InstanceName>role-instance-name</InstanceName>
                <InstanceStatus>instance-status</InstanceStatus>
                <InstanceUpgradeDomain>integer-identifying-the-upgrade-domain</InstanceUpgradeDomain>
                <InstanceFaultDomain>integer-identifying-the-fault-domain</InstanceFaultDomain>
                <InstanceSize>size-of-the-instance</InstanceSize>
                <InstanceStateDetails>snapshot-of-the-state-of-the-vm</InstanceStateDetails>
                <InstanceErrorCode>error-code</InstanceErrorCode>
                <IpAddress></IpAddress>
                <FQDN></FQDN>
             </RoleInstance>
          </RoleInstanceList>
          <UpgradeStatus>
             <UpgradeType>Auto|Manual</UpgradeType>
             <CurrentUpgradeDomainState>Before|During</CurrentUpgradeDomainState>
             <CurrentUpgradeDomain>n</CurrentUpgradeDomain>
          </UpgradeStatus>
          <UpgradeDomainCount>number-of-upgrade-domains-in-deployment</UpgradeDomainCount>
          <RoleList>
             <Role>
                <RoleName>role-name</RoleName>
                <OsVersion>OsVersion </OsVersion>
                <ConfigurationSets>
                   <NetworkConfigurationSet>
                      <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>
                      <InputEndpoints>
                         <InputEndpoint>
                            <Port>Port number</Port>
                            <Protocol>Protocol</Protocol>
                            <Vip>Virtual IP address</Vip>
                         </InputEndpoint>
                      </InputEndpoints>
                     </NetworkConfigurationSet>
                </ConfigurationSets>
                </Role>
                   <PersistentVMRole>
                      <RoleName>MyDurableRole</RoleName>
                      <RoleType>PersistentVMRole</RoleType>
                      <ConfigurationSets>
                         <WindowsProvisioningConfigurationSet>
                            <ComputerName>Machine1</ComputerName>
                            <AdminPassword>Machine1</AdminPassword>      
                         </WindowsProvisioningConfigurationSet>
                         <NetworkConfigurationSet>
                            <InputEndpoints>
                               <InputEndpoint>
                                  <EnableDirectServerReturn>false</EnableDirectServerReturn>
                                  <LoadBalancedEndpointSetName>WebServer</LoadBalancedEndpointSetName>
                                  <LocalPort>80</LocalPort>
                                  <Name>WebServerEndpoint</Name>
                                  <Port>80</Port>
                                  <LoadBalancerProbe>
                                     <Path>/Status</Path>
                                     <Port>81</Port>
                                     <Protocol>http</Protocol>
                                  </LoadBalancerProbe>
                                  <Protocol>tcp</Protocol>
                                  <Vip>virtual-ip</Vip>
                         </InputEndpoint>
                       <InputEndpoints>
                       <SubnetNames>
                            <string>FrontEndSubnet1</string>
                            <string>BackEndSubnet1</string>
                       </SubnetNames>
                     </NetworkConfigurationSet>
                   </ConfigurationSets>
                   <AvailabilitySetName> availabilitySetName</AvailabilitySetName>
                   <DataVirtualHardDisks>
                     <DataVirtualHardDisk>
                       <HostCaching>ReadOnly</HostCaching>
                       <DiskLabel>newDiskLabel</DiskLabel>
                       <DiskName>newOrExistingDiskName</DiskName>
                       <Lun>1</Lun>
                       <LogicalDiskSizeInGB>10</LogicalDiskSizeInGB>
                       <MediaLink>http://contoso.blob.core.windows.net/disks/mydatadisk.vhd</MediaLink>
                     </DataVirtualHardDisk>
                   </DataVirtualHardDisks>
                   <OSVirtualHardDisk>
                     <HostCaching>ReadWrite</HostCaching>
                     <DiskLabel>newDiskLabel</DiskLabel>
                     <DiskName>newOrExistingDiskName</DiskName>
                     <MediaLink>http://contoso.blob.core.windows.net/disks/mydisk.vhd</MediaLink>
                     <SourceImageName>sourceImageForNewDiskName</SourceImageName>
                   </OSVirtualHardDisk>
                   <RoleSize>ExtraSmall</RoleSize>
                 </PersistentVMRole>
    
    </RoleList>
    <SdkVersion>Version of SDK used to create the deployment</SdkVersion>
    <Locked>false</Locked>
    <RollbackAllowed>false</RollbackAllowed>
          <VirtualNetworkName>MyProductionNetwork</VirtualNetworkName>
      </Deployment>
    

    Hope this helps!


    Best Regards,
    Carlos Sardo

    Monday, September 17, 2012 7:35 AM