Freigeben über


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:

Comments

  • Anonymous
    February 01, 2016
    The comment has been removed
  • Anonymous
    February 17, 2016
    Hi, great article... I followed the instructions and everything is great up until I try to login as root and I get "Login Incorrect" when I try to use the password that I set for root initially. Does this need to be configured somewhere else?
    Thanks :-)
  • Anonymous
    February 17, 2016
    If you use this golden image as VMM VM template or as Azure Pack VM Role, then you need to specify root password during the VM creation. No additional configuration is needed here.
  • Anonymous
    February 17, 2016
    Thanks for your quick reply... I am trying this solution now :-)
  • Anonymous
    February 17, 2016
    Thankyou, I can confirm your solution works!
    I still have one issue... I installed CentOS with a Gui but the mouse is not working either from the Azure Pack console or from SCVMM/Hyper-V consoles.
    I didn't receive any errors when I installed the tools above, everything was successful.
    Do you know what might be missing? Again many thanks :-)
  • Anonymous
    February 17, 2016
    Just a quick update, mouse works fine with CentOS 71. (1503). Apparently this issue will hopefully be fixed for 7.2 (1511) when the new LIS 4.1 are released (hopefully soon :-)
    Once again, great article... many thanks!
  • Anonymous
    June 29, 2016
    Thanks for great article!
  • Anonymous
    November 22, 2016
    4096MB RAM will suffice i think? 4096GB looks a little overkill to me ;-)
    • Anonymous
      November 22, 2016
      Thx, fixed :)