Provision Virtual Machines in Parallel using New Workflow Feature in PowerShell V3

Provision Virtual Machines in Parallel using New Workflow Feature in PowerShell V3
PowerShell Workflow is one heavy duty feature which comes bundled with PowerShell v3, From my personal experiences i feel that its best used when you need to sequence you tasks, the best example being to run your tasks in parallel.Here’s a an example of how you can use a powershell workflow to automate VM provisioning using Hyper-V cmdlets and Failover Cluster Cmdlets using differential disks.

To start off i need a csv file which contains the list of VM’s which i need to be created along with their specs (VMName,Memory,VMPath,Hyper-V Host Name, Virtual Switch Name).

So here you can see that im creating 9 VM’s with above specs.

Also note in PSv3 i don’t need to import my modules anymore, powershell does it by itself and all cmdlets are exposed.

Below you can see that i invoked this workflow in my Powershell ISE and it invokes the tasks in parallel.

 

And here’s the end result, VM’s showing up in Hyper-V Manager and also made Highly Available.

Hope this post helps you out in your Datacenter Automation.

Hyper-V Manager

Failover Cluster Manager

 

Please follow and like us:

Share this post

Post Comment