Script to convert 100+ servers from Thick to Thin Format or whatever format you want.

LucDCorrect Answer
by LucD on May 28, 2015 5:19 AM
Try like this, it will only select VMs that have at least 1 Thick vdisk.



Connect-viserver vcenter.domain.tld

$sourcedatastore = “SOURCEDATASTORE“

$destinationdatastore = “DESTINATIONDATASTORE“



$vms = Get-VM -Datastore $sourcedatastore | where{(Get-HardDisk -VM $_ ).StorageFormat -contains 'Thick'}



foreach($vm in $vms){

  Move-VM -VM (Get-VM -Name $vm) -Datastore $destinationdatastore -DiskStorageFormat thin

}

Comments

Popular posts from this blog

How to step by step in detail install ssh on cachyos

Reset Login and Password for Web on ZimaOS

The error "Failed to update AutoStart - VMware Workstation