Daniel's Tech Blog

Cloud Computing, Cloud Native & Kubernetes

Linux Deployment – WAP VM Role Gallery Item

In the last month I have written two blog posts about the deployment of the WAP VM role gallery item. One about the regional settings of the OS and the other one about the deployment of a Windows client OS.

-> https://www.danielstechblog.io/windows-client-os-wap-vm-role-gallery-item/
-> https://www.danielstechblog.io/regional-settings-wap-vm-role-gallery-item/

Today I’m writing about the deployment of Linux OS via the WAP VM role gallery item. There some specifics you have to consider when deploying a Linux OS with the Windows Azure Pack.

First one is that you have the choice between the VMM Linux Agent and the Windows Azure Linux Agent. An installed agent in the Linux VM base image is a requirement which VMM uses for communication and customization during the deployment process. I will talk about the details and some issues later.

Second one is that you cannot provide a custom user name other than root for the deployment. If you provide a custom user name your deployment will fail and you get the following error message in the VMM jobs log.

Error (31304)
VM Role resource ‘CentOS’ was not successfully deployed in the Cloud Service.
Recommended Action
VM Role can be repaired if the entity was created.

Error (10619)
The user name provided is not a valid local administrator user name for this operating system.
Recommended Action
Provide a valid user name other than the built-in Administrator account name and then try the operation again.

Error (10619)
The user name provided is not a valid local administrator user name for this operating system.
Recommended Action
Provide a valid user name other than the built-in Administrator account name and then try the operation again.

Error (22042)
The service CentOS was not successfully deployed. Review the event log to determine the cause and corrective actions.
Recommended Action
The deployment can be restarted by retrying the job.

I have tested several different Linux distributions once with the VMM Linux Agent and once with the Windows Azure Linux Agent. Have a look at the table for the results. All Linux distributions were installed as minimal installations for the Linux VM base image except the Ubuntu installations.

WAPLinux

Linux Distribution Deployment with VMM Linux Agent Deployment with Windows Azure Linux Agent
CentOS 7.0 successful successful
Debian 7.7 successful successful
openSUSE 13.1 not successful not successful
Red Hat Enterprise Linux 7.0 successful successful
SUSE Linux Enterprise Server 11 SP3 successful successful
Ubuntu Desktop 14.04 successful successful
Ubuntu Server 14.04 successful successful

Every test deployment was successful except the openSUSE one. The openSUSE deployment was also successful at some points. The VM had the correct name after the deployment process, but the password for the root account was not set. I do not know why the password is not set correctly. Maybe I have to do some more investigations.

To be able to login into an Ubuntu Desktop installation with the root account, follow the instructions that are mentioned in the following link.

-> http://blogs.niteshapte.com/2014-04-18-how-to-enable-root-login-in-ubuntu-14-04.htm

Nevertheless let us go one step further and have a look on how to install the VMM Linux Agent and the Windows Azure Linux Agent into the Linux VM base image.

Using the VMM Linux Agent:

The VMM Linux Agent does not have any requirements to the Linux OS for its installation. You can find the VMM Linux Agent on the VMM management server in the folder “C:Program FilesMicrosoft System Center 2012 R2Virtual Machine ManageragentsLinux”. Copy the file “install” and “scvmmguestagent.1.0.2.1059.x64.tar” into another folder. Use a tool like ISO Recorder 3.1 to create an ISO image that you can attach to the Linux VM.

-> http://technet.microsoft.com/en-us/library/jj860429.aspx

To install the VMM Linux Agent attach the previously created ISO image and copy the files to a custom folder in your home folder. Open a terminal session and navigate to your folder. Type in “chmod +x install” and press enter. Next step run the install script with “./install scvmmguestagent.1.0.2.1059.x64.tar” and press enter. You will get an output if the VMM Linux Agent installation was successful. Now you can delete the installation files and shutdown the VM. The last step is to copy the Linux VM base image to the VMM library and tag the VHD file with the tags that has been defined in the VM role gallery item.

Using the Windows Azure Linux Agent:

The Windows Azure Linux Agent has several requirements regarding the Linux OS. First one the Windows Azure Linux Agent is not compatible with the Network Manager. Second one the Windows Azure Linux Agent is only supported under the following Linux distributions.

  • CentOS 6.2+
  • Debian 7.0+
  • Ubuntu 12.04+
  • openSUSE 12.3+
  • SLES 11 SP2+
  • Oracle Linux 6.4+
  • FreeBSD 9+

