Thanks again! This worked great for me as I only needed to do storage moves for this round...
Original Message:
Sent: Jun 05, 2024 09:34 AM
From: LucD
Subject: Script for Compute + Storage vMotion
That is basically using the Move-VM cmdlet with the VMHost and Datastore parameters.
When you don't use the RunAsync switch the cmdlet will wait till the move is complete.
You can read the names of the VMs, and then in a foreach loop execute the Move-VM cmdlet.
------------------------------
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Original Message:
Sent: Jun 05, 2024 09:25 AM
From: PS Auto
Subject: Script for Compute + Storage vMotion
Hi @LucD sorry for the late response. Looking to run the following task automatically from a VM list. Screenshot below.
When 1 x VM completes, kick off the next VM same task without interaction.
No RDMs are used in our environment. Regular VMFS LUNs in a datastore cluster.

Original Message:
Sent: May 08, 2024 03:06 PM
From: LucD
Subject: Script for Compute + Storage vMotion
Not sure I understand what you mean by "storage vMotion its LUN location"
Is that LUN used for an RDM disk on the VM?
------------------------------
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Original Message:
Sent: May 08, 2024 02:10 PM
From: PS Auto
Subject: Script for Compute + Storage vMotion
Ah yes sorry we are looking to vMotion a VM to another ESXi host, + storage vMotion its LUN location as well in the same task.
Run 2 x tasks in parallel.
1 x task a time works too if it keeps pulling the next one in a list sequentially
Original Message:
Sent: May 08, 2024 12:05 PM
From: LucD
Subject: Script for Compute + Storage vMotion
1. What exactly do you mean by "compute"?
3. I assume you mean background jobs (-RunAsync)?
------------------------------
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Original Message:
Sent: May 08, 2024 10:17 AM
From: PS Auto
Subject: Script for Compute + Storage vMotion
@LucD it's been a while but looking for some help. Worked with you in the past.
Looking for a good PS script I can manipulate for the following task:
- Compute and Storage vMotion a VM to a new ESXi host
- Run it using a list of VMs
- Run only 2 concurrent tasks at a time to avoid saturation
Basically looking to kick off a long duration job that can be checked every few hours.
Thank you so much!