A set of sample scripts that use PowerShell DSC for configuring Hyper-V hosts and Scale-Out File Servers. Can be used with Storage Spaces Direct or any other back-end storage. In general, these scripts are primarily useful when using SMB for storage, or when setting up a hyper-converged cluster with Storage Spaces Direct. They can be used with Hyper-V hosts using traditional iSCSI/Fibre Channel storage, but most of the settings won't be applicable. Only Windows Server 2016 and Windows Server 2019 are supported.
Currently this is a work in progress and the scripts are not complete!
These scripts are only for configuring individual hosts. To build a failover cluster, use these scripts to configure the hosts and then create the cluster with PowerShell or Failover Cluster Manager.
Deploying a set of hosts with these scripts is done in the following steps
This is the only file that should need to be modified. This contains all the settings specific to each environment.
AllNodes = @(
@{
NodeName = 'name'
The Node name is the operating system name of the server
Role = 'Role1', 'Role2'
Config = 'ConfigSetName'
Required The config name should match a name in the ConfigSet section (see below)
NIC_n_Name = 'NIC n Name'
Optional The NetAdapterName for each NIC. If the name is not specified here, the default name in the ConfigSet will be used insetad. For Hyper-V, these NICs are added to the Virtual Switch Embedded Team. For SOFS, these NICs are part of the management LBFO team.
NIC_n_MacAddr = 'NIC n Mac Address'
Required. Specify the MAC Address of each NIC
SMB_NIC_n_Name = 'SMB NIC Name'
Physical NICs only. Optional Specify the name of the storage NIC. For virtual NICs, do not override the virtual NIC name.
SMB_NIC_n_MacAddr = 'SMB NIC Mac addr'
Physical NICs only. Required Specify the MAC Address of the storage NIC
SMB_NIC_n_IP = 'IP Address/Size'
Required Specify the Storage NIC's IP address and subnet mask size. For example, if it's a class C (255.255.255.0), use /24 for the size.
HostIP = 'IP Address/Size'
Required Specify the management IP address of the server.
OS = '2019'
Required Use either 2016 or 2019 for this to distinguish whether the server is running Windows Server 2016 or Windows Server 2019. No other values are supported.
} )
ConfigSet = @(
@{
ConfigName = 'Name'
The name of the configuration set. This must match the name used at the node level above.
TimeZone = 'Time Zone Name'
The Time Zone for this configuration. For a list of possible names, run "Get-TimeZone -ListAvailable" in a PowerShell Window
SCVMMSiteName = 'Site Name'
The name of the Host Group in SCVMM that Hyper-V hosts should be added to.
SCVMMUplinkName = 'Uplink Name'
The name of the Uplink Port Group in SCVMM that the logical switch uses.
HyperVSwitchName = 'Virtual Switch Name'
The name of the VMSwitch in Hyper-V/SCVMM
HyperVHostVNicName = 'vNIC Name'
The name of the management NIC name in SCVMM. Note that the host will use the virtual switch name.
PowerPlan = 'High performance'
The Power Plan should normally be set to 'High performance', but in a power-constrained environment, it might make sense to use 'Balanced' instead.
HostVLAN = 123
The public VLAN the Hyper-V and SOFS management interface uses. Set to 0 if using an access port/default VLAN.
SRIOV = $false
Whether or not the virtual switch will have SR-IOV enabled.
JumboFrames = $true
Whether or not the physical switches support Jumbo Frames.
EnableDCB = $true
Whether or not to enable Data Center Bridging/Priority Flow Control on the storage networks.
DNS_IP_1 = 'IP address' DNS_IP_2 = 'IP address
The IP addresses for the DNS servers the servers will use.
NIC_COUNT = 2
The number of NICs. Typically this would be 2.
NIC_n_Type = 'Type'
The type of NIC used.
NIC_n_DefaultName = 'Name'
The default name to use for this NIC if it's not specified at the node-level
Has_Virtual_SMB_Nic = $false/$true
Set to true if there is at least one virtual storage NIC
SMB_NIC_COUNT = 2
The number of storage NICs. Set to 0 if not using SMB traffic, such as on a standalone Hyper-V host, or a cluster with SAN storage
SMB_NIC_n_Type = 'Type'
Set to 'Virtual' if using converged networking with virtual storage NICs, otherwise use a value from the supported NIC Types above
SMB_NIC_n_VLAN = 123
The VLAN ID for the storage NIC. Set to 0 for default VLAN/access port. When using DCB/PFC, a VLAN is required.
SMB_NIC_n_Mode = 'Mode'
The SMB mode for this NIC
SMB_NIC_n_DefaultName = 'Name'
The default name of the storage NIC. For virtual NICs use "vEthernet (Name)"
SMB_LiveMig_BW_Limit = Number
Optionally specify the SMB Bandwdith Limit for Live Migration
SOFS_NetLbfoTeamName
The name of the Lbfo Team for the SOFS management interface. Can be omitted if there are no SOFS clusters using this configuration.
SOFS_NetLbfoTeamMode
The Lbfo Teaming mode for the SOFS management interface. Either Lacp or SwitchIndependent.
} )
This contains all of the DSC settings. Additional information regarding the actual settings will be added to this README later.
Simple script to compile the DSC configuration, useful for automation with something like Azure Pipelines.
Script to run Test-DscConfiguration and format the output.
Script to run Start-DscConfiguration
These scripts will download the required DSC Modules from the PowerShell Gallery.
This script will do the initial configuration on the host that is needed prior to applying the DSC configuration.
This script will install the SCVMM Agent to the host
This script will deploy the virtual switch to the host from SCVMM