Rapid VM Deployment
You have the ability to duplicate an existing VM, a process thats uses clones or templates, also known as master images, golden copies, they all mean the same thing you take an existing VM and copied it. In the section I will discuss an number of methods for duplicating a VM. There are two new features in the VM duplicating world
There are a number of ways to duplicate a VM
Converting to Template | This method copies the VM and converts it to a template format., during the creation of the template you have the ability to compact the files, which will reduce the size of the virtual disk. |
Convert to Template | This simply marks the VM as a template, it's much quicker that using Clone to Template as no copy process is generated, it literially takes seconds to marks it as a template and seconds to convert it back to being a VM. You first build the VM, then covert it to a template. When you need to update this template to convert back to a VM make the updates and then convert back to a template again. You use this VM as a template only and only gets powered on when you need to update it, so basically it is like a source for creating new VM's. |
Clone Virtual Machine | This merely copies a VM, you cannot compress the size of the VM (unlike Clone to Template) and you cannot quickly update the base VM (unlike convert to Template) |
Before you create a Template you need to consider the below
Creating a template doesn't just duplicate the VM's virtual disks, Additionally, the VM's .vmx configuration file is duplicated and renamed with the .vmtx extension, this means that all the settings behind your VM are being duplicated as well. This saves time by reducing the number of wizards and dialog boxes you need to complete. Note that if a VM is currently in snapshot mode you will not be able to clone it.
I generally create a folder called "templates", from the "home page" in vCenter select "VM's and Templates", select your data center (in my case it is called production), and right-click, then select new folder and name your folder.
Before you clone a VM it is sometimes better to you disconnect the CDROM (you will see an error on this below) and choose a staging network that it can connect too, these can then be changed before you put the newly cloned VM into service and thus will not affect anything else.
Cloning to a Template | I am going to use the Linux VM we created earlier as a template, normally I would update it with the latest patch set and install any software at all Linux VM's would require, backup agent, BB monitoring (Big Brother), etc. Select the VM you have powered off as you source for the template, right-click the VM and select "Template", then select "Clone to Template" The first screen you can select the compute resource if you have multiple ones Next we select the storage where the template will be stored Lastly you get a summary screen Once the template has been created you can go to the VMs and Templates section Once you have converted a VM to a template, you could build a new VM from it, convert it back to a VM, move it to a folder (template folder). |
Creating a new VM from a "cloned to Template" | Hightlight the template and right-click then select New VM from this Template Enter the VM's name and location (if you have multiple locations) Then select the compute resource Next select the datastore where to store the VM, making sure its a on a shared datastore The next selection allows you to change some of the templates configuration, IP address, Hardware, etc. Lastly you get to the summary screen. Once finished you will see the newly created VM in the hosts and cluster section |
To export a VM to a OVF (Open Virtual Machine Format)
VMware's new portable format OVF, allows vendors to create a virtual machine and upload to VMware to allow others to download and import into your environment. There are now many virtual appliances in VMware marketplace.
export a VM to OVF |
To export a VM into OVF, select the VM, then in the main vCenter window select file -> export -> "export to OVF template" |