Getting Started With Azure Pack (Part 7)

by [Published on 20 Oct. 2015 / Last Updated on 20 Oct. 2015]

This article continues the discussion of Microsoft Azure Pack by examining VM template usage.

If you would like to read the other parts in this article series please go to:

In my previous article in this series, I explained that private clouds are subscription based (even if you aren’t requiring users to have a paid subscription) and that you will have to create one or more hosting plans that the users can subscribe to. The problem with the hosting plans that we have created is that they are basically just empty containers at this point. It would do a user little good to create a subscription because they can’t do anything after they subscribe. Needless to say, we need to change that by giving the users some resources that they can work with. This is where virtual machine templates come into play. We can associate virtual machine templates with a hosting plan so that the users who subscribe to the hosting plan will be able to create brand new virtual machines from the templates that are associated with the hosting plan.

To get started, go ahead and log into the Azure Pack administrative portal and click on the Plans container. When you do, you should see the hosting plan that you created in the previous article. Click on your hosting plan and you will be taken into the plan’s dashboard.

I talked briefly about the plan’s dashboard in the previous article in this series. As I mentioned, you can use the dashboard to view the number of plan subscribers and to configure various settings. For right now though, I want to focus on virtual machine templates. If you go to the Plan Services section and click on your virtual machine cloud, you will be taken to the configuration screen for the selected virtual machine cloud. This is the same place that you go to if you want to set usage limits for the virtual machine cloud.

If you scroll down toward the bottom of the screen, you will eventually come to a section called Templates. You should see a message telling you that there are no templates that are currently selected, as shown in Figure A.

Figure A: The list of templates is empty.

I will show you how to create and add a template in a moment, but before I do, I need to take just a second and talk about the Gallery. The Gallery is a collection of something called resource extensions. Resource extensions are an alternative to virtual machine templates. In other words, you have the option of making resource extensions available to your private cloud tenants through the gallery, which gives the tenants the ability to deploy virtual machines that are based on those resource extensions.

I strongly advise that you avoid using resource extensions (and the gallery) unless you have a compelling reason for doing so. Virtual machine templates are easier to work with and in my opinion are the preferred mechanism for allowing tenants to create virtual machines. So why is that? Well, Microsoft makes some resource extensions available for download. However, most of the available resource extensions are only useful for creating legacy virtual machines. If you want to create your own resource extensions you can certainly do so, but there is a pretty long list of tasks that you will have to complete and you will also need a degree of proficiency in Windows PowerShell.

Needless to say, resource extensions and the Azure Pack Gallery aren’t exactly my favorite thing to work with. That being the case, let’s create a VM template instead.

You can’t create a VM template directly through Azure Pack. VM Templates are created from within the Virtual Machine Manager console and are then exposed through Azure Pack. So with that said, go ahead and open up the Virtual Machine Manager console.

The process of creating a VM template is relatively straightforward. The whole process is wizard based and you can just click your way through the wizard. Having said that, there are three important things that you need to know about the template creation process before we jump right in.

First, the template must be created from either an existing virtual machine or from an existing template. If you don’t already have a VM template, then you will have no choice but to create the template from an existing virtual machine. Now here is the really important part. The template creation process will destroy the virtual machine from which it is created! As such, it is critically important that you never create a template from a production virtual machine. As a best practice, you should only create templates from purpose built model VMs.

So why is the VM destroyed during the template creation process? In order to build the VM template, Virtual Machine Manager has to run SYSPREP on the model virtual machine. This process randomizes the virtual machine by removing certain VM specific information. On a side note, when you are creating a model VM, you should avoid joining the VM to a domain. It’s also a good idea to go ahead and install any available patches before you begin the template creation process.

The second thing that you need to know is that where you store the template makes all the difference in the world. As you probably know, Virtual Machine Manager contains a built in library that is used to store reusable components. For instance, I use the library on my Virtual Machine Manager server to store VM templates and ISO files.

As you progress through the VM Template creation wizard, you will eventually come to a screen that asks you to select the library within which you want to save the VM template. While it might be tempting to select the default library and move on, doing so would be a mistake. Remember, Azure Pack is a portal into your private or hybrid cloud. When you create a cloud within Virtual Machine Manager, you are prompted to associate one or more libraries with the cloud. It is common for administrators to create a separate library for each cloud that they define. When you create a VM template, you must save the template to a library that is accessible from your private cloud. Otherwise, the template will not be accessible to Azure Pack within the cloud configuration screen that I showed you earlier.

The third thing that you need to know is that VM templates can have dependencies. Don’t get me wrong. A VM template is a standalone object. However, it is common for administrators to create sub-components that are referenced in the creation of VM templates and / or model VMs. Some of these sub components include guest OS profiles, application profiles, and hardware profiles. The use of profiles can help to ensure that VMs and VM templates are created in a consistent way and that they adhere to your internal requirements.


In this article, I have shown you where VM templates are linked to Azure Pack. I have also explained some of the more important points that you need to know prior to creating a VM template. In the next article, I will continue the discussion by walking you through the template creation process.

If you would like to read the other parts in this article series please go to:

See Also

The Author — Brien M. Posey

Brien M. Posey avatar

Brien Posey is an MCSE and has won the Microsoft MVP award for the last few years. Brien has written well over 4,000 technical articles and written or contributed material to 27 books.


Featured Links