VMware Cloud Community
LittleNickey
Enthusiast
Enthusiast

New-VM -DiskStorageFormat $Format -Datastore $DatastoreCluster

I have a VM with Thick Lazy Zeroed disk format I want to clone to Thin disk format.

I've done this simpy with the command New-VM:

New-VM -Name $VMCloneName -VM $SourceVM -VMHost $SourceVM.VMHost -Datastore $Datastore -DiskStorageFormat Thin -Location $SourceVM.Folder -ResourcePool $SourceVM.ResourcePool

But if I have a datastore of 500GB and the SourceVM size is in total 600GB (one disk 300GB and one disk 300GB) above command would fail.

My theory is that using Datastore Cluster would solve this issue, or so I hope. If I have 2 datastores each 500GB in one DSC my hope is that it would place one disk on each datastore if there aren't space for both disks on the same datastore.

This would be achived with basically the same command:

New-VM -Name $VMCloneName -VM $SourceVM -VMHost $SourceVM.VMHost -Datastore $DatastoreCluster -DiskStorageFormat Thin -Location $SourceVM.Folder -ResourcePool $SourceVM.ResourcePool

However, this generates an error (attached screenshot) if I use the -DiskStorageFormat parameter together with a DSC. Running the same command without that parameter works fine, but then I get the same storage format as the SourceVM.

I found this post regarding this, but it's now old and no information regarding if it will be solved, if there's a workaround or if it won't be supported.

I run PS version 4.0 and PCLI 5.8R1.

Tested both in VC 5.5 with ESXi 5.0 and VC 5.5 with ESXi 5.5

-- Oskar
0 Kudos
2 Replies
LucD
Leadership
Leadership

This issue is still there I'm afraid, see Re: Datastore Clusters Not Working

You could try moving the $SourceVM to the datastorecluster first (provided there is enough free space)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

LittleNickey
Enthusiast
Enthusiast

Thanks Luc for the link.

Yes, this is the workaround we implemented - move vm and change to thin, then new-vm (clone) to dsc. This works in our scenario because we will then move the SourceVM to a new DC and can therefor change it to thick again, but I do hope Alans team keep working on solving this.

-- Oskar
0 Kudos