Guest blog by Mark Scholman
I have been working on a new script project to configure Hyper-V hosts. Every time I deploy new Hyper-V servers in a new customer environment, there are many things that require configuration. Also little things that are easily forgotten. Let’s see how we can automate that process. Of course I realize that Bare Metal Deployment is an available functionality in VMM. But with the chicken and egg story or customers who cannot use Bare Metal Deployment, I decided to create this tool. It is using the converged network setup as described in this blog post. What it does is the following:
- Rename Adapters
- Create Teams
- Create Team Nics (tNics)
- Set Network Configuration (MGT,LM,CSV)
- Join Server to the Domain
- Create a server-local administrators group in the domain
- Allows you to create a new or join an existing cluster
- Configure Cluster network names
- Configure Cluster Live Migration subnet
On the to-do list is the following and will be added with upcoming releases:
- Configure Storage network (iSCSI & SMB3)
- Use of different topologies for converged networking as described here
- Using JEA (Just Enough Admin) or PSCustomSessionConfiguration for deployment of Hyper-V hosts
How to use the toolkit
Download the latest version from the Technet Gallery. If you feel like to help me optimize and extend the tool fork it on github.
On the newly provisioned Hyper-V Server start the Deploy-HyperVHost.ps1. On the Configure Nic’s tab select the adapters you want to use for Management (MGT / LM / CSV) and click Set Management Adapters:

Notice the list box will refresh with the new names for the adapters. Next select the adapters you want to use for VM Network and click Set VMNet Adapters

Finally click Configure Storage Adapters:
[image not preserved in the archive]
Result is that we have configured all adapters now with a logical name we can use in the rest of the deployment:
[image not preserved in the archive]
Side note: I used 2 adapters for each team configuration, but you can use for example 3 adapters or 4 adapters for Management and 2 or 3 for the VMNet. The script is intelligent on using the logical names and reusing them in the Team setup.
Next part is to setup the host parameters and start the deployment of the host. Go to the tab Configure Host
We need to specify the next parameters:
| Host Name | The name of the server. |
| Domain Name | The domain to join the server to. |
| Management IP | The ip address for the management interface. |
| Management VLAN | If you’re using vlans specify the vlan id. Untagged is vlan 1. |
| Management gateway | The gateway for the management network. |
| Live Migration IP | The ip address for live migration (LM) communication |
| Live Migration VLAN | The VLAN id used for the LM network. |
| CSV IP | Cluster IP Address. |
| CSV VLAN | Cluster VLAN ID. |
| Primary DNS | The Primary DNS server to use for management network. |
| Secondary DNS (optional) | If applicable: The second DNS server for the management network. |
| Domain Controller Name | The Name of a Domain Controller. (needs remote PowerShell enabled) |
| Local Admin Group Name (optional) | Name of a Domain group what is configured to be Local Administrator on the host |
| Group OU Path (optional) | The OU DN where the group needs to be created. |
| LAB: Build HyperV on HyperV | Used for demo purposes when you want to run this tool in a Hyper-V Virtual Machine. (Team settings and Hyper-V Role modification in the VM) |
[image not preserved in the archive]
Next click on the Deploy Host button and enter domain admin credentials
[image not preserved in the archive]
Now wait until the server automatically reboots. While server is rebooting you can verify that the computer is in the domain and the local group is created:
[image not preserved in the archive]
[image not preserved in the archive]
When the server is rebooted login as the domain admin and start the Deployment tool again.
The last tab is for Configure Cluster. You can create a new cluster:
[image not preserved in the archive]
Or add the node to an existing cluster:
[image not preserved in the archive]
And we are ready to install the System Center Virtual Machine Manager agent, deploy logical switches and finally place the node in Production.
Happy deploying Hyper-V hosts!