- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My VM has two disks located on Datastore_005 and Datastore_006
The disk located on Datastore_005 is Thin
The disk located on Datastore_006 is EagerZeroedThick
I can convert the VMs disks from thin to thick eager Zeroed by:
move-vm MyVM01 -datastore Datastore_007 -DiskStorageFormat EagerZeroedThick
Is it possible to convert on the disk located on Datastore_005 to Thick Eager Zeroed without moving it to another Datastore while the VM is online ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, if a number of conditions are met:
- VM needs to be powered off
- VM may not have snapshots
- The harddisk must Thin
- There should be sufficient free space on the datastore where the VMDK is located
In that case, you can use the InflateVirtualDisk method.
$datastoreName = 'Datastore_005'
$vm = Get-VM -Name $vmName
if($vm.PowerState -ne 'PoweredOff'){
Write-Host "The VM needs to be powered off"
}
if(Get-SNapshot -VM $vm){
Write-Host "There may not be snapshots on the VM"
}
$si = Get-View ServiceInstance
$vmdkMgr = Get-View -Id $si.Content.VirtualDiskManager
$dc = Get-Datacenter -VM $vm
Get-HardDisk -VM $vm | where{$_.StorageFormat -eq 'Thin' -and $_.Filename -match $datastoreName} |
ForEach-Object -Process {
Write-Host "Inflating $($_.Name) on $($vm.Name)"
$vmdkMgr.InflateVirtualDisk($_.Filename,$dc.ExtensionData.MoRef)
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Luc
Yes but the VMs has to remain powered on. (it +1000 VMs and lots of them are in production with no downtime available in normal business hours)
So I guess that I need to move the thin disk to another datastore to be able to do it while its online.
Or migrate the thin disk to a temporary datastore and then move (convert) it back to source datastore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm afraid so.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess I should use something like this from one of your other great solutions:
$vmdkMgr.MoveVirtualDisk($srcVMDK,$srcDC.ExtensionData.MoRef,$dstVMDK,$dstDC.ExtensionData.MoRef,$force,$null)
But I'm not sure how to use it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just thought of this, did you already try with Set-Harddisk and the StorageFormat and Datastore parameter?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LucD,
Can we convert VM's having Thick provisioned to Thin provisioning ? Please let me know if yes what are the possible way to do.
Thanks
vmk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Afaik, that will only work with a Move-Harddisk cmdlet and the StorageFormat parameter.
I don't think there is an option to do this in-place.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, LucD. We have data store provisioned and we are planning to get rid of thick provisioned disk.
thanks
vmk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
Did we get this sorted yet please?
We have Think disk VM's in infra which we need to convert to Thick eager zeroed while doing the SVmotion of the VM's and moving them to a spedified cluster. The Vm's should be powered ON all time. Can this be scripted somhow please. There are lot of VM's and doing this manually will take month's to complete.
Thanks for any assistance anyone could provide.
~Nitin