I'm attempting to clone a VM using NAS VAAI fast clone API. I can create a fast clone of a vmdk using vmkfstools -I so I know VAAI is working but my attempts using PowerCLI always call VAAI Full Clone. Is there a away to request Fast Clones?
Thanks for any pointers,
Bill
Here is the code I tried:
param( [Parameter(Mandatory=$True)][String]$vcenter,[String] $base_clone = "Fedora")
#Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer $vcenter -Username root -Password dangerous
$source_vm = Get-VM | where {$_.name -like $base_clone } | Get-View
$clone_folder = $source_vm.parent
$clone_spec = new-object Vmware.Vim.VirtualMachineCloneSpec
$clone_spec.Location = new-object Vmware.Vim.VirtualMachineRelocateSpec
$clone_spec.Location.Transform = [Vmware.Vim.VirtualMachineRelocateTransformation]::flat
$clone_spec.Location.DiskMoveType = [Vmware.Vim.VirtualMachineRelocateDiskMoveOptions]::moveAllDiskBackingsAndAllowSharing
Write-Host "Creating clone from VM: $base_clone"
# Clone VM.
$clone_name = "${base_clone}_clone"
$source_vm.CloneVM_Task($clone_folder, $clone_name, $clone_spec ) | Out-Null