Assume that you're in an organisation with numerous data centres, each with their own private clouds running on VMware vCenter 5.5. There are VMware templates for different Operating Systems, including Windows, Redhat Linux etc.

Lets assume there are two private clouds, C1 and C2. C1 was built a year ago and C2 only recently. Lets assume it runs Windows 2012. The base template was updated several times since C1 was built. For example, the .NET framework was updated from v4.0 to v4.5 and then to v4.5.1.

A virtual machine in C1 needs to be rebuilt. However, the software running in that virtual machine is not compatible with .NET v4.5 or v4.5.1. So the only template we have isn't compatible. We have to recreate the template, with an odd chance that some OS patch etc may be installed that causes a problem for the virtual machine.

So it seems that it should be a best practice to version templates. What is the best approach?

Here's what I tried:

  1. Create Snapshots before the template is updated. The VMware vSphere tools still consider it to be one template, so creating a virtual machine from snapshot "20131031 02:00" is a tad more involved.
  2. Duplicate the Template, so now we have "Windows Server 2012 (20131031)", "Windows Server 2012 (20130331)" and "Windows Server 2012 (20140601)". The tools support this well. We may quickly have a mess, with folks having no clue what is installed on what template.
  3. After a template is updated, export it. Only the latest template is available in VMware tools, but I can always restore an old version of the template when there is a problem.

Is there perhaps a more robust way of versioning VMware templates?

  • Seems to me that you may need application specific templates if you have these compatibility issues. – Reality Extractor Jun 19 '14 at 19:25
  • Applications and their versions are growing exponentially, so this would quickly become a pretty big mess. – bloudraak Jun 19 '14 at 19:48
  • in that case use the lowest common denominator for compatibility. Either way you have a lot of administrative overhead if all your apps require different per-requisites. This really seems to be more of a deployment planning rather than a VMware issue. You want to keep the environment as like as possible for high consolidation ratios. – Reality Extractor Jun 19 '14 at 20:13

I think you are trying to solve your problem with the wrong tools. VMware templates are very similar to traditional operating system images. They exist to really do two things: 1) Provide a consistent known-good base that all of your servers start with and 2) reduce the repetition of administrative tasks required to go from installation media to that known-good state. You build your template to meet the most common configuration across your fleet. If you have so many different needs that your "common denominator" template is so spare that there is a huge gap between the template and the desired state you have to start doing the math to determine whether the effort to maintain multiple templates is worth the effort you saved in terms of the tasks it takes to go from your "common denominator" template to your specialized template. In my experience, maintaining multiple templates or images is often much more effort than the effort required to perform the configuration. As you have discovered maintaining different templates this way is a logarithmic curve and not a linear one - especially in a heterogeneous environment. This is why imaging works so well for desktops but is less useful for servers.

Your solution rests in reducing of the effort of the tasks it takes to go from your "common denominator" template to your specialized desired configuration. This is essentially configuration management. In the Windows ecosystem you are looking at tools like GPOs, PowerShell DSC, and SCCM. I'm less familiar with the enterprise tools in the Linux world but something like Puppet or Chef should work.

Using templates or images to reduce configuration effort is often a losing game if there is significant diversity in your desired end-state configuration.

If your deadset for using templates for this, you are going to need to construct some scripts, likely with PowerCLI, to perform the tasks of snapshotting, modifying and copying the template and marking it with a version or putting it into some kind of versioning system that can handle files of this size. Again, I suspect the effort of solving your problem this way is less than using some kind of configuration management system.

  • What do you do to find the balance? And if you have different baselines how do you manage versions of those baselines? One approach would simply be to create a template for every major milestone, e.g. an OS service pack or critical update. Those do not come along that often. – bloudraak Jun 23 '14 at 23:47
  • @WernerStrydom It's really dependent on your environment. I found for us that templates were not useful for configuration purposes. GPOs and SCCM just did a better job and was much more maintainable. – user62491 Jun 24 '14 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.