# encoding: ascii
# api: powershell
# title: Thin provisioning with P
# description: Thin provisioning with PowerCIL 4.0 version
# version: 0.1
# type: function
# license: CC0
# x-poshcode-id: 1987
# x-archived: 2010-07-21T21:16:20
#
#
function ConvertVMDiskToThin($vm, $datastore) {
   $vmView = Get-View $vm
   $dsView = Get-View $datastore
   
   $relocateSpec = New-Object VMware.Vim.VirtualMachineRelocateSpec
	$relocateSpec.Datastore = $dsView.MoRef
	$relocateSpec.Transform = "sparse"
   
   $vmView.RelocateVM($relocateSpec, $null)
}
