1 person found this helpful
Here are some tips that should get you going in the right direction to update your code to support specifying those additional items:
- add a property (a "column") in the CSV for Datastore, in which you specify the datastore or datastorecluster for the given VM
- add the parameter -Datastore to the New-VM call, with a value of ($_.Datastore)
- Similar to the Datastore tidbit above, add a property (a "column") in the CSV for Folder, in which you specify the unique name of the vSphere inventory folder in which to place the given VM
- add the parameter -Location to the New-VM call, with a value of (Get-Folder -Name $_.Folder)
Multiple NICs, and specify PortGroups
- it's probably clear by now, but, add some property for the number of additional VM NICs to add to the VM; this might just be an array of vPG names, to be used for each new VM NIC
- add a bit of code that adds that number of NICs to the new VM and with the desired vPG (using New-NetworkAdapter)
- add a property to the CSV that is an array of sizes of new virtual disks to add to each VM (if any)
- add a bit of code that adds the given number of virtual disks, and of the given sizes (using New-HardDisk and its parameter -CapacityGB)
That get you there?
Thanks for inpu, let me try this.