CentOS 7 template for Azure Pack

In this post I'll provide a manual how to create CentOS 7 virtual machine template for Windows Azure Pack. This is an often requested functionality by service providers, and I don't know why it is not documented on TechNet. I'll try to fix it :)

I'll provide a way to create a clean Standalone VM image for Azure Pack, but you'll be able to use the same image for VM Role creation. Big thx to Premier Support engineers who helped me with this guide. Sorry, limited in time, so no screenshots this time. I hope everything will be clear even without them.

1) Go to CentOS download page and download DVD ISO. At the time of writing this post, the latest version is 1511.

2) Go to VMM console and create new VM with the following parameters:

  • Generation 1
  • 4 vCPUs
  • 4096Mb Static RAM
  • 40Gb VHDX (Static or Dynamic - as you like)
  • Legacy NIC

3) Connect the downloaded ISO and boot the VM.

4) Start CentOS installation as usual. No special requirements, just install it next next next.

5) Download Linux Intergration Services (LIS) 4.0.11 ISO here and connect it to the VM.

6) Logon as root and Install LIS:

mkdir /opt/linuxic
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom
cp * -R /opt/linuxic/
cd /opt/linuxic/RHEL71
./install.sh

7) Shutdown the VM.

8) Go to VM settings, remove Legacy NIC and add Synthetic NIC. Boot the VM and logon as root.

9) Install Net Tools

yum install net-tools

10) Install Hyper-V daemons

yum install hyperv-daemons

11) Install some prerequisites

yum install python-pyasn1
yum install wget

12) Edit SSH Server config to allow root to connect over it

vi /etc/ssh/sshd_config Under Authentication uncomment PermitRootLogin and save the file.

13) Install Microsoft Azure Linux Agent

wget https://olcentgbl.trafficmanager.net/openlogic/7/openlogic/x86_64/RPMS/WALinuxAgent-2.0.14-1.noarch.rpm /tmp
rpm -i WALinuxAgent-2.0.14-1.noarch.rpm

14) Install VMM Agent for Linux. For that, copy all the files from the folder "C:Program FilesMicrosoft System Center 2012Virtual Machine ManageragentsLinux" into the VM. You can use ISO or FTP - any method to copy these files into the VM. After that, run 2 commands:

chmod +x install
./install scvmmguestagent.1.0.2.1075.x64.tar

15) Deprovision and shut down the VM

waagent -deprovision
init 0

16) Copy the VHDX file of this VM into the VMM library and create a Generation 1 VM Template using this VHDX file. Publish this VM Template to Azure Pack as usual.

That’s all! If you've made everything as described, you should see this picture after the VM creation from this template: