Guys, just wanted to write up a quick post on how to spin up a linked clone in ESXi 6.0 using only PowerCLI, this may come in handy if you are testing in a lab environment or have the need to spin up multiple workstations quickly for endpoints for users without consuming a lot of storage. ย There are quite a few posts out there showing how to accomplish this process with PowerCLI. ย However, I wanted to in simple terms show how this can be done with a one liner. ย With PowerCLI the process is very simple and straightforward.
Create your Master
The first step you need to do is actually create your “master” VM which is normal VM creation with any other customizations that you want to do with the VM such as 3rd party apps, software, etc. ย Also, any processes such as sysprep that you want to do with the master is recommended. ย Thin provisioning is preferred. ย When you have everything ready to go with the master VM, you will want to power it off,ย create a snapshot which you need to name something meaningful – such asย base image orย master image, etc. ย The snapshot is disk the linked clones will be working from.
Let’s take a look at the PowerCLI commandlet with some variables in place to make it easier to see what goes where.
New-VM -Name $linkedclonename -VM $sourceVM -Location $vCenterFolder -Datastore $datastore -ResourcePool Resources -LinkedClone -ReferenceSnapshot $parentsnapshot
Hopefully the command above makes sense as written. ย Also, as you can easily see, we can replace the variables with the actual names of the pieces in our environment or you can use variables and set up the commandlet more for mass deployment.
This functionality is built into the latest version of PowerCLI available, PowerCLI 6 R3 and doesn’t require any add on fling, etc: ย https://my.vmware.com/web/vmware/details?downloadGroup=PCLI600R3&productId=491
Nice. Is there a way to perform guest OS configuration? or use a Customization Specification file for Windows?