17 June 2008

Hyper-V: What are the uses for different types of virtual networks?

If you followed yesterdays post explaining the basics of networking in Hyper-V, you may be wondering what the different types of virtual networks are, when you should use them, and how they look in terms of traffic flow.

When you open Virtual Network Manager from Hyper-V Manager, there are three types of virtual network which can be created: External, Internal and Private. There is also a fourth type which can only be created through WMI and doesn’t have an official name, but I’ll call it a “Dedicated” virtual network (thanks Jake who came up with the suggestion!). Let’s look at each type, and when it is appropriate to use them.

External

External virtual networks are used where you want to allow communications between

  • Virtual machine to virtual machine on the same physical server
  • Virtual machine to parent partition (and visa-versa)
  • Virtual machine to externally located servers (and visa-versa)
  • (Optional) Parent partition to externally located servers (and visa-versa)

external  

Internal

Internal virtual networks are used where you want to allow communications between

  • Virtual machine to virtual machine on the same physical server
  • Virtual machine to parent partition (and visa-versa)

In a block diagram, an internal network is an external network without the binding to a physical NIC. An internal network would commonly be used to build a test environment where you need network connectivity into the virtual machines from the parent partition itself.

internal

Private

Private virtual networks are used where you want to allow communications between

  • Virtual machine to virtual machine on the same physical server

In a block diagram, a private network is an internal network without a virtual NIC in the parent partition. A private network would commonly be used where you need complete isolation of virtual machines from external and parent partition traffic. DMZ workloads running on a leg of a tri-homed firewall, or an isolated test domain are examples where this type of network may be useful.

private

Dedicated

Dedicated networks are in some ways one of the most useful type of virtual network where you dedicate a physical NIC for use just by virtual machines. They allow communication between:

  • Virtual machine to virtual machine on the same physical server
  • Virtual machine to externally located servers (and visa-versa)

Note that the parent partition is unable to use a dedicated virtual network for its own communication. You would normally have a second physical NIC for use by the parent partition, as was discussed yesterday. In a block diagram, a dedicated network is an external network without a virtual NIC in the parent partition.

 

dedicated

Note that you can achieve something functionally identical to a dedicated network by creating an external virtual network, and unbinding the protocols from the newly created virtual NIC in the parent partition. However, I would personally recommend you deploy a dedicated virtual network “correctly” to avoid accidental changing of bindings on the virtual NIC, or to avoid confusion as to what is present in the network adapters control panel applet. (And before you ask, I don’t have a sample script to create a dedicated virtual network yet. A post for another day).

Cheers,
John.

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Syl said:

When Hyper-V finale release come ?

19 June 08 at 5:32 AM
# jhoward said:

Syl - within 180 days of the RTM of Windows Server 2008.

Cheers,

John.

19 June 08 at 9:15 AM
# Lior Arviv's Blog said:

Getting Started with Microsoft Hyper-V Understanding Hyper-V partitions and device drivers Migrating

20 June 08 at 2:05 PM
# Virtualization said:

U zadnje vrijeme sam imao podosta obaveza pa ne stigoh osvjeziti blog novostima, stoga slijedi izvjestaj

23 June 08 at 4:38 PM
# Ewdev said:

Fantastic article John, came at just the right moment for me.  I am trying to create something like a dedicated network but was a little confused with the sentence "unbinding the Microsoft Virtual Network Switch Protocol from the virtual NIC in the parent partition".  It seems that it is the physical NIC that has the Virtual Network Switch Protocol.  Would you not simply delete the virtual NIC from the parent partition, if you can?

I shall be trying this out today as I am trying to see if I can set up a Virtual ISA2006 server.  I will report back my findings.

25 June 08 at 3:52 AM
# Ask the Core Team said:

With the RTM release of Hyper-V just around the corner, I thought it would be a good idea to re-visit

25 June 08 at 7:43 AM
# jhoward said:

