Hyper-V Network Virtualization Cookbook by Ryan Boud
Author:Ryan Boud [Boud, Ryan]
Language: eng
Format: epub, pdf
Publisher: Packt Publishing
Published: 2014-11-27T22:00:00+00:00
It is important to know which network adapter is connected to which network interface. In the wizard, there are the following three Ethernet adapters listed at the moment:Ethernet2
Ethernet3
Ethernet4
None of these are particularly useful. The following PowerShell script will obtain all the information about the gateway VM from VMM, determine the VM Networks each NIC is attached to and rename the NIC in the VM with the appropriate name. The code is as follows:
#Hashtable of VM Networks and the names the NICs should be inside the Gateway VM $NicNames =@{ "Host-Management" ="Management"; "External (NAT)" ="External"; "" ="TenantNetworks" } #Get the VM from VMM, not from Hyper-V $GatewayVM = Get-SCVirtualMachine -Name HNVGateway1 #Iterate through each entry in the Hashtable ForEach($Key in $NicNames.Keys){ #Find the Network Adapter's MAC Address in VMM that is connected to #the VM Network. As the Tenant Network Adapter is not attached to a #VM Network it must be dealt with carefully $VNAMacAddress = ($GatewayVM.VirtualNetworkAdapters | Where-Object{ #Check for an actual value if($_.VMNetwork.Name){ if($_.VMNetwork.Name -eq $key){ $True } } #check for the Tenant NIC elseif(!($_.VMNetwork.Name) -and !($key)){ $True } }).MACAddress Invoke-Command -ComputerName $GatewayVM.ComputerName -ScriptBlock { Param($LocalMacAddress, $NewNicName) #Change the format of the MAC Address $LocalMacAddress = $LocalMacAddress -replace ":","-" #Find the NIC based on the MAC address obtained from VMM $NIC = Get-NetAdapter | Where-Object { $_.MacAddress -eq $LocalMacAddress} #Get the WMI object based on the NIC's current name $wmi = Get-WmiObject -Class Win32_NetworkAdapter -Filter "NetConnectionID = ""$($NIC.Name)""" #Change the NIC's name to the correct name $wmi.NetConnectionID = $NewNicName $wmi.Put() } -ArgumentList $VNAMacAddress,$NicNames.Item($Key) }
Download
Hyper-V Network Virtualization Cookbook by Ryan Boud.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
The Mikado Method by Ola Ellnestam Daniel Brolund(23444)
Hello! Python by Anthony Briggs(22581)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(21371)
Kotlin in Action by Dmitry Jemerov(20427)
Dependency Injection in .NET by Mark Seemann(20380)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(20264)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(19440)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(18250)
Grails in Action by Glen Smith Peter Ledbrook(17374)
Adobe Camera Raw For Digital Photographers Only by Rob Sheppard(16969)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(14803)
Secrets of the JavaScript Ninja by John Resig & Bear Bibeault(12769)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(11207)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10598)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(10438)
Hit Refresh by Satya Nadella(9128)
The Kubernetes Operator Framework Book by Michael Dame(8543)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8370)
Robo-Advisor with Python by Aki Ranin(8314)