Hey All,
We've got a few VM's that are thick provisioned and want to script making them thin. We know from experience that using the vSphere GUI if we execute the following we can achieve this without a big headache:
I know of the Move-VM cmdlet, and I see there is a Datastore parameter we can specify the new store. From the GUI we'd have the option to select thin, but I'm not sure how this will translate over from the CLI end. Any thoughts??
Kindest Regards,
ALAN
You can convert a vm from thick to thin with:
Get-VM MyVM | Move-VM -Datastore MyDatastore -DiskStorageFormat Thin
I beleive you can accomplish that using this command:
Get-Datastore
"CurrentDatastoreName"
|
Get-VM
|
Move
-VM
-DiskStorageFormat
Thin
-Datastore
"NewDatastoreName"
–RunAsync
H/t to Alan at http://www.virtu-al.net/2011/09/14/quick-and-simple-storage-vmotion-scripts/ .
Hey All,
Thanks for the quick response I was hoping it would be simple like that. Out of curiosity why in the standard doc's do I not see the -DeskStorageFormat parameter?? Is it a common parameter??
Kindest Regards,
ALAN
Perhaps you are using an older PowerCLI version where this parameter didn't exist yet ?
Use the online reference, see Move-VM
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Alan,
Be sure to reference the latest documentation for the version you are running of Powercli. They add new features to the commandlets with each realease.
Powercli 5.1 Release 2 was just released yesterday.