Newly added vNIC doesn't get IP from static pool

Hi everyone,

I've added an IP pool to one of the logical network but when I add a NIC from the relative virtual network but the new NIC doesn't get IP off the pool as its set to DHCP.

any workaround? or this is how it is?!

btw, I'm running Hyper-v2012 R2 and SCVMM 2012R2 RU4

December 1st, 2014 8:13am

Did you choose "Static IP (from Pool)" assignment option in your vNIC configuration and selected the pool when creating the VM? As far as I know, address from pool can only be injected during the creation of VM... I don't think you can configure vNIC to use pool after the machine is created.
Free Windows Admin Tool Kit Click here and download it now
December 1st, 2014 8:54am

Static IP pool was actually grayed out and I had to use Powershell to change it to static with no luck tho.

I think you'are right, thats what I read from other forums

December 1st, 2014 9:53am

To assign an IP from the IP pool to a vNIC on a VM, you can use the following lines of powershell:

$vm = Get-ScvirtualMachine -Name NameOfVM"
$staticIPPool = Get-SCStaticIPAddressPool -Name "IP Pool" 
Grant-SCIPAddress -GrantToObjectType "VirtualNetworkAdapter" -GrantToObjectID $vm.VirtualNetworkAdapters[0].ID -StaticIPAddressPool $staticIPPool
Set-SCVirtualNetworkAdapter -VirtualNetworkAdapter $vm.VirtualNetworkAdapters[0] -IPv4AddressType static

make sure that the guest OS reflect this as well, and that you assign a static IP address that is alligned with the IP pool in VMM.

-kn

Free Windows Admin Tool Kit Click here and download it now
December 2nd, 2014 8:14pm

Hi,

This code works fine for Windows VM even after VM is cloned. Does this work for Linux VM also?

I am not able to get it working for Linux VM (Cent 7 x64 ).

Regards,

Umesh

May 12th, 2015 8:01am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics