Lab 12: Using Templates and Clones

In this lab, I am going to deploy a virtual machine from a template and clone a virtual machine while it is powered on.

A template is a master copy of a virtual machine. It is used to create or provision a virtual machine from a virtual machine template. It is a basically image including a guest operating system, a set of applications and a configuration of specific virtual machine counterparts to hardware components.

A Clone is the exact copy of the virtual machine with the same configuration and installed software as the original. It is an alternative way to deploying a virtual machine. You can clone a virtual machine while is powered on, powered off and suspended.

The tasks list for the lab 12:

  • Create a Template
  • Create Customization Specifications
  • Deploy a virtual machine from Template
  • Clone a Virtual Machine that is powered on

Prerequisite:

  • Log in the web client portal: https://vCenter– server appliance.domainname:9443/vshpere-client/# from your  web browser
  • VMware vCenter Server Appliance username with domain and root password

Steps for the task: Create a Template

A virtual Template is a template of the Virtual machine that is using to create a new virtual machine without installing the operating system and hardware configuration.

Step 1: Log in the VMware VSphere Web Client Client0

Step 2: Go to the vCenter->Virtual Machine and Right click on your virtual machine [ Select that one you want to convert into template] and Click ” Shut Down Guest OS”.1.jpg

2.jpg

Step3: Now Right click on your Powered Off Virtual Machine.  and “All vCenter Actions -> Convert to Template. 

3.jpg

Step4:  Go to the vCenter ->VM Templates. Click on it.4.jpg5.jpg

Step5: Right click on the template of virtual machine and select “Move To”6.jpg

Step6: Now you need to select the location where you want to move your Virtual machines. Expand VM Folder that you created before for store “Templates’. Select the VM Folder ->  Templates. Then “Ok”.7.jpg

Step 7: Now you need to rename your template with any appropriate Name.  Right Click “Virtual Machine templates” and click “Rename“.  Enter the new name for your template. Then Ok8.jpgNote:  

  • Clone the VM to a template, VM can be powered on or powered off
  • Convert the VM to a template, the VM must be powered off
  • Clone a template, Select the template in the inventory first
  • Clone to template offers you to select disk format in which you will store the VM
  • Convert to template doesn’t offer any choice to select format disk, It keep the VM’s disk intact

Steps for the task: Create Customization Specifications

The customization specification operating system helps to prevent conflict that may happen when VMs with identical setting are deployed including computer name, network setting, software setting and license setting. The specification can be stored in the database, and you can use it to prepare the guest operating system of VM. You can also edit specifications in the Customization Specifications manager when you require to change it.

Prerequisite:

  • vCenter Server root user and password
  • Virtual Machine administrators password
  • Time zone

Step1:  Click “Home” in the vSphere Web Client. Select “Customization Specification Manager”9.jpg

Step2: Click on the “ Create  a new Specification” icon, you will get a “New VM Guest Customization Specifications” wizard10.jpg

Step 3: Now you need to perform the following actions that I was showing on the screenshot.

Option 1: Specify Properties: Select Target VM operating system [ in this case window], you can do it any operating system. and Customization Spec Name11.jpg12.jpg

Option3: Set Computer name: Use the Virtual Machine Name 13.jpg

4. Enter Windows License: If you don’t have a product key, leave it blank and all of another setting keep it default. 14.jpg

Option 5: Set Administrator Password: By this password, you will able to auto login operation into your VM as Administrator. 15.jpg16.jpg18.jpg19.jpg20.jpg

Option 11: This is the summary page of your setup. look over once again before click on “Finish”21.jpg

Step 4: Verify the Customization Specification that you created22.jpg

Steps for the task: Deploy a virtual machine from Template

Deploying Virtual machine from the templates can be saved time in creating a new VM. In this task, I am going to show how to deploy a VM from the template and also enable vCenter Server to customise the guest operating system.

Step 1: Click “Home” in the vSphere web Client and Select vCenter -> VM Templates1-0

Step 2: Right click on your template and Select “Deploy VM from the templates”. You will get a Deploy from template wizard. 1-1.jpg

Step 3: Now you need to perform the following actions that I showed on the screenshots.

1.jpg

Step 4: Here, You can select virtual disk format or you can leave it to default ” the Same format as a source” and Select the datastore 3.jpg4.jpg

Select Customize guest OS that you have made the previous task.

5.jpg6.jpg

Step 5: After creating your new virtual machine, Go to the vCenter > Virtual Machines to verify it. 10.jpg

Step 6: Log in your newly created machine as an administrator with the VM administrator password. Install the VMware Tools. 11

Steps for the task: Clone a Virtual Machine that is powered on

Cloning is the alternative method to deploying a VM from a template. Cloning makes a carbon copy of the VM with the same configuration and installed software as the original. A VM being cloned can be powered on or powered off or suspended stage.

Step 1: Right-click on your newly created VM and select “Clone to Virtual Machine12.jpg

Step 2: Now you need to perform the following action to launch a clone of VM

Option 1: Give a name such as “Hot Clone“. I used Hot-Clone02 because I am going to deploy the clone VM on my second host “esxi02.momataj.local“.1.jpg

Option 2: Select a Computer Resouce from the Lab Server folder and click the ESXi host where you want to deploy the clone VM.2.jpg

Option 3: Select Storage: Here You will get three options. You can select virtual disk format as “ the Same format as source” or you can choice other options based on your requirement.15.jpg

Option 4: Select Clone Options: Customise the Operating System and Power on VM after Creation4.jpg

Option 5: Customise the guest OS: Select your Customize Guest OS Specification that you created earlier.5.jpg

Options 5: Now you can monitor the progress of the task of creating clone machine from “Recent Tasks“.19.jpg

Step 3: You can verify your newly created clone VM from Home -> vCenter -> Virtual Machines3.jpg

7.jpg

Thank you 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s