This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
virtualization:microsoft:hyper-v-nic [2013/08/07 15:14] gcooper |
virtualization:microsoft:hyper-v-nic [2014/07/08 12:04] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Configuring Hyper-V Network Interfaces ====== | + | ====== Configuring Hyper-V Network Interfaces |
+ | |||
+ | See also **[[networking: | ||
http:// | http:// | ||
+ | |||
+ | ===== Converged Networking ===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | http:// | ||
+ | |||
+ | In Windows Server 2008 a host with local storage would require the following NICs as a // | ||
+ | |||
+ | - Parent (Management) | ||
+ | - VM (for the Virtual Network, prior to the Virtual Switch) | ||
+ | - Cluster Communications/ | ||
+ | - Live Migration | ||
+ | |||
+ | As the number of NICs proliferate: | ||
+ | |||
+ | - The number/cost of NICs go up | ||
+ | - The number/cost of switch ports goes up | ||
+ | - The wasted rack space cost goes up | ||
+ | - The power bill goes up | ||
+ | - The support cost for your network goes up | ||
+ | - The complexity goes up | ||
+ | |||
+ | ===== Basic Steps for Identical Hardware ===== | ||
+ | |||
+ | - Rename the NICs of the first host | ||
+ | - Run the '' | ||
+ | - Edit the '' | ||
+ | - Run the '' | ||
+ | - Do this for all Hyper-V Hosts | ||
===== Possible Hyper-V NIC Names ===== | ===== Possible Hyper-V NIC Names ===== | ||
+ | |||
+ | With four NICs: | ||
* Management | * Management | ||
- | * VMNet | + | * GuestPublic |
- | * CSV | + | * BlockStorage |
- | * LiveMigration | + | * FileStorage |
- | * iSCSI01 | + | |
- | * iSCSI02 | + | |
===== Rename a NIC ===== | ===== Rename a NIC ===== | ||
Line 17: | Line 49: | ||
netsh interface set interface "Local Area Connection 2" newname=" | netsh interface set interface "Local Area Connection 2" newname=" | ||
</ | </ | ||
- | |||
- | |||
===== Get-NICInformation.ps1 ===== | ===== Get-NICInformation.ps1 ===== | ||
Line 43: | Line 73: | ||
#endregion | #endregion | ||
- | $adapters = Get-WMIObject Win32_PNPSignedDriver | Where-Object { $_.DeviceClass -eq “NET” -and $_.HardWareID -like “*PCI*” } | Sort-Object location | + | $adapters = Get-WMIObject Win32_PNPSignedDriver | Where-Object { $_.DeviceClass -eq "NET" |
| | ||
foreach ($adapter in $adapters ) { | foreach ($adapter in $adapters ) { | ||
Line 63: | Line 93: | ||
| | ||
} | } | ||
+ | </ | ||
+ | |||
+ | ===== Set-IPAddressFromXML.ps1 ===== | ||
+ | |||
+ | < | ||
+ | # ---------------------------------------------------------------------------------------------- # | ||
+ | # Powershell Set-IPAddressfromXML $Rev: 748 $ | ||
+ | # (c) 2011 Thomas Maurer. All rights reserved. | ||
+ | # created by Thomas Maurer | ||
+ | # www.thomasmaurer.ch | ||
+ | # www.itnetx.ch | ||
+ | # last Update by $Author: tmaurer $ on $Date: 2012-02-24 14:07:36 +0100 (Fr, 24 Feb 2012) $ | ||
+ | # ---------------------------------------------------------------------------------------------- # | ||
+ | |||
+ | #region [INFO BLOCK] | ||
+ | # INFO | ||
+ | Write-Host " | ||
+ | Write-Host " PowerShell Set-IPAddressfromXML " -BackgroundColor Black -ForegroundColor White | ||
+ | Write-Host " | ||
+ | Write-Host " | ||
+ | Write-Host " | ||
+ | Write-Host " | ||
+ | #endregion | ||
+ | |||
+ | #region [CONFIG BLOCK] | ||
+ | # Get XML Information | ||
+ | [Xml]$global: | ||
+ | # Set NIC number starting value | ||
+ | [int]$global: | ||
+ | #endregion | ||
+ | |||
+ | #region [MAIN BLOCK] | ||
+ | #Get NIC list | ||
+ | $Adapters = Get-WMIObject Win32_PNPSignedDriver | where { $_.DeviceClass -eq " | ||
+ | | ||
+ | foreach ($Adapter in $Adapters ) { | ||
+ | # Get Adapter Info | ||
+ | $AdapterName = Get-WMIObject Win32_NetworkAdapter | where { $_.PNPDeviceID -eq $Adapter.DeviceID } | ||
+ | $nic = $xmlData.config.networkadapters.nic | Where-Object {$_.id -eq $nicNumber} | ||
+ | |||
+ | # Write NIC Info | ||
+ | Write-Host ‘Adapter Name :’ $AdapterName.NetConnectionID | ||
+ | Write-Host ‘PCI BUS :’ $Adapter.Location | ||
+ | Write-Host ‘MAC Address :’ $AdapterName.MACAddress | ||
+ | Write-Host ‘GUID :’ $AdapterName.GUID | ||
+ | Write-Host ‘New Name : | ||
+ | Write-Host | ||
+ | |||
+ | # Change NIC Name | ||
+ | Invoke-Expression (' | ||
+ | Write-Host (' | ||
+ | |||
+ | # if true set IP Address | ||
+ | if ($nic.static -eq " | ||
+ | Invoke-Expression (' | ||
+ | Write-Host (' | ||
+ | } | ||
+ | else { | ||
+ | Write-Host "No IP set" -BackgroundColor Green -ForegroundColor Black | ||
+ | } | ||
+ | |||
+ | # Count +1 for next Adapter | ||
+ | $nicNumber++ | ||
+ | } | ||
+ | #endregion | ||
+ | </ | ||
+ | |||
+ | ===== networkconfig.xml ===== | ||
+ | |||
+ | < | ||
+ | <?xml version=" | ||
+ | < | ||
+ | < | ||
+ | <nic id=" | ||
+ | <nic id=" | ||
+ | <nic id=" | ||
+ | <nic id=" | ||
+ | </ | ||
+ | </ | ||
</ | </ |