Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

Dynamic scaling of virtual machines using Powershell

$
0
0
We are trying to use PowerShell to automatically scale up and down the number of virtual machines in Windows Azure. We used to use VM Roles, but since these are shutting down in 10 days, we are now trying to use virtual machines instead.

We use the following Powershell command to add new VM roles to an existing service. We use the same service name for the different virtual machines, but of course the virtual machine name is unique for every machine.

New-AzureVMConfig -Name $vmName -InstanceSize ExtraSmall -ImageName $image | Add-AzureProvisioningConfig -Windows -AdminUsername $adminUsername -Password $adminPassword | New-AzureVM –ServiceName $serviceName -WaitForBoot;

When adding new virtual machines one at a time, our implementation works fine. But when running the above command in parallel (using PowerShell background tasks), we get different errors:
  • An exception occurred when calling the ServiceManagement API. HTTP Status Code: 409. Service Management Error Code: ConflictError. Message: Windows Azure is currently performing an operation on this hosted service that requires exclusive access. Operation Tracking ID: 89595c2c189c4795b0d02d6cfe8daae5.
  • An exception occurred when calling the ServiceManagement API. HTTP Status Code: 409. Service Management Error Code: ConflictError. Message: The specified deployment slot Production is occupied.. Operation Tracking ID: 9ed81e9f12874e5b80f5b1f40a3f1c86.

I get the impression that Windows Azure does not support adding multiple virtual machines to the same hosted service at the same time. If this is the case, how would one actually scale up / down virtual machines similar to how it's been possible for VM roles for years?

If we add them one at a time, it will take many hours to scale up / down and we lose the actual benefit of scaling up / down.

I've considered adding multiple hosted services, but since Azure limits the number of hosted services to well below the number of virtual machines we need, this is not an option.


Viewing all articles
Browse latest Browse all 12545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>