In an earlier article, I had introduced DSC resources that can be used to deploy a Hyper-V converged virtual network. In this series of articles, we will build the converged network configuration for what is shown below.
Here is a recap of configuration needed.
- Create a host network team.
- Create a VM switch using the host team.
- Create host VM adapters in the management OS to connect to the VM switch and assign VLANs and bandwidth settings.
- Assign IP addresses and DNS addresses, as required (today’s article)
In the earlier articles, we created a network team named HostTeam, deployed a VM switch using that network team, and finally created a few VM network adapters and configured bandwidth and VLAN settings on them. In today’s article, we will see how to assign IP addresses to these virtual network adapters.
To complete this task, we need the xIPAddress and xDnsServerAddress DSC resources from the xNetworking module in the DSC resource kit.
In the scenario that we are working on, we need static IP addresses assigned to each of the adapters in the management OS. Also, the host management adapter requires DNS server address so that we can use that network connection to Active Directory and other infrastructure services.
Here is the configuration that I pushed to the Hyper-V server to configure IP addresses for each of the network adapters in the management OS.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| xIPAddress MgmtAddress
{
IPAddress = "100.194.14.114"
InterfaceAlias = "vEthernet (HostSwitch)"
SubnetMask = 23
DefaultGateway = '100.194.14.1'
AddressFamily = "IPV4"
}
xDNSServerAddress MgmtDNS {
InterfaceAlias = 'vEthernet (HostSwitch)'
Address = '100.194.14.87'
AddressFamily = 'IPV4'
}
xIPAddress ClusterAddress
{
IPAddress = "172.168.1.114"
InterfaceAlias = "vEthernet (HostCluster)"
SubnetMask = 16
AddressFamily = "IPV4"
}
xIPAddress LMAddress
{
IPAddress = "192.168.1.114"
InterfaceAlias = "vEthernet (HostLiveMigration)"
SubnetMask = 24
AddressFamily = "IPV4"
}
|
This completes the configuration of IP addresses and DNS addresses for the network adapters. The host management adapter needs the gateway and DNS server addresses. We don’t have to configure those settings for the cluster and live migration networks.
Make note of the value provided for the InterfaceAlias property. This is not just the network adapter name we used so far but the name of the adapter as you see in network connections. For example, vEthernet (HostSwitch) should be the interface alias for the HostSwitch adapter.
The following snippet provides the complete resource configuration for creating Hyper-V converged virtual network.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
| Configuration DemoNetworkTeam {
Import-DscResource -Module cWindowsOS -Name cNetworkTeam
Import-DscResource -Module cHyper-V -Name cVMSwitch, cVMNetworkAdapter, cVMNetworkAdapterSettings, cVMNetworkAdapterVlan
Import-DscResource -Module xNetworking -Name MSFT_xIPAddress, MSFT_xDNSServerAddress
Node Localhost {
cNetworkTeam NetworkTeam {
Name = 'HostTeam'
TeamingMode = 'SwitchIndependent'
LoadBalancingAlgorithm = 'HyperVPort'
TeamMembers = 'NIC1','NIC2'
Ensure = 'Present'
}
cVMSwitch HostSwitch {
Name = 'HostSwitch'
Type = 'External'
AllowManagementOS = $true
MinimumBandwidthMode = 'Weight'
NetAdapterName = 'HostTeam'
Ensure = 'Present'
DependsOn = '[cNetworkTeam]NetworkTeam'
}
cVMNetworkAdapterSettings HostSwitchSettings {
Name = 'HostSwitch'
SwitchName = 'HostSwitch'
ManagementOS = $true
MinimumBandwidthWeight = 10
DependsOn = '[cVMSwitch]HostSwitch'
}
cVMNetworkAdapterVlan HostSwitchVlan {
Name = 'HostSwitch'
ManagementOS = $true
AdapterMode = 'Access'
VlanId = 10
DependsOn = '[cVMSwitch]HostSwitch'
}
cVMNetworkAdapter HostCluster {
Name = 'HostCluster'
SwitchName = 'HostSwitch'
ManagementOS = $true
Ensure = 'Present'
DependsOn = '[cVMSwitch]HostSwitch'
}
cVMNetworkAdapterSettings HostClusterSettings {
Name = 'HostCluster'
SwitchName = 'HostSwitch'
ManagementOS = $true
MinimumBandwidthWeight = 20
DependsOn = '[cVMSwitch]HostSwitch','[cVMNetworkAdapter]HostCluster'
}
cVMNetworkAdapterVlan HostClusterVlan {
Name = 'HostCluster'
ManagementOS = $true
AdapterMode = 'Access'
VlanId = 20
DependsOn = '[cVMSwitch]HostSwitch','[cVMNetworkAdapter]HostCluster'
}
cVMNetworkAdapter HostLiveMigration {
Name = 'HostLiveMigration'
SwitchName = 'HostSwitch'
ManagementOS = $true
Ensure = 'Present'
DependsOn = '[cVMSwitch]HostSwitch'
}
cVMNetworkAdapterSettings HostLiveMigrationSettings {
Name = 'HostLiveMigration'
SwitchName = 'HostSwitch'
ManagementOS = $true
MinimumBandwidthWeight = 30
DependsOn = '[cVMSwitch]HostSwitch','[cVMNetworkAdapter]HostLiveMigration'
}
cVMNetworkAdapterVlan HostLiveMigrationVlan {
Name = 'HostLiveMigration'
ManagementOS = $true
AdapterMode = 'Access'
VlanId = 30
DependsOn = '[cVMSwitch]HostSwitch','[cVMNetworkAdapter]HostLiveMigration'
}
xIPAddress MgmtAddress
{
IPAddress = "100.194.14.114"
InterfaceAlias = "vEthernet (HostSwitch)"
SubnetMask = 23
DefaultGateway = '100.194.14.1'
AddressFamily = "IPV4"
}
xDNSServerAddress MgmtDNS {
InterfaceAlias = 'vEthernet (HostSwitch)'
Address = '100.194.14.87'
AddressFamily = 'IPV4'
}
xIPAddress ClusterAddress
{
IPAddress = "172.168.1.114"
InterfaceAlias = "vEthernet (HostCluster)"
SubnetMask = 16
AddressFamily = "IPV4"
}
xIPAddress LMAddress
{
IPAddress = "192.168.1.114"
InterfaceAlias = "vEthernet (HostLiveMigration)"
SubnetMask = 24
AddressFamily = "IPV4"
}
}
}
DemoNetworkTeam
|
This brings us to the end of this series of articles on using DSC for creating Hyper-V converged virtual network. If you have any feedback or see any issues with the DSC resource modules, feel free to create a discussion or issue on Github. I will be more than happy to help you and make these resource modules better.
Share on: