Hi,
I have several VMs that have .vmdk for themselves and some being shared with other VMs.
My understanding is that "Move-VM testVM -Datastore newDS" would target all of the disks that testVM has access to and move them to newDS. If the testVM's .vmdk files reside on multiple datastores (DS1, DS3 and DS7 say), is there a way that I can specify only storage from DS7 are targeted to move to newDS.
Better yet, is there a command to migrate the content of one datastore to a new one, and reconfigure all of the objects to use the new one.
Thx
I'm afraid that is not possible with a cmdlet.
But you can use the Relocate-VM method to do this.
See for example 11. Re: Using multiple datastores, can't migrate the vmx file to a datastore
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
An alternative method, with only cmdlets, could be the following:
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I used this one in the past to migrate a complete array give it a try
Get off my array! (Scripting datastore migrations with PowerCLI) | Notes from a Sysadmin
Hi Luc,
The first step - "Stop the VM" - makes this approach not feasible. I looked at your other approaches: "Relocate-VM" and "Move independent disks", and I think they are more applicable to deal with with my issue.
I will utilize your code as the foundation, wrap it with add'l tasks to fit our project's objectives, test it out and post the result later. The Relocate-VM is little bit abstracted for me ... I dont know when the "copy or storage vmotion" happens and how I would be able to control that activity. But that's what testing for!
In short, appreciate the lead ... just that it's technically not the answer yet.
Let me know if you get stuck.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference