Linked Clones on ESXi 5.5

1. Run sysprep and reseal the VM for cloning. Shut it down when finished and do not turn it on.

2. Install PowerCLI

3. Get the script: :

param (
$vm = Get-VM $SourceName
# Create new snapshot for clone
$cloneSnap = $vm | New-Snapshot -Name "Clone Snapshot"
# Get managed object view
$vmView = $vm | Get-View
# Get folder managed object reference
$cloneFolder = $vmView.parent
# Build clone specification
$cloneSpec = new-object Vmware.Vim.VirtualMachineCloneSpec
$cloneSpec.Snapshot = $vmView.Snapshot.CurrentSnapshot
# Make linked disk specification
$cloneSpec.Location = new-object Vmware.Vim.VirtualMachineRelocateSpec
$cloneSpec.Location.DiskMoveType = [Vmware.Vim.VirtualMachineRelocateDiskMoveOptions]::createNewChildDiskBacking
# Create clone
$vmView.CloneVM( $cloneFolder, $cloneName, $cloneSpec )
# Write newly created VM to stdout as confirmation
Get-VM $cloneName


I have got it saved as Create-LinkedClone.ps1

4. start PowerCLI, connect to your vCenter server and run the script:

You can also run this:

And here is a screen dump of my vCenter server with the Clone:

Now let’s start up the Clone:

Sysprep will take us through the setup.

Leave a Reply

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

1 × 1 =

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