PoshCode Archive  Artifact [89848e7b98]

Artifact 89848e7b98bd498501b3885023b36ecf22df7768e174170a3f025e739816a8f7:

  • File Thin-provisioning-with-P.ps1 — part of check-in [53e5003af7] at 2018-06-10 13:03:42 on branch trunk — Thin provisioning with PowerCIL 4.0 version (user: unknown size: 563)

# 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)
}