Yesterday I had the opportunity to do a live meeting on how to migrate workloads to the cloud. You can find the video here (http://aka.ms/azure4of4) . In the meeting I spent some time on discussing enterprise scenarios and how you use windows azure vnet to connect services and your on premise infrastructure. This reminded me of a question one of my clients had a few months back which I would have liked to address in the meeting but didn’t have time, so I’ve decided to blog about it instead.
How to connect a Linux VM with a Windows VM on Windows Azure
To connect a linux and a windows vm and use static (permanent lease) IP addresses on those machines we need to create a virtual network. So from http://manage.windowsazure.net by clicking the new button we can start the new vnet wizard.
After specifying a name for the vnet, the region (datacenter) where the vnet will be created and the subscription we need to define the address range available for the vm instances as well as any subnets.
In this case we don’t need any subnets and we’re specifying an address range from 192.168.1.1 to 192.168.1.255 by using the Classless Inter-Domain Routing (CIDR) format.
Next we need to provision our virtual machines.
Provisioning a windows image to join the created virtual network is quite easy and can be performed through the wizard. The only thing that we need to take care of is select the vnet from the combo “Region/Affinity Group/Virtual Network”.
Unfortunately provisioning the Linux images is not as straight forward as in Windows Images, since the portal wizard does not allow us to select the virtual network.
In order to provision the Linux Images we have to use Windows Azure PowerShell cmdlets the code looks like this:
First add the necessary credentials by importing you publish settings file. If you don’t have a publish settings file you can download one from https://windows.azure.com/download/publishprofile.aspx
Next we’ll have to set some variables in order to set the subscription in which we want to deploy the linux vm
After setting the subscription we can see by performing a get-azurevm the windows virtual machine that is already deployed.
Finally we can add the new Linux VM to our service with the following commands
That’s it. The two newly created machines will be able to communicate by IP or name.
Hope this guide will prove helpful for those thinking of moving their workloads to the cloud.