IP Pool in Virtual Machine Manager 2012R2

For the first time, I used in a real project IP Pool in Virtual Machine Manager 2012R2. Before that, I used as everyone a DHCP server or I set manually the IP addresses in network configuration. But this time I used IP Pools intensively to avoid these constraints. So in this topic I want to share you my happiness about IP Pool and how it is working.

But before it is important to understand what an IP Pool is. An IP Pool is like a DHCP server. There is an IP address range, and you can configure basic options as the gateway, the suffixes DNS and DNS itself or Wins server (who use that today ? J). An IP Pool is associated to a VM Subnet that belong to a VM network. For each VM Subnet it is possible to create one or more IP Pool while the IP addresses in the range belong to the VM subnet. For further information about the network components in Virtual Machine Manager you can view this topic. So IP Pool can only be used by Virtual Machines (VM) or virtual network card (vNIC) of hosts.

As you should know, on an IPv4 or an IPv6 network configuration you have two modes: dynamic or static configuration. When you use dynamic configuration, you must use a DHCP server that delivers network configuration (IP address, netmask, gateway and so on) instead of static configuration where you have to set manually (or by script). There are some disadvantages about using dynamic configuration. The first is that some applications don’t support dynamic IP (as Domain Controller, DHCP server itself and so on)So even if you use DHCP server, you have to set your IP configuration manually in some cases. The second disadvantage is that your IP can change (if you not manage reservation) and it is not good for a server. So most of the time on production network the IP configuration is set to static and managed manually.


And it is at this moment of the story that IP Pool is born. The difference with DHCP server is that when IP Pool delivers the IP configuration to a Guest OS, the network settings are static. This is why when you create a virtual machine in VMM you can specify if you want a dynamic IP or a static IP from IP Pool on network configuration as below.

There is no lease in the IP Pool instead of DHCP. When an IP is picked up in IP Pool, this last is allocated to a VM or a vNIC. So the network configuration on guest OS (or the vNIC) is the same until you change it manually. Unfortunately IP Pool can be selected at the VM creation only if you use a VM template. If you don’t use VM templates you have to set manually the IP configuration inside the Guest OS.

I will show you with some screenshot about how to create an IP Pool and the behavior of network configuration with IP Pool. To present that I will create an IP Pool with these settings:

  • IP range: 192.168.1.150 – 192.168.1.160
  • Netmask: 255.255.255.0
  • Gateway: 192.168.1.254
  • DNS: 192.168.1.100
  • DNS Suffix: fabrikam.com
  • WINS: No Way J

Two Virtual Machines will be created to show you the behavior of the Guest OS and the VMM network configuration:

  • One VM called VMDYM01 will be created with dynamic option;
  • One VM called VMIPP01 will be created from a VM template with IP Pool configuration.

Create and configure an IP Pool

First of all, I create an IP Pool called VM_Pool on my VM subnet 192.168.1.0/24 with above settings:

 

Now that my IP Pool is created, I can use it for my VMs.

From dynamic configuration to IP Pool (VMDYM01)

So my VMDYM01 has been created without VM template and so with dynamic IP configuration. As you can see below, the IP address of this VM doesn’t belong to my IP Pool.

Now I set manually the IP configuration inside the guest OS. I use an IP address belonging to the IP Pool:

After refreshing the VM in Virtual Machine Manager, I come back to connection details of the related virtual network interface:

Now it says that the IP address come from IP Pool “VM_Pool”. You can view which IP address from IP Pool is associated with VM (or vNIC) with the below PowerShell commands:

$IPPool = Get-SCStaticIPAddressPool –name "VM_Pool"
Get-SCIPAddress –StaticIPAddressPool $IPPool

Now what happens if I change the network configuration on the Guest OS?

So I refresh the VM and I check the connection details in VMM:

Now I re-run the PowerShell commands to view the behavior in IP Pool:

$IPPool = Get-SCStaticIPAddressPool –name "VM_Pool"
Get-SCIPAddress –StaticIPAddressPool $IPPool

So VMM has unallocated and released the unused IP address and has allocated the new one. Pretty impressive. I think to open a Facebook fan page about IP Pools.

About VM created from a template (VMIPP01)

For massive deployment, IP Pool can be used in VM template. In this way when the VM is created and ready, the IP configuration is already configured to static with IP Pool settings. So I have a VM template and as you can see below, I have set the virtual network card to static IP (from an IP Pool):

I deploy a VM from this template. When it is the Review the virtual machine settings screen you can specify an IP address belonging to the IP Pool or let it blank: in this case an IP available will be automatically allocated. I choose to let VMM manage this:

So when the VM is created, I go to verify the connection details:

Ok so IP Pool is used, this is a good start. Next I switch on the VM to verify the IP configuration on Guest OS:

The network configuration is set automatically at the VM creation. Pretty good no ?

I verify also the IP allocation in IP Pool:

$IPPool = Get-SCStaticIPAddressPool –name "VM_Pool"
Get-SCIPAddress –StaticIPAddressPool $IPPool

So all it’s good J.

IP Address Management (IPAM)

As you have seen previously I use PowerShell commands to obtain information about IP address delivered by IP Pool. When you have thousands of IP addresses it can be difficult to find information except for PowerShell guys. With IP Address Management you can manage graphically the IP Pool component. This feature is available since Windows Server 2012 R2. So I have installed an IPAM server and I have configured the IPAM connector from Virtual Machine Manager. I obtain this information:

For guys who don’t like the PowerShell command line, it can be an alternative to manage network component of VMM.

About Romain Serre

Romain Serre works in Lyon as a Senior Consultant. He is focused on Microsoft Technology, especially on Hyper-V, System Center, Storage, networking and Cloud OS technology as Microsoft Azure or Azure Stack. He is a MVP and he is certified Microsoft Certified Solution Expert (MCSE Server Infrastructure & Private Cloud), on Hyper-V and on Microsoft Azure (Implementing a Microsoft Azure Solution).

6 comments

  1. Great job. You wrote very interesting articles.

  2. Hi I have one big problem, when i try to asign IP Pool to virtual machine (existing) this setting is not active, i can choose VM network, VLAN, switch and classification But IP address a MAC address is default Dynamic with no possibility to change it.

    Thanks Roman

  3. Thanks for your great articles. Very useful and easy to follow.I am a big fan .
    In my case , when I deploy my Virtual machine with Static IP address Pool , my VM gets the DNS setting of the pool , but not the IP address that is automatically assigned by the Pool. Instead it gets an IP address form DHCP server.However, if I manually enter an IP address from the pool in my VM network adapter setting, VMM recognizes that and the IP address Pool excludes the address. This is all on a single subnet. Th VMM job for deploying the VM does not give any error or warning. I use a VM template that has a sysprep VHDX disk in order to deploy the image.

    Any Suggestion would be greatly appreciated. 🙂

    • Hi,

      Could you send me a screenshot of your VM template configuration (Network Adapter part) and a screenshot of the logical network view to my E-mail address ? You can find it in contact page.

      Thank you 🙂

      Romain.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

x

Check Also

Manage Switch Embedded Teaming from VMM 2016

Since System Virtual Machine Manager 2016 Technical Preview 5 with cumulative update 2, it is ...

Manage Storage Space Direct from Virtual Machine Manager

In a previous topic, I shown how to implement a Storage Space Direct on Windows ...

Upgrade Virtual Machine Manager 2012 R2 in High Availability to Technical Preview 2

Currently the last build for the next release of Virtual Machine Manager is the Technical ...