Lab 11 Using Templates and Clones

Create VM Template

Start your vSphere Web Client and go to VMs and Templates from the navigator pane. Expand datacenter and under the Lab VMs folder you will find VM1-1 which is the VM we have previously created. To create a template out of it, the VM has to be turned off first. Right-click on the VM and choose Power > Power Off. Click Yes if a confirmation prompt comes up.

Figure 1. Turn off VM

Now right-click on your VM and choose Template > Convert to Template. Click Yes on the confirmation window.

Figure 2. Convert VM to template menu

If you haven’t create any template folder, you would want to create one for better organization of VMs. After the folder is available, right-click on your newly created template and choose Move To. Then expand the VM Folders to find your Templates folder. Choose the folder and click OK and your VM template will be moved to that folder.

Figure 3. Moving templates to folder

You can also rename the template by right-clicking the template and select Rename. I will give the name VM-Template to the template.

Figure 4. Renaming template

Create Customization Specifications

Now we will go to the vSphere Web Client homepage and on the navigator pane, click on Policies and Profiles.

Figure 5. Policies and Profiles

Now go to Customization Specification Manager and select Create a new specification icon on the middle pane.

Figure 6. Customization Specification Manager

On the first step, choose Windows for the Target VM Operating System and give the specification name as preferred. I will give it the name VM-CustomSpec.

Figure 7. Specify properties

On Set Registration Information page, give your name and organization name as preferred and click Next.

Figure 8. Set registration information

Next, we need to specify the name used for the computer. Select Use the virtual machine name and click Next to continue.

Figure 9. Set computer name

On the licensing page, leave everything as default and click Next.

Figure 10. Enter Windows license

Set the administrator password as you preferred on the next step.

Figure 11. Set administrator password

Next, choose your time zone as preferred and continue on the Run Once step. For the network configuration settings, leave the option as default then click Next.

Figure 12. Set network configurations

Next step, we will choose a workgroup which is the default.

Figure 13. Choose workgroup or domain

On the next page, make sure that Generate New Security ID (SID) is checked then click Next.

Figure 14. Operationg system options

You can recheck the summary of the specification configuration then click Finish and it will be created.

Figure 15. Specification summary

Deploy VM from Template

We will try to create a VM through the template that we have previously created. Go to VMs and Templates, right-click on your VM Template and choose New VM From This Template.

Figure 16. New VM from template menu

A window will appear an the first step is to give the VM name as preferred. Also under there, you would have to choose at which folder the VM will be created. Click Next to continue.

Figure 17. Select name and folder for VM

Next, we will select a resource which is the ESXi host. Expand the folders and choose a host you would like to choose. Click Next to continue.

Figure 18. Choose resource host

Select a storage for the VM datastore. I would choose the Shared iSCSI-Storage that we have previously created. Click Next to continue.

Figure 19. Choose storage for VM

In the Select clone options, check Customize the operating system and Power on virtual machine after creation. Click Next.

Figure 20. Clone options

Now, the specifications we have created previously should appear on the list. Choose that one and continue to the next step.

Figure 21. Select guest OS

The summary page should appear and click Finish to create the VM.

Figure 22. VM creation summary page

You can check the cloning progress of the VM under the Recent Task menu which you can find on the bottom part of the page. As you can see in figure 23, the VM is still in the process of cloning.

Figure 23. VM cloning in progress

You can now open the newly created VM console and check if it is working properly. But you would want to change the anme of the computer as it will be the same as the one used for the template. The machine will restart a few times to setup several things and it will be back on again and properly working.

Figure 24. VM is working properly

Create Content Library

Go to the vSphere Web Client home page and find Content Libraries on the navigator pane. Go to the Objects tab on the center pane and create a new content library.

Figure 25. Create new content library

On the name and location page, fill in the library name as preferred then click Next.

Figure 26. Specify name and location

Next on the Configure content library page, choose Local content library then continue to the next step.

Figure 27. Configure content library

On the storage selection, select a datastore and choose the Shared-iSCSI-Storage or other storage that you prefer. Press next to continue.

Figure 28. Select library storage

Last page shows the summary of the content library. Press Finish to finalize the process.

Figure 29. Content library summary

Clone a VM Template to Content Library

Go to the VMs and Templates menu and select a template that you have created. Right-click on it and select Clone to Library. A window will appear and make sure you select Clone as to New template. Under the filter, select a content library then you could also give a different name for the library template. Then click OK.

Figure 30. Clone template to content library

Deploy VM from Template in Content Library

Go back to Content Libraries menu from home page again and access your VM library from the navigator pane. Click on the Templates tab and then the template library we have just made. Right-click on it and choose New VM from This Template.

Figure 31. New VM from template in content library

Specify the name of the new VM in the provided text box and the location under the datacenter. Make sure you check on Customize the operating system on Customize VM Options and then press Next.

Figure 32. Specify name and location

On this page, we will choose the custom specification we have made before for this VM. Click next to continue.

Figure 33. Select OS from specification

Now, choose an ESXi host for the resouce pool of the VM. I will select my second ESXi host.

Figure 34. Select resource

Recheck the information on the review details page and click Next. Now we have to specify the storage for the new VM. For the disk format, select thin provision so that it would take space as it needed. You can select any storage you want but I will choose Local02-1 which is the local datastore of my second ESXi host. Click next to continue.

Figure 35. Storage configuration

On the Configure network page, choose the VM network you prefer for the new VM. I will be using my PG-Storage02 network which is connected to my storage servers. Click Next.

Figure 36. Specify network

This is now the summary page of the new VM and press Finish to create the VM.

Figure 37. VM summary

Keep track of the process on the Recent Task tab. After it is done, try to open the VM console and make sure it works properly.

If you want to delete the content library that we have created, you could go back to Content Libraries from the home page. Right-click on the VM library and choose Delete. If a window appears click Yes to delete the VM library.

Figure 38. Delete a content library

Clone a Powered-On VM

We will start at the Vms and Templates menu. From there select one of your VM and right-click to choose Power > Power on. While it is starting up, we can start the cloning process. Right-click on the VM again and find Clone > Clone to Virtual Machine and the wizard should start.

Figure 39. Clone virtual machine menu

On the first step, fill in the name as preferred and specify the location of the VM under datacenter. Click Next to continue.

Figure 40. Specify VM name and location

For the resource, I will choose my second ESXi machine. Click next.

Figure 41. Select resource

Specify the storage location which I would prefer in my Shared-iSCSI-Storage and Thin Provision disk format then click Next to continue.

Figure 42. Storage selection and configuration

On the clone options page, check on Customize the operating and Power on virtual machine after creation check boxes. Click Next.

Figure 43. Clone options

For the guest OS selection, choose the custom specification we have previously made then click Next and Finish on the summary page.

Figure 44. VM summary

Check on the Recent Tasks pane and wait until the cloning process is finished. Let’s try to check the cloned VM and see if it works properly. Open the console from the VM and see how it goes.

Figure 45. VM working normally

Leave a comment