VMware Cloud Community
michel_glaser
Contributor
Contributor

Copy-DatastoreItem: Thin to Thick Problem

Hi all,

I will do a backup of a test vm to a nas mount (datastore). The state of the vm is "off" and the disk provisioning type is Thin.

I found a nice script:

$ds1 = Get-Datastore DatastoreName
+ $ds2 = Get-Datastore NASBOXDatastoreName+
New-PSDrive -Location $ds1 -Name source -PSProvider VimDatastore -Root '\'
+ New-PSDrive -Name dest -PSProvider ViMdatastore -Root '\' -location $ds2+
Copy-DatastoreItem source:\VMNameToCopy\* -Destination dest:\VMNameToCopyBackup\ -Recurse -Force

That works perfect, but my problem is that the copied vmdk file type is thick. How can i change that?

Thanks in advance

0 Kudos
3 Replies
AntonVZhbankov
Immortal
Immortal

AFAIK thin provisioning works only on VMFS, i.e. iSCSI / FC.


---

MCSA, MCTS Hyper-V, VCP 3/4, VMware vExpert

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
0 Kudos
michel_glaser
Contributor
Contributor

When I do a "Clone" (with the GUI) of the vm, then Thin provisioning works on this NAS Datastore.

0 Kudos
LucD
Leadership
Leadership

You can use the Thin format on NAS-based datastores.

Why don't you use the Set-HardDisk cmdlet with the -Datastore parameter ? That allows you to copy a specific hard disk of a guest to a different datastore.

The 'clone' from the vSphere Client is based on the CloneVM_Task method. With that method you can specify the storage format.

In powerCLI you can do the 'cloning' with the New-VM cmdlet.

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos