Unable to allocate the required address spaces - azure

While deploying a new Web Role on Windows Azure i am getting this error:
Unable to allocate the required address spaces for the deployment in a new or predefined subnet that is contained within the specified virtual network.
I have searched for a solution, but didn't find one. Does any one have an idea?
My cscfg file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="Application.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-03.2.0">
<Role name="WebApplication" vmName="vm001">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<Role name="Application.ServiceOpdrachten" vmName="vm002">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint=".." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="VirtualNetwork" />
<!-- The virtual network name must match the name of the vvirtual network configured in your subscription. -->
<AddressAssignments>
<!-- You must map each role in your cloud service to a subnet or a collection of subnets which were defined in your network.-->
<InstanceAddress roleName="WebApplication">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>
In the same cloudproject i have another instance that deploys fine.
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="Ecare.Acasa.Cloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-03.2.0">
<Role name="WebApplication">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<Role name="Ecare.Acasa.ServiceOpdrachten">
<Instances count="1" />
<ConfigurationSettings>
...
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="..." thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="Ecare" />
<!-- The virtual network name must match the name of the vvirtual network configured in your subscription. -->
<AddressAssignments>
<!-- You must map each role in your cloud service to a subnet or a collection of subnets which were defined in your network.-->
<InstanceAddress roleName="WebApplication">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>

We had the same problem around three months ago. Back then may be after some update, the new IP Addresses were not being assigned, or when role or vm were deleted their IP address were not reusable.
We were not able to take help from Microsoft Support, as it was in Preview.
What worked for us was:
We deleted the whole virtual network, and created it again.
If it is possible for you, see if it works.

I was facing this issue and found the issue can be fixed. It has been documented here.

Related

Cloud Service ReservedIP mapping error when adding a load balancer

I have below enpoints defined
<Sites>
<Site name="Internal" physicalDirectory="location">
<Bindings>
<Binding name="HttpIn100" endpointName="HttpInLB" />
<Binding name="HttpIn101" endpointName="HttpInLB" hostHeader="someheader" />
<Binding name="HttpIn102" endpointName="HttpInLB" hostHeader="someheader" />
<Binding name="HttpIn103" endpointName="HttpInLB" hostHeader="someheader" />
</Bindings>
</Site>
</Sites>
And this is the endpoint
<Endpoints>
<InputEndpoint name="HttpInLB" protocol="http" port="80" loadBalancer="LB" />
</Endpoints>
Then in my cscfg file I have
<NetworkConfiguration>
<VirtualNetworkSite name="Development" />
<AddressAssignments>
<InstanceAddress roleName="SiteName">
<Subnets>
<Subnet name="DMZ-subnet" />
</Subnets>
</InstanceAddress>
<ReservedIPs>
<ReservedIP name="ipname"/>
</ReservedIPs>
</AddressAssignments>
<LoadBalancers>
<LoadBalancer name="LB">
<FrontendIPConfiguration type="private" subnet="DMZ-subnet" staticVirtualNetworkIPAddress="00.0.00.001" />
</LoadBalancer>
</LoadBalancers>
When I publish, I get below error
ReservedIP 'ipname' was not mapped to an endpoint. The service definition must contain atleast one endpoint that maps to the ReservedIP.
Appreciate if someone could help me with this.
Many Thanks
ReservedIP is only supported with services containing an external endpoint. What you can do is add an external endpoint and block it with Network Security Groups.
For example, add following endpoint to your Endpoints tag. Then you could block the port using NSG.
<InputEndpoint name="Endpoint1" protocol="http" port="8078" />

Azure Cloud Service - no environment variables being set

