VMware Cloud Community
THEL1ZARDKING
Contributor
Contributor
Jump to solution

Storage vMotion a VM except disk that resides on another datastore

Hello,

I am looking to convert a large number of VMs from linked clones to Thick.  I have decided the easiest way to perform this is probably a simple a storage vMotion, however all VMs have a secondary disk that resides on another datastore.  I need to ensure that Disk#2 remains in it's current location while the VM (Config Files and Disk#1) get moved to a new datastore datastore.

I've figured out how to move an entire VM or a single disk but not a VM minus one disk.  I am able to do so through the advanced options in powerthe vSphere client so I presume this is techinically possible.

Any pointers or other ideas would be greatly appreciated.

Kind regards,

-Ty

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You'll have to use the API method, see for example Re: Using multiple datastores, can't migrate the vmx file to a datastore


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

View solution in original post

0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

You'll have to use the API method, see for example Re: Using multiple datastores, can't migrate the vmx file to a datastore


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

0 Kudos
THEL1ZARDKING
Contributor
Contributor
Jump to solution

Thanks Luc, that link was very helpful!  How might I define what the disk should be converted to in this method since I won't be using regular CMDlets?  I will need to specify "Thick Lazy Zero" to ensure the disks are migrated from linked clones.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Didn't have time to test it, but yes, that should work.

Do you see a faulty result ?


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

0 Kudos
THEL1ZARDKING
Contributor
Contributor
Jump to solution

With further testing I was able to verify I could migrate the VMX and OS disk but leave the data disk untouched.  The issue I am facing which caused the confusion is that option #2 of the KB below isn't converting my linked clone VM to thick upon storage vMotion, this appears to be the case for both Move-VM and Relocate_VM methods.

VMX: DS_1 --> DS_3

OS_VMDK (Linked Clone): DS_1 --> DS_3

Data_VMDK(Thick): DS_2

VMware KB: Converting a linked clone virtual machine to a full clone virtual machine

0 Kudos
LucD
Leadership
Leadership
Jump to solution

That should be possible through the client as well.

When you come to the datastore part there is an option that says Basic or Advanced.

In Advanced more you should be able to select the format per VMDK


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

0 Kudos
THEL1ZARDKING
Contributor
Contributor
Jump to solution

Luc,

Would we need to set the following for the RelocateVM_Task api when migrating to convert from lined clone to thick?

VirtualMachineRelocateDiskMoveOptions with option moveAllDiskBackingsAndConsolidate

Thanks,

-Ty

0 Kudos
THEL1ZARDKING
Contributor
Contributor
Jump to solution

By adding the following to the script you linked I can confirm it worked.

$Spec.DiskMoveType = [Vmware.Vim.VirtualMachineRelocateDiskMoveOptions]::moveAllDiskBackingsAndConsolidate

https://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.vm.RelocateSpec.html