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.
Now right-click on your VM and choose Template > Convert to Template. Click Yes on the confirmation window.
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.
You can also rename the template by right-clicking the template and select Rename. I will give the name VM-Template to the template.
Create Customization Specifications
Now we will go to the vSphere Web Client homepage and on the navigator pane, click on Policies and Profiles.
Now go to Customization Specification Manager and select Create a new specification icon on the middle pane.
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.
On Set Registration Information page, give your name and organization name as preferred and click Next.
Next, we need to specify the name used for the computer. Select Use the virtual machine name and click Next to continue.
On the licensing page, leave everything as default and click Next.
Set the administrator password as you preferred on the next step.
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.
Next step, we will choose a workgroup which is the default.
On the next page, make sure that Generate New Security ID (SID) is checked then click Next.
You can recheck the summary of the specification configuration then click Finish and it will be created.
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.
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.
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.
Select a storage for the VM datastore. I would choose the Shared iSCSI-Storage that we have previously created. Click Next to continue.
In the Select clone options, check Customize the operating system and Power on virtual machine after creation. Click Next.
Now, the specifications we have created previously should appear on the list. Choose that one and continue to the next step.
The summary page should appear and click Finish to create the VM.
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.
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.
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.
On the name and location page, fill in the library name as preferred then click Next.
Next on the Configure content library page, choose Local content library then continue to the next step.
On the storage selection, select a datastore and choose the Shared-iSCSI-Storage or other storage that you prefer. Press next to continue.
Last page shows the summary of the content library. Press Finish to finalize the process.
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.
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.
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.
On this page, we will choose the custom specification we have made before for this VM. Click next to continue.
Now, choose an ESXi host for the resouce pool of the VM. I will select my second ESXi host.
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.
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.
This is now the summary page of the new VM and press Finish to create the VM.
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.
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.
On the first step, fill in the name as preferred and specify the location of the VM under datacenter. Click Next to continue.
For the resource, I will choose my second ESXi machine. Click next.
Specify the storage location which I would prefer in my Shared-iSCSI-Storage and Thin Provision disk format then click Next to continue.
On the clone options page, check on Customize the operating and Power on virtual machine after creation check boxes. Click Next.
For the guest OS selection, choose the custom specification we have previously made then click Next and Finish on the summary page.
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.