Ewdev - good catch, thank you. My bad - I meant unbind the protocols (which are all except the virtual network switch protocol) from the virtual NIC in the parent partition. I'll correct the text. You won't be able to delete the virtual NIC itself (you shouldn't any way).

Thanks,

John.

25 June 08 at 10:07 AM
# Ewdev said:

Well it is all up and working now, a little painful perhaps but I now have a DC/DNS/DHCP/WINS on the host VM plus three  Windows Server 2008 x64 child VM's for SQL Server 2005, IIS7 and Exchange 2007.  All of these are attached to an External virtual network and protected by a fourth child VM running Windows Server 2003 + SP2 x86 with ISA2006 and two virtual NIC's, one on the External vrtual network and the other on a Dedicated virtual network as discussed above.  Just to re-iterate, the dedicated network was simulated by unbinding ALL protocols off the dedicated virtual NIC from the host VM so as to eliminate the problem of the host bypassing the ISA firewall.  The only cable coming out of my box at present is one attached to the Dedicated NIC which goes straight to the Internet, although there is an external physical port for additional physical machines on the internal network if wished (This is the port for the "External" virtual network where the word "External" simply means external to the physical machine). The ISA2006 edge firewall setup works a treat and this seems such an obvious setup that I wonder if the concept of the Dedicated virtual network should perhaps be in the final build for Hyper-V?

02 July 08 at 7:21 PM
# jhoward said:

Ewdev - yes, this is somethig we're looking at for a future version. Glad you got it working.

Cheers,

John.

03 July 08 at 1:10 PM
# Scott Klassen said:

So how about that script for making a dedicated type?  Failing that, could anyone here point me to step-by-step manual instructions to "deploy a dedicated virtual network “correctly”"?

Thanks.

19 July 08 at 10:21 AM
# jhoward said:

Scott - I apologise, I haven't had a chance to get round to putting it together. Published in the last few days though are some sample scripts for the WMI APIs for Hyper-V, although it will require a bit of piecing together. Specifically, you need the Msvm_VirtualSwitchManagementService class, the sample code for the methods being http://msdn.microsoft.com/en-us/library/cc723875(VS.85).aspx.

Alternately, as I mentioned in the main body of the the text, you can functionally create something identical to a dedicated network by creating an external virtual network switch in the user interface. Once created, on the new virtual NIC which is created in the parent partition, remove all bindings: Start/ncpa.cpl. Select the appropriate NIC and choose properties. De-select all bindings. The only difference between this approach and using WMI is that you have a virtual NIC instance in the parent partition. However, with no bindings applied to it, it can't be used for anything.

I will get round to the script. Just need to find some time. Sorry!

Cheers,

John.

19 July 08 at 12:43 PM
# Martin Herbener said:

John,

If I want something like a dedicated virtual network, is there any reason not to DISABLE the virtual NIC in the host as opposed to unbinding?

thanks

Martin

08 August 08 at 10:27 AM
# jhoward said:

Hi Martin - yes, this will be equivalent from a functionality perspective. Personally, I prefer the unbinding to disabling as it's harder to accidentally re-bind than it is to accidentally re-enable the NIC.

Cheers,

John.

08 August 08 at 1:28 PM
# Ben Allen said:

Hyperv Networking and Dedicated Rotable IP Addresses.

Hi Martin

Can you confirm the correct place to apply a front facing ip address for my machines. My normal process is to setup a server and assign one or more ip addresses from my /22 range.

These are usually used by me for hosting or for clients. Normally i would assign the ip addresses within the machines OS. From reading through all the published stuff its not clear to me if this is still doen within the virtual server or if its placed on the physical machine. My concern is that if its not assined within the virtual machine and then you moved it to another machine how would the ip address assigned to it move unless it was within the contents of the .vhd file?? I hope you can clear up the process for me because its delyaing me moving ahead with my testing prior to prodcution. At present i have one server running datacetre edition 2008, the parent is running ssvmm2008 beta. The proliant dl360 server has 2gb nics in it.

I look forward to your response.

21 October 08 at 11:54 AM
# jhoward said:

Ben

Treat each virtual machine like you would any other physical machine and assign the virtual NIC in the VM an appropriate IP address. That information will be stored in the operating system image contained in the VHD. The NIC instance itself though is stored in the configuration file for the VM, therefore if you move a VM from one server to another, you need to move both using the export & import function in Hyper-V Manager.

Thanks,

John.

21 October 08 at 2:57 PM
# Ben Allen said:

Hi John

Followed you advice and got it working, However now i experiencing intermitant loss of connectivity using 2 nics per server. So in desperation as it was interupting service i have reverted to a single nic on both servers and it seems stable again. The setup is as follows:

2 x HP DL360 Server, dual quad core xeon.

14GB & 10GB of memory, storage at present is local, testing for fibre channel will be done once this issue is resolved.

1 server has 4 VMS & ONE HAS 3 VMS running 2008 datacentre 64

Ok i setup the nics as follows initially 1 nic set as external & virtual switch. i assigned 195.189.12.80 to the nic on 255.255.252.0 and gateway is 195.189.12.1.

Dns set to 195.189.13.3 which is the dns running on the DC and sec dns to 195.189.12.4 which is my main public dns server.

Ok so that all seemed fine, from reading you tutorial it seemed you recommned using the second nic as the main route to internet thus allowing the 1st nic labelled external to pass that traffic to the second for ongoing routing.

So i setup the second nic with 195.189.12.84 on 255.255.252.0

Gateway set to 195.189.12.1 dns 195.189.13.2 and 195.189.12.4

I then assumed i needed to remove the gateway address from the external nic so it would route traffic for the internet via the second nic, however in my mind i wonder how redundant that is as if the card was to fail the virtual wouldnt be able to take advantage of the fact it could route the traffic itself. Either way i have had lots of complaints on drop in and out of connection, it appears one min you can get to VMS and then next you cant. Please advise if i have misunderstood how to setup and if using the inforamtion i have given can pin point the mistake mean time i have gone back to the one card to try to keep things stable.

Thanks

Ben

09 November 08 at 10:03 AM
# jhoward said:

Ben - disable for the virtual NIC created for the physical NIC which is being used for virtual machines. You'll hit all sorts of problems with two default gateways on two NICs in the parent partition.

Thanks,

John.

10 November 08 at 10:33 PM
# nvvn said:

Excellent job, keep up good work, also for part 1. However I would like to see if it is possible step by step guide or how-to for VLAN's. For example, Win Svr 2008 with HyperV server have two physical NIC's. NIC2 is connected to physical port onto physical swtich with two VLAN, ie 11 for data, 12 for voip. How can I have also these two VLAN's in virtual servers.

Best regards

11 November 08 at 6:25 AM
# Rod Trent MVP, myITforum'er said:

Hyper-V HW & SW requirement: http://technet.microsoft.com/en-us/library/cc816844.aspx Hyper-V RTM

12 November 08 at 9:37 AM
# jhoward said:

@nvvn. Thanks. Your request has been on my list for a few months. I will get round to this just as soon as I can.

Thanks,

John.

14 November 08 at 10:41 PM
# reuvens said:

A few questions:

1. Can you explain what the pratical difference is between the "external" and "dedicated" network types. Another words, why would I want to choose one over the other.

2. Going on the last question, I have to ask why there isn't a dedicated network option in the UI, but instead only via WMI (or scripting). Is this some hidden option that wasn't meant for production?

3. Can you explain how when you disable the virtual interface or even deselect all of the items in the NIC properties (and therefore that NIC doesn't have an IP address) the VMs assigned to that interface can still contact the network? I've seen people explain this by using the concept of "bridging" but I wondered if there is any documentation about how this works?

Good Post!

Thanks,

Reuven

25 November 08 at 8:25 AM
# jhoward said:

Reuvens. There is no operational/practical difference between a dedicated network and an external network with a disabled virtual NIC in the parent partition. However, when you have multiple physical NICs, it can quickly become very confusing when looking at ncpa.cpl to see one or more disabled NICs and you risk accidental exposure of the parent to that network should it be enabled.

Second question - nothing more than an oversight. Really! And yes, it is the recommended production deployment configuration for physical NICs "dedicated" to VM traffic.

Third question. Look at the first picture above and compare with the dedicated network picture. It doesn't matter what you disable in the virtual NIC as that isn't being used for VM traffic. It's the physical NIC which has the Microsoft Virtual Network Switch Protocol bound which is being used for traffic. It's really nothing to do with bridging - we implement as the diagram suggests a layer 2 switch in software. The closest I could point you to current "official" documentation is http://technet.microsoft.com/en-us/library/cc816585.aspx (which is largely based on the post above  :) )

Thanks,

John.

25 November 08 at 11:24 AM
# Bryant said:

Founds this.....Howto create a Virtual Swich for External without creating a Virtual NIC on the root

04 December 08 at 1:41 AM
# David said:

John,

Running 12 VM's in a SAN; is there any advantage to using 12 physical NIC's?

11 December 08 at 4:04 PM
# jhoward said:

David - not unless you believe all 12 VMs are going to need a whole (I assume) gigabit each simultaneously - generally that's pretty unlikely and you would be able to share several VMs through a single NIC. Obviously though, it depends entirely on the network profile of each workload to determine what it reasonable to share on a single NIC and when you need more than one. Being in a SAN should make no difference from the networking side though (unless you're referring to storage over networking as in iSCSI?)

Thanks,

John.

11 December 08 at 4:55 PM
# Mike said:

I have eight NICs in my 8x32 HP blades and using Fiber Channel with Clustering.  I am curious what the recommended 'Dedicated Network' configuration would be leveraging the most NICs without running into gateway issues?  I also have the ability to team the NICs but have been cautioned about using teaming with Hyper-V.

NIC1 - Parent Partition NIC ?

NIC2 - Heartbeat ?

NIC3 -

NIC4 -

NIC5 -

NIC6 -

NIC7 -

NIC8 -

20 December 08 at 12:34 AM
# Mike said:

can you share which stencil you use for the switch and NICS?

Thanks,

Mike

20 December 08 at 12:36 AM
# TONYSO said:

Performance Tuning Guidelines for Windows Server 2008 Hyper-V Release Notes Planning for Hyper-V Security

30 January 09 at 3:49 PM
# Mike2 said:

How would I unbind all protocolls from or simply disable the virtual NIC on the parent under WS2008 Core or HVS2008?

I tried the registry, netsh, devcon.exe... no success....

Thanks,

Mike2

02 February 09 at 9:23 PM
# jhoward said:

Mike2

netsh interface show interface

--> to get the interface name for the adapter you want to disable

netsh interface set interface "interface name from above" disabled

Cheers,

John.

02 February 09 at 9:42 PM
# Norman said:

Ben Armstrong has posted a script that creates a dedicated network: http://blogs.msdn.com/virtual_pc_guy/archive/2009/02/19/script-creating-an-external-only-virtual-network-with-hyper-v.aspx

25 February 09 at 5:08 PM
# ITguy said:

John, I am setting up a system having a single NIC and two VMs using an external virtual network. I am wondering, will the external IP address for both VMs appear the same to an external device?

Thanks

03 March 09 at 5:30 PM
# jhoward said:

ITGuy - no, each virtual NIC will appear as a completely seperate entity on the physical network when viewed from outside the Hyper-V box itself. Each will have it's own MAC address, and the IP address will be entirely dependent on what you manually configure it to be in the VM, or what is assigned by DHCP. Essentially at this point, forget they are virtual machines - they are just another machine on the network and it happens to be a virtual machine.

Thanks,

John.

03 March 09 at 6:33 PM
# John Howard - Hyper-V and virtualization blog said:

I thought I’d start a series of posts highlighting some of the smaller changes in Hyper-V in Windows

04 May 09 at 9:43 PM
# gul said:

Nice explantion, however i am searching for one thing that can i set IP address, Default gateway etc to the virtual machine nIC using powersheell or WMI.

Thanks

Regards

Gul

20 July 09 at 9:32 AM
# jhoward said:

Gul - Hyper-V doesn't expose (or have) capabilities from the parent partition to set these parameters inside a VM. The parent is 'blind' to how the OS instance in a VM itself is configured.

Thanks,

John.

20 July 09 at 10:02 PM
# Shiva said:

Hi John,

  Your forum is of amazing help to our project. Thanks for your support.  I got a question in networking. We are trying to configure network to a VM programmatically via WMI. While configuring the network adapter with the channel instance id, we require a VM restart to make the IP configuration successfull. Is this the expected behaviour or are we doing it wrong? Please suggest us.

Thanks

Shiva

06 August 09 at 6:15 PM
# Colin said:

Is it possible to have a virtual network span 2 different hyper-v hosts.  We have 2 boxes capable of running 7 virtual machines each and we'd like them all interacting as though they were on the same lan.  We don't want to connect them to the real network because it will act as a closed lab with routing to the real network.  This way, our real lan will appear as a remote site

26 November 09 at 3:55 AM
# jhoward said:

Colin - the only way you can have a virtual network span two different hyper-v machines is if the two machines have a piece of physical wire between them. Now that doesn't have to be the "real" network you describe if you have an unused physical NIC on each machine - create an external virtual network on each server, without a vNIC in the parent partition. Connect both physical NICs together either with a crossover cable or via a dedicated hardware switch/hub.

Thanks,

John.

30 November 09 at 11:45 AM

Leave a Comment

Comment Policy: No HTML allowed. URIs and line breaks are converted automatically. Your e–mail address will not show up on any public page.

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Page view tracker