The last requirement are the dependencies on several packages.

  • Python 2.5+
  • OpenSSL 1.0+
  • OpenSSH 5.3+
  • sfdisk, fdisk, mkfs
  • chpasswd, sudo
  • sed, grep
  • ip-route

-> http://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-agent-user-guide/

For the installation you need only the “waagent” file from the Github repository.

-> https://github.com/Azure/WALinuxAgent

As I earlier mentioned CentOS, Debian, openSUSE, RHEL, SLES and Ubuntu Server were installed with the minimum installation option and Ubuntu Desktop has the full Gnome GUI. Now the interesting part on how to install the Windows Azure Linux Agent onto the Linux OS. You can go the same way as with VMM Linux Agent to create an ISO image with the waagent file on it.

When you have attached the ISO image, copy the waagent file into the /usr/sbin folder. Open a terminal session and navigate to the /usr/sbin folder. Type in “chmod +x waagent” and press enter. Next step run the install script with “waagent –install” and press enter. Depending on the Linux distribution you will get different messages. The most common error message will be complaining about an installed Network Manager or “ERROR:Windows Azure Linux Agent requires python-pyasn1 for your Linux distribution.”. Have a look at the following tips for the different Linux distributions.

CentOS & RHEL

On both Linux distributions is the Network Manager installed and the packages python-pyasn1 & net-tools are missing. Prior to the Windows Azure Linux Agent installation execute the following steps.

  1. yum install python-pyasn1
  2. yum install net-tools
  3. yum remove NetworkManager
  4. waagent –install

If you do not get any messages on the terminal type in “vi /var/log/waagent.log”. In the waagent.log you will find more information about the installation process and if it was successful.

Debian:

Debian is not using the Network Manager, but is missing the packages sudo and ssh. Prior to the Windows Azure Linux Agent installation execute the following steps.

  1. apt-get install sudo
  2. apt-get install ssh
  3. waagent –install

If you do not get any messages on the terminal type in “vi /var/log/waagent.log”. In the waagent.log you will find more information about the installation process and if it was successful.

openSUSE:

openSUSE is not using the Network Manager, but is missing the packages python-pyasn1 and python-xml. Prior to the Windows Azure Linux Agent installation execute the following steps.

  1. Start yast2 and install the missing packages.
  2. waagent –install

If you do not get any messages on the terminal type in “vi /var/log/waagent.log”. In the waagent.log you will find more information about the installation process and if it was successful.

SLES:

SLES is not using the Network Manager, but is missing the package python-pyasn1. Prior to the Windows Azure Linux Agent installation execute the following steps.

  1. Start yast2 and install the missing package.
  2. waagent –install

If you do not get any messages on the terminal type in “vi /var/log/waagent.log”. In the waagent.log you will find more information about the installation process and if it was successful.

Ubuntu Server:

Ubuntu Server is not using the Network Manager, but is missing the package ssh. Prior to the Windows Azure Linux Agent installation execute the following steps.

  1. apt-get install ssh
  2. waagent –install

If you do not get any messages on the terminal type in “vi /var/log/waagent.log”. In the waagent.log you will find more information about the installation process and if it was successful.

Ubuntu Desktop:

Ubuntu Desktop is using the Network Manager and missing the package ssh. Prior to the Windows Azure Linux Agent installation execute the following steps.

  1. apt-get install ssh
  2. apt-get remove network-manager

After that open with vi or another text editor the file /etc/network/interfaces and add the following two lines.

auto eth0
iface eth0 inet dhcp

That is needed to get the interface eth0 up and running after a start or restart. Restart the system and execute “waagent –install”.

If you do not get any messages on the terminal type in “vi /var/log/waagent.log”. In the waagent.log you will find more information about the installation process and if it was successful.

After the successful installation of the Windows Azure Linux Agent shutdown the VM. The last step is to copy the Linux VM base image to the VMM library and tag the VHD file with the tags that has been defined in the VM role gallery item.

In the near future I will test some other Linux distributions and keep you up to date which one can be used for the deployment with Windows Azure Pack.

WordPress Cookie Notice by Real Cookie Banner