VMware Cloud Community
apavlikIT
Contributor
Contributor

Moving a single hard drive on VM to a different datastore cluster

I am in need of moving a single hard disk on a VM to a different datastore cluster. The Move-HardDisk command works great to move the hard disk to a separate datastore but does not appear to support moving to a different datastore cluster. Is there way to do this?

Reply
0 Kudos
1 Reply
LucD
Leadership
Leadership

Not with a PowerCLI cmdlet I'm afraid.

See also Move-VM to datastore cluster with DiskStorageFlag throws error.

But you can call the vSphere API methods directly.

First you need to use the RecommendDatastores method to find the datastore recommendation for a specific vDisk.

Then you use that result in the RelocateVM method to actually move the vDisk

The mentioned thread contains a sample script, it moves all vDisks of a VM to the datastorecluster.

But you can easily adapt the Where-clause to select a specific vDisk


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

Reply
0 Kudos