jcvandan
jcvandan

Reputation: 14314

Do Azure VM's have to use the same cloud service to be on the same virtual network?

I have created a virtual network, and created a VM woomph-live and added it to the virtual network. This went off without a hitch.

I now want to create a 2nd VM woomph-build and add it to my virtual network. If I do this and select a different cloud service to the one woomph-live is using, creating VM fails.

However, if I choose the same cloud service as woomph-live, it starts fine. Is this correct behaviour? And if so, how do I access the website each VM is serving on port 80 on each VM?

Upvotes: 1

Views: 1822

Answers (1)

David Makogon
David Makogon

Reputation: 71055

When you create a virtual machine, you have to place it within a given cloud service (mycloudservicename.cloudapp.net). And multiple VM's may be placed in that cloud service. When creating the cloud service, you'll need to add it to a pre-defined virtual network. Once you do that, all VMs in the cloud service are automatically included in the VNet space. All VMs inside the cloud service are also able to talk directly with each other.

According to your question, you're then trying to create a VM in another cloud service. That cloud service would also need to be added to the same VNet as the first cloud service. You can then add one or more VMs to that new cloud service. At this point, the VMs in both cloud services have access to each other.

As far as your question about port 80: If you have a collection of VMs in the same cloud service, serving the same web site, then you can create a load-balanced endpoint on port 80, mapping to port 80 on your web server VM collection. If, instead, you want to access individual web servers, then you have to either:

  • Place each web site on a different external port (assuming the web servers are in the same cloud service)
  • Place each web server in a separate cloud service (then you can map each to port 80 externally)

Upvotes: 7

Related Questions