The roles in my Cloud Service aren't getting any custom environment variables set. --Meaning if I enumerate the results of a call to Environment.GetEnvironmentVariables(), only the standard environment variables are set (things like PATH or the user id).
When I debug the Cloud Service locally using the emulator, the envvars are there, so I'm kind of at a loss here.
The relevant .csdef:
<WebRole name="..." vmsize="Small">
<ConfigurationSettings>
<Setting name="FirstSetting" />
<Setting name="AnotherSetting" />
</ConfigurationSettings>
<Runtime>
<Environment>
<Variable name="FirstSettingEnvVar">
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting[#name='FirstSetting']/#value" />
</Variable>
<Variable name="SecondSettingEnvVar">
<RoleInstanceValue xpath="/RoleEnvironment/CurrentInstance/ConfigurationSettings/ConfigurationSetting[#name='SecondSetting']/#value" />
</Variable>
</Environment>
</Runtime>
and the relevant .cscfg:
<Role name="...">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="FirstSetting" value="ABCD" />
<Setting name="SecondSetting" value="WXYZ" />
</ConfigurationSettings>
</Role>

Remove CloudService VIP address in Azure

We have a use case where we don't want to expose our cloud service to public and accessible only through our internal network. Is there a way to de associate the Public IP and access the cloud service through Internal IP. I already added CloudService to our VN but still i can access the CloudService through Public IP.
<NetworkConfiguration>
<VirtualNetworkSite name="xxxxVN" />
<AddressAssignments>
<InstanceAddress roleName="WorkerRole7">
<Subnets>
<Subnet name="default" />
</Subnets>
</InstanceAddress>
<InstanceAddress roleName="WebRole7">
<Subnets>
<Subnet name="default" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
CSDEF:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="AzureCloudService7" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
<WebRole name="WebRole7" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
</ConfigurationSettings>
<Endpoints>
<InternalEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="RemoteAccess" />
</Imports>
</WebRole>
<WorkerRole name="WorkerRole7" vmsize="Small">
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
</ConfigurationSettings>
<Imports>
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WorkerRole>
</ServiceDefinition>>
when i removed Inputendpoint it is asking for binding, so i have given it as Internalendpoint and tried deploying it still am able to access the cloudservice with VIP.
The only ports available via the public load balancer (ie. the VIP) are the ones defined as InputEndpoints in your CSDEF file. So just remove those input endpoints and you will remove the ability to communicate to that VM from the public IP.

Add a new role to existing azure cloud service using management portal

I am trying to add a new worker role to an existing azure cloud service. The existing cloud service already have a web role deployed which runs in 2 instances.
The new worker role need to run on single (1) instance.
The old ServiceConfiguration file looked like this >>
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure3" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-01.2.3">
<Role name="WebMVCApplication1">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
the new ServiceConfiguration file looks like this >>
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure3" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-01.2.3">
<Role name="WebMVCApplication1">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
<Role name="NewWorkerRole">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
However when I upload the new ServiceConfiguration file along with the new worker role package. I get this error >> Role "WebMVCApplication1" was not found in the currently deployed service. The long running operation tracking ID was: 21xxxxxxxc42xxxxxxxxxxbda5e.
I am following this guide http://azure.microsoft.com/en-us/documentation/articles/cloud-services-how-to-manage/#updaterole .
I have checked both text boxes as per the document.
What I am missing here ?
Any advice will greatly help.
Many Thanks

Azure Worker will not connect to Virtual Network

So I have two separate projects for a cloud project I am deploying to Azure, I used to use the old grouping to ensure my roles had access to local services.. now that the old portal has been retired that grouping style is gone... which is fine - except, I cannot for the life of me get my worker role to connect to the new virtual network.
I have deployed a web-role, and it connects just fine to the virtual network (which utilizes the same set of services), and I have configured the web and worker-role the same in the service configuration file. The only thing I can think is there is a different way I need to configure the worker, vs, the web role?
The config I have in my serviceconfiguration file:
<NetworkConfiguration>
<Dns>
<DnsServers>
<DnsServer name="MyDNSServer" IPAddress="11.11.11.11" />
</DnsServers>
</Dns>
<VirtualNetworkSite name="West-US" />
<AddressAssignments>
<InstanceAddress roleName="CPTWorkerRole">
<Subnets>
<Subnet name="MySubnet" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
Please let me know any ideas on the worker role... please do not suggest based upon web-role experience, as I am not having issues connecting the web role...
Thanks!
I don't believe that there is any difference and so, just to make sure, I made a quick attempt just now - I've create a cloud project with 2 instances of a web role and an instance of a worker role and successfully deployed both roles onto an existing VNET I had using the same configuration -
<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="WindowsAzure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2013-10.2.2">
<Role name="WebApplication9">
<Instances count="2" />
</Role>
<Role name="WorkerRole1">
<Instances count="1" />
</Role>
<NetworkConfiguration>
<VirtualNetworkSite name="yossinet" />
<AddressAssignments>
<InstanceAddress roleName="WebApplication9">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
<InstanceAddress roleName="WorkerRole1">
<Subnets>
<Subnet name="Subnet-1" />
</Subnets>
</InstanceAddress>
</AddressAssignments>
</NetworkConfiguration>
</ServiceConfiguration>

Resources