I see that I can "connect to an existing virtual machine" in the portal, as opposed to creating a standalone virtual machine. How can I do that via powershell? I only see that the New-AzureVM command allows you to create a VM in a new cloud service, or in
an existing cloud service. But I if I try to use that and point it to an existing cloud service that has a copy of my VM running already, it gives me an error, saying "The specified deployment slot Production is occupied".
No, as I said I see that I can create a VM in an existing cloud service, but that creates a Standalone VM. I want to create many VM instances in the same existing cloud service. But after the first instance, this command fails saying that there is already
something in that Production slot.
The Virtual Machines service is our IaaS offering (AKA Persistent VMs. Using IaaS they VMs will always be single instance. To create multiple instance of a virtual machine you need to use Cloud Services to deploy VM Worker Roles and VM Web Roles
Unless I'm confused, I can do what I want from the portal, just not from Powershell. I can create a new VM in the portal, select my image, set the configuration values, then the next page asks if I want to create a standalone or connected VM. If I select
connected, then I choose the cloud service that has my first instance, and if I continue it will create a new instance of my VM in that cloud service that already had an instance. In this way I can get multiple VM instances, and that's what I want to do via
GRRRRRRRRRR, no I am not. Are you reading the post?
I create a virtual machine in Azure, based on the Windows 2012 OS. I installed and configured some software. I captured and persisted that image. Now if I create a virtual machine in the portal from my captured image, I have the option to create a standalone
virtual machine, or a connected virtual machine. I can create a connected virtual machine which uses the same cloud service as my original virtual machine is running in. I just did it. All I want to know is if/how it can be done from Powershell.
I apologize if I did not understood your question correctly. The command to deploy a new Azure VM on an existing cloud service is below. You can specify your custom image on the -ImageName paramenter. On the example we are using a standard image from
The command below creates a VM on an existing cloud service.
Let's try it this way. I can run your first command to get my VM started in an existing cloud service. Now once that is going, if you go to the portal, start a new VM, and go through the steps, you come to the step shown below. In this step, I can choose
to Connect to an existing VM. If I select this, I can then select the cloud service that has the VM running (that your command created). When I finish this in the portal, I get a new VM started from the same VM image. So now I have 2 VMs running in that cloud
The problem is that if instead of using the portal, I use your command to try to create this second VM, the script gives an error saying that there is already something in the cloud service's Production slot. So I'm guessing the command is trying to use
the Standalone option instead of the Connect option. So I want to know if I can run a PS command to create a VM that is connected to the first/existing VM in the cloud service.
Edited byRock2000Tuesday, November 13, 2012 8:01 PM
I think now I understand. The command I posted should create the VM on an existing Cloud Service, I have used it myself for that purpose a number of times. Since you are getting an error when running that command we need to investigate further.
Can you post the exact command line you are using here on the forum? You can change the cloud service name, etc,, to keep privacy.
Flavio Muratore Sr. Support Escalation Engineer Windows Azure Technical Support
If I run this when I have no VMs yet, it works and creates the first VM in the cloud service. Now I want to basically run this again, just changing the $vmName to a new computer name. But since there is already a VM running in the cloud service, the PS commands
give me an error telling me that there is something running in Production. So the commands are just trying to deploy a Standalone VM, but I need a command that will deploy a Connected VM now.
I believe the problem is that you cannot specify the -VNetMame when adding a new VM to an existing cloud service. All VMs in the cloud service share the same -VNetName.
If you could test running the command I posted "as is" only modifying the purple parts and not adding or removing anything else it should work.
You can then delete the test VM and on your script you most likely have to remove the -VNetName parameter when running it on a cloud service that already have a VM. Please note that if there is not VMs in the cloud service then -VNetName will be required.
I get the same error with your script. If I run the script with no VMs in my cloud service, then the script works and I get the first VM. If I run your script again, with a different VMNAME, I get the same error that says "the specified deployment slot
Production is occupied."
I recreated the service and got the same error. It doesn't seem like a bug. The error message is correct, in the sense that I have a VM already occupying that slot. So I think this command is just written to create a Standalone VM, and not handle the Connected
case. Or at least with these parameters that's all it seems to do.