Clone a VMware VM with guest OS customization

Before I show you how to clone a VMware virtual machine (VM) with a guest OS customization, I will talk a bit about VM customization specification. What is it?

VM customization specification is a workflow wizard allowing you to prepare an answer file to use during the cloning process. You can customize Windows or Linux VMs. Customization of Linux guest operating systems requires installation of Perl.

Customizing guest operating systems lets you prevent conflicts that might happen if you were to deploy VMs with identical settings, for example, conflicts due to duplicate computer names. You can apply customization as part of VM deployment or later on.

To create our new customization specification, we navigate to Policies and Profiles in the vCenter Web Client or Flash client.

Since vSphere 6.7 U1, I've only used the vSphere HTML 5 Web Client because there is feature parity, which means they've now implemented all features that were missing in the past.

From the Menu, go to Policies and Profiles and click the New button to add a new customization specification.

VM customization specification

VM customization specification

Then a new wizard will start allowing you to choose some details and enter a description. You also can choose between Linux or Windows.

Create a new VM customization specification

Create a new VM customization specification

And then after filling in the registration information, in the next step, you'll have several choices, such as specifying a computer name or entering a VM name during the clone/deploy wizard. You can also hardcode a name you want the machine to take.

Specify a computer name

Specify a computer name

All of this workflow is basically a virtual machine personalization, executed after the clone.

It is not necessary to go through all of these screens. As you might imagine, it'll ask you about the time zone, network settings, whether you want to join a Microsoft domain, and whether you have any scripts you want to run after configuring the VM.

Join Microsoft domain automatically

Join Microsoft domain automatically

After applying all the settings, you can attach the VM to a Microsoft domain, reboot it, and have it ready for your clients to consume.

So basically, you can use VM customization specifications in two ways:

When cloning an existing VM: Again, you need to create a VM customization specification; then you can use this specification to clone and personalize the guest OS.

When personalizing an OS of a VM deployed from a template: A template is not a VM. This special object serves as model, and you can only use it to deploy new VMs.

When you deploy a VM from a template, you can customize the guest operating system after the deployment task is complete.

Customize a VM from a template

Customize a VM from a template

You can also customize any data center VM simply (depending on whether it's Windows or Linux) with the following workflow:

Right-click a VM in the vSphere inventory and select Guest OS > Customize Guest OS, which will open a wizard. Apply a customization specification to the VM.

Clone a VMware VM with a customization guest OS with just a few clicks ^

So finally, once we've created the customization specification, we can clone and automatically customize a VM with a few clicks.

Select any VM and go to Clone to Virtual Machine.

Clone to virtual machine

Clone to virtual machine

A new wizard will start, asking you to specify a name for your new VM.

Specify a name for your new VM

Specify a name for your new VM

Then pick a data store in which to store this VM.

Select storage

Select storage

And here you have the "Customize the Guest OS" option you must check to launch an overlay window that will bring up the guest OS specification list.

Customize the guest OS option

Customize the guest OS option

And the window looks like this—an overlay window presenting you with the list of different specifications you prepared at the beginning of the post.

Customize the guest OS list

Customize the guest OS list

The idea is to create a general template from which you can clone a new VM and apply the customization you want. This is because once you execute the specification on a particular data center VM, it will customize the VM, attach it to a domain, and apply all the customizations.

There is no way back—unless you revert these steps manually.

Final words ^

It's a very simple way to create an answer file for Sysprep to use to customize a deployed VM from templates or for cloning or deploying templates from the content library.

The customization specification created is listed in the customization specification manager.

You can use the specification to customize a VM guest OS. You can create any number of VM customization specifications, and it will add all of those to the list.

Being able to have templates to clone and personalize according to your company's needs is a really convenient and fast way to provision new VMs.

Want to write for 4sysops? We are looking for new authors.

Read 4sysops without ads and for free by becoming a member!

2+
avataravatar
Share
6 Comments
  1. Wasim 1 year ago

    Hello Vladan,

    Do you have any detailed article on customizing a CentOS, RHEL VM?
    I need to know how to do it and what changes happen in VM when it goes through customization.

    Thanks.

    1+

  2. Robert 6 months ago

    Thanks for the article.  Not sure if everyone else sees this, but the "Create a Specification" button in the (6.7 Flex) when building/cloning a VM is missing in HTML5 and you have to build the spec before you build/clone.  I wish VMware would be more consistent on the features between the version of vCenter.  Also I miss the manual customization when building a VM, I was very helpful for one off VM creations.

    1+

    • Author

      Yeah, you're right. The HTML5 client is lagging behind, but not for long I can tell you. I think since this post was written, at least two versions (6.7 U2 and 6.7 U3 went out) each one brought more into the HTML 5 client.

      It is just a question of time (next major version of vSphere NEXT) will most likely be phasing out the Adobe Flash client completely. 

      0

  3. Albie Jr 1 month ago

    Hello Vladan, last time we use to clone from template and also apply the customization on the fly without selecting the policies. Is still supported in 6.7?

    0

    • Author

      I haven't checked the differences between 7.0 and 6.7 to be honest. But 6.7 is still supported as such and it did not changed since.

      0

Leave a reply to Albie Jr Click here to cancel the reply

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2020

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending

Log in with your credentials

or    

Forgot your details?

Create Account