Hi,
Please help me, how can I validate the free space on the destination datastore before I start the storage vmotion on the VM
$source = "DS03"
$destin = "DS39"
Get-Datastore $source | Get-VM -PipelineVariable vm |
ForEach-Object -Process {
$task = Move-VM -VM $vm -Datastore $destin -RunAsync
while ($task.PercentComplete -ne 100)
{
sleep 5
$task = Get-Task -Id $task.Id
$sProg = @{
Activity = "$vm Storage vMotion from $source to $destin"
Status = "$($task.PercentComplete)%"
PercentComplete = ([int]($task.PercentComplete))
}
Write-Progress @sProg
}
}