Untill recently IP-addresses of Azure virtual machines were not static/fixed. A VM which had been shutdown (for example to reduce costs, think test/dev scenario’s) could receive a different IP-address at boot than orginally assigned at creation. This leads to all kinds of issues. A new Powershell for Azure version solves this issue.
Windows Azure once started as a Platform as a Service (Paas) offer. It is also a best effort cloud, which means the availability should be provided by the application, not by the platform. This is proven for example by the lack of a Service Level Agreement for single instance virtual machines. Customers are required to have at least two virtual machines serving the same application to get a SLA.
Since April 2013 Azure offers Virtual Machines which provides the ability for customers to have full control over the guest operating system. One of the tricky things in Azure VM’s is networking. When using traditional enterprise applications administrators want to have control over the IP-configuration of the virtual machines. However VM’s should be set to DHCP at all times. The reason for this is the Software Defined Networking architecture used in Azure.
When using Azure Virtual Networks administrators can define IP-subnets and DNS servers for their virtual machines. The first virtual machine which boots in an empty subnet will receive x.x.x.4 as IP-address, the second x.x.x.5 etc. This allows for some prediction of which IP-address a VM will receive. However, when a virtual machine is switched off, it might loose it’s IP-address when another VM in that subnet boots.
Set fixed IP
Microsoft offers a solution for this issue. Since the release of PowerShell cmdlets for Windows Azure version 0.7.3 released at February 12, 2014 it is possible to glue a IP-address to a particular virtual machine. So even if a VM is not running for a while, it will receive it’s originally assigned IP-address at boot.
More information on PowerShell for Azure here.
Four news cmdlets were added in PowerShell for Azure 0.7.3 :
The guest operating system still have to be set to using DHCP. However there is some sort of permanent reservation made in the Azure fabric.
Some things to consider are:
- setting a fixed IP-address to a VM can only be done using PowerShell. It is not possible using the Azure Management Portal
- setting a fixed IP-address can only be done at creation of the VM. When the VM has already been created the PowerShell command will not work
- it is required that the VM is part of a Azure Virtual Network
More information including some sample PowerShell scripts in the blogs below.
This information will also be described in my to be released book on Microsoft hybrid cloud. The book will provide an indepth look in Windows Azure IaaS. Also I will cover management, connecting System Center to Azure and lots more.
More info on my book will be published on this website.
MSDN blog: Allocating Static IP Addresses to your VMs
Stufox. Static IPs in Windows Azure
WindowsITPro Set Azure VM static IP address