justin_emerson
Enthusiast
Enthusiast

Move-VM + thin-provisioning?

In vSphere, you can (via the GUI) Storage VMotion a VM and change its disk type to Thin Provisioned. Is there any way to do this through the provided Move-VM cmdlet? Or do I need to resort to using the API RelocateVM_Task and provide the VirtualMachineRelocateTransformation as sparse?

If it's the latter - might I put in a feature request? Smiley Happy

0 Kudos
8 Replies
max_inglis
Enthusiast
Enthusiast

I'd like to see this too. I migrated 500 machines to a new NFS volume that were previously thick, and it didn't take advantage of the thin-provisioning on NFS Smiley Sad

http://ITangst.blogspot.com
0 Kudos
admin
Immortal
Immortal

If it worked like this would it be good enough?

Get-VM -datastore X | Move-VM -datastore Y | Get-HardDisk | Set-HardDisk -StorageFormat Thin

=====

Carter Shanklin

Read the PowerCLI Blog
[Follow me on Twitter|http://twitter.com/cshanklin]

justin_emerson
Enthusiast
Enthusiast

Carter,

That seems like it would take longer... I believe a storage VMotion from thick to thin should take less time than thick to thick (i think).

Also, would the -StorageFormat be available hot? As it stands, you cannot "inflate" a hard disk from the GUI hot - you have to Storage VMotion to do that.

If the Move-VM command took the same amount of time, and you could do Set-HardDisk hot... that would be fine. Otherwise being able to set the option in Move-VM like..

Move-VM -Datastore Y -StorageFormat Thin

would be best.

0 Kudos
max_inglis
Enthusiast
Enthusiast

I think that would be fine if it worked like that - doesn't help me today tho. Smiley Sad

http://ITangst.blogspot.com
0 Kudos
admin
Immortal
Immortal

Ok, actually what if it worked like THIS:

Get-Datastore X | Get-VM | Get-HardDisk | Set-HardDisk -Datastore Y -StorageFormat Thin

I was hoping we were going to get a Move-HardDisk cmdlet, but this works too.

=====

Carter Shanklin

Read the PowerCLI Blog
[Follow me on Twitter|http://twitter.com/cshanklin]

0 Kudos
max_inglis
Enthusiast
Enthusiast

Are you saying this would work today?

http://ITangst.blogspot.com
0 Kudos
admin
Immortal
Immortal

No it won't work in PowerCLI 4.0 unfortunately.

=====

Carter Shanklin

Read the PowerCLI Blog
[Follow me on Twitter|http://twitter.com/cshanklin]

0 Kudos
justin_emerson
Enthusiast
Enthusiast

Carter,

Not to be a negative nelly but...

This wouldn't actually move the VM, just its hard drives. What if we want to move the whole VM, VMX file and all? then we'd have to run a Move-VM command immediately after, which would involve yet another copy....

0 Kudos