vSphere 6

Create Linked Clone using PowerCLI ESXi 6

Create Linked Clone using PowerCLI ESXi 6

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

 

 

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

One Comment

  1. Nice. Is there a way to perform guest OS configuration? or use a Customization Specification file for Windows?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.