Что делает данный код 


#Номер сервера монотонно увеличивается, используется для генерации ip
$HOST_NUMBER = "5"
#Интерфейс, подключенный в core-01
$LINK1 = Get-NetAdapter -InterfaceDescription "Intel(R) Ethernet Converged Network Adapter X710"
#Интерфейс, подключенный в core-02
$LINK2 = Get-NetAdapter -InterfaceDescription "Intel(R) Ethernet Converged Network Adapter X710-2"
Set-NetAdapterRss $LINK1.Name -BaseProcessorNumber 34 -MaxProcessorNumber 46 -NumaNode 2
Set-NetAdapterRss $LINK2.Name -BaseProcessorNumber 50 -MaxProcessorNumber 62 -NumaNode 2
$RAIDIX_ISCSI_PATH1_NETWORK = "10.118.54"
$RAIDIX_ISCSI_PATH2_NETWORK = "10.119.78"
$NAS_ISCSI_PATH1_NETWORK = "10.197.35"
$NAS_ISCSI_PATH2_NETWORK = "10.198.47"

$RAIDIX_ISCSI_PATH1_TARGET = $RAIDIX_ISCSI_PATH1_NETWORK+'.'+'1'
$RAIDIX_ISCSI_PATH2_TARGET = $RAIDIX_ISCSI_PATH2_NETWORK+'.'+'1'
$RAIDIX_ISCSI_PATH1_ADDRESS = $RAIDIX_ISCSI_PATH1_NETWORK+'.'+$HOST_NUMBER
$RAIDIX_ISCSI_PATH2_ADDRESS = $RAIDIX_ISCSI_PATH2_NETWORK+'.'+$HOST_NUMBER
$NAS_ISCSI_PATH1_TARGET = $NAS_ISCSI_PATH1_NETWORK+'.'+'1'
$NAS_ISCSI_PATH2_TARGET = $NAS_ISCSI_PATH2_NETWORK+'.'+'1'
$NAS_ISCSI_PATH1_ADDRESS = $NAS_ISCSI_PATH1_NETWORK+'.'+$HOST_NUMBER
$NAS_ISCSI_PATH2_ADDRESS = $NAS_ISCSI_PATH2_NETWORK+'.'+$HOST_NUMBER
$CLUSTER_SHARED_VOLUME_NETWORK_ADDRESS = "10.97.168"+'.'+$HOST_NUMBER
$LIVE_MIGRATION_NETWORK_ADDRESS = "10.201.76"+'.'+$HOST_NUMBER
$LINKS = Get-NetAdapter | ? InterfaceDescription -Like "*Converged Network Adapter*"
$LINKS | ForEach-Object {
        Set-NetAdapterAdvancedProperty -Name $_.Name -DisplayName "Jumbo Packet" -RegistryValue 9014
        Set-NetAdapterAdvancedProperty -Name $_.Name -DisplayName "Receive Buffers" -RegistryValue 4096
        Set-NetAdapterAdvancedProperty -Name $_.Name -DisplayName "Transmit Buffers" -RegistryValue 4096
        Set-NetAdapterAdvancedProperty -Name $_.Name -DisplayName "RSS load balancing profile" -RegistryValue 4
        }
