DSCResources/DSC_VMSwitch/en-US/about_VMSwitch.help.txt
.NAME
VMSwitch .DESCRIPTION Manages virtual switches in a Hyper-V host. ## Requirements * The Hyper-V Role has to be installed on the machine. * The Hyper-V PowerShell module has to be installed on the machine. .PARAMETER Name Key - String The desired VM Switch name. .PARAMETER Type Key - String Allowed values: External, Internal, Private The desired type of switch. .PARAMETER NetAdapterName Write - StringArray Network adapter name(s) for external switch type. .PARAMETER AllowManagementOS Write - Boolean Specify if the VM host has access to the physical NIC. The default value is $false. .PARAMETER EnableEmbeddedTeaming Write - Boolean Should embedded NIC teaming be used (Windows Server 2016 or higher only). The default value is $false. .PARAMETER BandwidthReservationMode Write - String Allowed values: Default, Weight, Absolute, None, NA Specify the QoS mode used (options other than NA are only supported on Hyper-V 2012 or higher). The default value is NA. .PARAMETER LoadBalancingAlgorithm Write - String Allowed values: Dynamic, HyperVPort Specify the Load Balancing algorithm which should be used for the embedded NIC teaming. .PARAMETER Ensure Write - String Allowed values: Present, Absent Ensures that the VM Switch is Present or Absent. The default value is Present. .PARAMETER Id Write - String Specify the desired Unique ID of the Hyper-V switch. If not specified the ID will be generated by the system every time the Hyper-V Switch is created. (Windows Server 2016 or higher only) .PARAMETER NetAdapterInterfaceDescription Read - String Returns the description of the network interface. .EXAMPLE 1 Creates a switch of the type External. configuration Example { param ( [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [System.String] $SwitchName, [Parameter(Mandatory = $true)] [System.String] $NetAdapterName ) Import-DscResource -ModuleName 'HyperVDsc' Node $NodeName { # Install HyperV feature, if not installed - Server SKU only WindowsFeature HyperV { Ensure = 'Present' Name = 'Hyper-V' } # Ensures a VM with default settings VMSwitch ExternalSwitch { Ensure = 'Present' Name = $SwitchName Type = 'External' NetAdapterName = $NetAdapterName DependsOn = '[WindowsFeature]HyperV' } } } .EXAMPLE 2 Creates a switch that is of type External and using load balancing. Configuration Example { param ( [Parameter()] [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [System.String] $SwitchName, [Parameter(Mandatory = $true)] [System.String[]] $NetAdapterNames ) Import-DscResource -ModuleName 'HyperVDsc' Node $NodeName { # Install HyperV feature, if not installed - Server SKU only WindowsFeature HyperV { Ensure = 'Present' Name = 'Hyper-V' } WindowsFeature HyperVTools { Ensure = 'Present' Name = 'RSAT-Hyper-V-Tools' DependsOn = '[WindowsFeature]HyperV' } # Ensures a VM with Load Balancing Algorithm 'Hyper-V Port" VMSwitch ExternalSwitch { Ensure = 'Present' Name = $SwitchName Type = 'External' NetAdapterName = $NetAdapterNames EnableEmbeddedTeaming = $true LoadBalancingAlgorithm = 'HyperVPort' DependsOn = '[WindowsFeature]HyperVTools' } } } .EXAMPLE 3 Creates a switch of the type External and uses embedded teaming. Configuration Example { param ( [Parameter()] [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [System.String] $SwitchName, [Parameter(Mandatory = $true)] [System.String[]] $NetAdapterNames ) Import-DscResource -ModuleName 'HyperVDsc' Node $NodeName { # Install HyperV feature, if not installed - Server SKU only WindowsFeature HyperV { Ensure = 'Present' Name = 'Hyper-V' } WindowsFeature HyperVTools { Ensure = 'Present' Name = 'RSAT-Hyper-V-Tools' DependsOn = '[WindowsFeature]HyperV' } # Ensures a VM with default settings VMSwitch ExternalSwitch { Ensure = 'Present' Name = $SwitchName Type = 'External' NetAdapterName = $NetAdapterNames EnableEmbeddedTeaming = $true DependsOn = '[WindowsFeature]HyperVTools' } } } .EXAMPLE 4 Creates a switch of the type Internal. configuration Example { param ( [System.String[]] $NodeName = 'localhost', [Parameter(Mandatory = $true)] [System.String] $SwitchName ) Import-DscResource -ModuleName 'HyperVDsc' Node $NodeName { # Install HyperV feature, if not installed - Server SKU only WindowsFeature HyperV { Ensure = 'Present' Name = 'Hyper-V' } # Ensures a VM with default settings VMSwitch InternalSwitch { Ensure = 'Present' Name = $SwitchName Type = 'Internal' DependsOn = '[WindowsFeature]HyperV' } } } |