Connect Linux virtual machines created with the classic deployment model with a virtual network or cloud service
Azure has two different deployment models for creating and working with resources: Resource Manager and Classic. This article covers using the Classic deployment model. Microsoft recommends that most new deployments use the Resource Manager model.
Linux virtual machines created with the classic deployment model are always placed in a cloud service. The cloud service acts as a container and provides a unique public DNS name, a public IP address, and a set of endpoints to access the virtual machine over the Internet. The cloud service can be in a virtual network, but that's not a requirement. You can also connect Windows virtual machines with a virtual network or cloud service.
If a cloud service isn't in a virtual network, it's called a standalone cloud service. The virtual machines in a standalone cloud service communicate with other virtual machines by using the other virtual machines’ public DNS names, and the traffic travels over the Internet. If a cloud service is in a virtual network, the virtual machines in that cloud service can communicate with all other virtual machines in the virtual network without sending any traffic over the Internet.
If you place your virtual machines in the same standalone cloud service, you can still use load balancing and availability sets. For details, see Load balancing virtual machines and Manage the availability of virtual machines. However, you can't organize the virtual machines on subnets or connect a standalone cloud service to your on-premises network. Here's an example:
If you place your virtual machines in a virtual network, you can decide how many cloud services you want to use for load balancing and availability sets. Additionally, you can organize the virtual machines on subnets in the same way as your on-premises network and connect the virtual network to your on-premises network. Here's an example:
Virtual networks are the recommended way to connect virtual machines in Azure. The best practice is to configure each tier of your application in a separate cloud service. However, you may need to combine some virtual machines from different application tiers into the same cloud service to remain within the maximum of 200 cloud services per subscription. To review this and other limits, see Azure Subscription and Service Limits, Quotas, and Constraints.
Connect VMs in a virtual network
To connect virtual machines in a virtual network:
- Create the virtual network in the Azure portal and specify 'classic deployment'.
Create the set of cloud services for your deployment to reflect your design for availability sets and load balancing. In the Azure portal, click New > Compute > Cloud service for each cloud service.
As you fill out the cloud service details, choose the same resource group used with the virtual network.
To create each new virtual machine, click New > Compute, then select the appropriate VM image from the Featured apps.
In the VM Basics blade, choose the same resource group used with the virtual network.
As you fill out the VM Settings, choose the correct Cloud service or virtual network for the VM.
Azure will select the other item based on your selection.
Connect VMs in a standalone cloud service
To connect virtual machines in a standalone cloud service:
- Create the cloud service in the Azure portal. Click New > Compute > Cloud service. Or, you can create the cloud service for your deployment when you create your first virtual machine.
When you create the virtual machines, choose the same resource group used with the cloud service.
As you fill out the VM details, choose the name of cloud service created in the first step.
After you create a virtual machine, it's a good idea to add a data disk so your services and workloads have a location to store data.