##Link for iscsi path 1 to lg-nas-01
#Add-VMNetworkAdapter -Name nas01-path1 -SwitchName LAN -ManagementOS
#Set-VMNetworkAdapterTeamMapping -VMNetworkAdapterName nas01-path1 -ManagementOS -PhysicalNetAdapterName $LINK1.Name; sleep 5
#Set-VMNetworkAdapter -Name nas01-path1 -ManagementOS -VrssEnabled $true -VmmqEnabled $true -VmmqQueuePairs 8; sleep 5
#Set-VMNetworkAdapterVlan -VMNetworkAdapterName nas01-path1 -ManagementOS -Access -VlanId 501
#$(Get-NetAdapter | ? name -Like *nas01-path1*) | ForEach-Object {
#                New-NetIPAddress -InterfaceIndex $_.ifIndex -IPAddress $NAS_ISCSI_PATH1_ADDRESS -PrefixLength 24
#                New-IscsiTargetPortal -TargetPortalAddress $NAS_ISCSI_PATH1_TARGET -TargetPortalPortNumber 3260 -InitiatorPortalAddress $NAS_ISCSI_PATH1_ADDRESS; sleep 5
#                Get-IscsiTarget | Connect-IscsiTarget -InitiatorPortalAddress $NAS_ISCSI_PATH1_ADDRESS -TargetPortalAddress $NAS_ISCSI_PATH1_TARGET -IsMultipathEnabled $true -IsPersistent $true; sleep 5
#}
##Link for iscsi path 2 to lg-nas-01
#Add-VMNetworkAdapter -Name nas01-path2 -SwitchName LAN -ManagementOS
#Set-VMNetworkAdapterTeamMapping -VMNetworkAdapterName nas01-path2 -ManagementOS -PhysicalNetAdapterName $LINK2.Name; sleep 5
#Set-VMNetworkAdapter -Name nas01-path2 -ManagementOS -VrssEnabled $true -VmmqEnabled $true -VmmqQueuePairs 8; sleep 5
#Set-VMNetworkAdapterVlan -VMNetworkAdapterName nas01-path2 -ManagementOS -Access -VlanId 502
#$(Get-NetAdapter | ? name -Like *nas01-path2*) | ForEach-Object {
#                New-NetIPAddress -InterfaceIndex $_.ifIndex -IPAddress $NAS_ISCSI_PATH2_ADDRESS -PrefixLength 24;
#                New-IscsiTargetPortal -TargetPortalAddress $NAS_ISCSI_PATH2_TARGET -TargetPortalPortNumber 3260 -InitiatorPortalAddress $NAS_ISCSI_PATH2_ADDRESS; sleep 5
#                Get-IscsiTarget | Connect-IscsiTarget -InitiatorPortalAddress $NAS_ISCSI_PATH2_ADDRESS -TargetPortalAddress $NAS_ISCSI_PATH2_TARGET -IsMultipathEnabled $true -IsPersistent $true; sleep 5
#}
#Link for iscsi path 1 raidix
Add-VMNetworkAdapter -Name nas04-path1 -SwitchName LAN -ManagementOS
Set-VMNetworkAdapterTeamMapping -VMNetworkAdapterName nas04-path1 -ManagementOS -PhysicalNetAdapterName $LINK1.Name; sleep 5
Set-VMNetworkAdapter -Name nas04-path1 -ManagementOS -VrssEnabled $true -VmmqEnabled $true -VmmqQueuePairs 8; sleep 5
Set-VMNetworkAdapterVlan -VMNetworkAdapterName nas04-path1 -ManagementOS -Access -VlanId 511
$(Get-NetAdapter | ? name -Like *nas04-path1*) | ForEach-Object {
                New-NetIPAddress -InterfaceIndex $_.ifIndex -IPAddress $RAIDIX_ISCSI_PATH1_ADDRESS -PrefixLength 24; sleep 10
                New-IscsiTargetPortal -TargetPortalAddress $RAIDIX_ISCSI_PATH1_TARGET -TargetPortalPortNumber 3260 -InitiatorPortalAddress $RAIDIX_ISCSI_PATH1_ADDRESS; sleep 10
                Get-IscsiTarget | Connect-IscsiTarget -InitiatorPortalAddress $RAIDIX_ISCSI_PATH1_ADDRESS -TargetPortalAddress $RAIDIX_ISCSI_PATH1_TARGET -IsMultipathEnabled $true -IsPersistent $true; sleep 10
}
#Link for iscsi path 2 raidix
Add-VMNetworkAdapter -Name nas04-path2 -SwitchName LAN -ManagementOS
Set-VMNetworkAdapterTeamMapping -VMNetworkAdapterName nas04-path2 -ManagementOS -PhysicalNetAdapterName $LINK1.Name; sleep 5
Set-VMNetworkAdapter -Name nas04-path2 -ManagementOS -VrssEnabled $true -VmmqEnabled $true -VmmqQueuePairs 8; sleep 5
Set-VMNetworkAdapterVlan -VMNetworkAdapterName nas04-path2 -ManagementOS -Access -VlanId 512
$(Get-NetAdapter | ? name -Like *nas04-path2*) | ForEach-Object {
                New-NetIPAddress -InterfaceIndex $_.ifIndex -IPAddress $RAIDIX_ISCSI_PATH2_ADDRESS -PrefixLength 24; sleep 10
                New-IscsiTargetPortal -TargetPortalAddress $RAIDIX_ISCSI_PATH2_TARGET -TargetPortalPortNumber 3260 -InitiatorPortalAddress $RAIDIX_ISCSI_PATH2_ADDRESS; sleep 10
                Get-IscsiTarget | Connect-IscsiTarget -InitiatorPortalAddress $RAIDIX_ISCSI_PATH2_ADDRESS -TargetPortalAddress $RAIDIX_ISCSI_PATH2_TARGET -IsMultipathEnabled $true -IsPersistent $true; sleep 10
}
#Link for csv
Add-VMNetworkAdapter -Name csv-network -SwitchName LAN -ManagementOS
Set-VMNetworkAdapter -Name csv-network -ManagementOS -VrssEnabled $true -VmmqEnabled $true -VmmqQueuePairs 8; sleep 5
Set-VMNetworkAdapterVlan -VMNetworkAdapterName csv-network -ManagementOS -Access -VlanId 512
$(Get-NetAdapter | ? name -Like *csv-network*) | ForEach-Object {
                New-NetIPAddress -InterfaceIndex $_.ifIndex -IPAddress $CLUSTER_SHARED_VOLUME_NETWORK_ADDRESS -PrefixLength 24
                Set-NetAdapterAdvancedProperty -Name $_.Name -DisplayName "Jumbo Packet" -RegistryValue 9014
}
#Link for live migration
Add-VMNetworkAdapter -Name liveMigration-network -SwitchName LAN -ManagementOS
Set-VMNetworkAdapter -Name liveMigration-network -ManagementOS -VrssEnabled $true -VmmqEnabled $true -VmmqQueuePairs 8; sleep 5
Set-VMNetworkAdapterVlan -VMNetworkAdapterName liveMigration-network -ManagementOS -Access -VlanId 512
$(Get-NetAdapter | ? name -Like *liveMigration-network*) | ForEach-Object {
                New-NetIPAddress -InterfaceIndex $_.ifIndex -IPAddress $LIVE_MIGRATION_NETWORK_ADDRESS -PrefixLength 24
                Set-NetAdapterAdvancedProperty -Name $_.Name -DisplayName "Jumbo Packet" -RegistryValue 9014
}
$(Get-NetAdapter | ? name -Like *nas*) | ForEach-Object{
                Set-NetAdapterAdvancedProperty -Name $_.Name -DisplayName "Jumbo Packet" -RegistryValue 9014
}

$LINKS | ForEach-Object {
            Restart-NetAdapter $_.Name
}

#Enable-MSDSMAutomaticClaim -BusType "iSCSI"