Ubuntu 14.04 Azure Tips

It turns out that Ubuntu 14.04 is pretty easy to prepare for an Azure migration because it already has the drivers in the RAM filesystem image. So all we need to do is add some stuff to get the NIC configured, and turn on the serial console too.

Let’s start with the serial console

Ubuntu has a great article on their help site on how to enable a serial console, I recommend following their guide here: https://help.ubuntu.com/community/SerialConsoleHowto

For Ubuntu 14.04 you will want to follow the “Karmic or newer” sections of the guide.

Network Configuration

Even though Ubuntu has the HyperV (Azure) nic driver built in, that doesn’t mean that Linux will use it (Linux isn’t Windows). So we have to configure the nic to receive its information via DHCP.

But ideally, we would leave the existing configuration in place so that if you are doing DR to cloud you don’t need to do anything for failback.

Enter udev rules.

We can use a udev rule to look for a NIC with the HyperV driver and rename it to something other than eth0. In this example, I will rename it az0 but you could call it whatever you want.

First edit the networking interfaces file:

sudo nano /etc/network/interfaces

Now add the following to the bottom of the file:

auto az0
iface az0 inet dhcp

Next, we will configure the udev rule.

sudo nano /etc/udev/rules.d/76-zerto-net.rules

Add the following line to the file (make sure it’s all on one line too!):

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="hv_netvsc", ATTR{type}=="1", KERNEL=="eth*", NAME="az0"

Lastly we will edit rc-sysinit.conf so that the boot process doesn’t hang when it doesn’t find the Azure nic (while the machine is on VMware).

sudo nano /etc/init/rc-sysinit.conf

Then find the line that says: “start on (filesystem and network) or failsafe-boot”

Remove the “and network” stuff from the first area so that it looks like:

start on (filesystem) or failsafe-boot

Test locally if possible

I like to do a quick reboot of the machine at this point to make sure everything still comes up ok after the changes.

Once you do that, if possible, you can give a failover test or a move a try and then check for connectivity in Azure.