How to Switch a VM From Dynamic IP To Static IP Pool in Virtual Machine Manager? #VMM #SCVMM #SysCtr #HyperV

Hello folks,

This blog post is meant to show you how you can move a virtual machine from Dynamic IP to static IP Pool in VMM for your virtual machines post deployments.

I deployed recently a virtual machine from VM Templates, however during the deployment, I missed to select IP address to be Static IP (from a static IP Pool).

What I ended-up with a VM without an IP address.

SNAGHTML5f37dac

A little bit of context about IP Pool in VMM.

An IP Pool is like a DHCP server. There is an IP address range, where you can configure basic options such as gateway, the suffixes DNS and DNS itself, etc… 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.

So after the VM is deployed, you cannot change the IP address mode in the UI from Dynamic to Static, the option will be greyed out as shown in the following screenshot.

image

If we click on Connection details… we can see the VM has no IP address assigned.

image

So what is the solution then… PowerShell of course!

By running the following script we can update the IP address from Dynamic to Static IP Pool on the fly while the VM is running.

.\Set-SCVMIPAddressMode.ps1 -VMMServerName VMM01 -VMName DEMO-VM

When the job is completed, look back at the VM properties in VMM, we can see the IP address is set to Static IP (from a static IP Pool).

VMM-DYN_SCIPPool-04

Click on Connection details… to check if the VM has an IP address allocated from the IP Pool.

image

And lastly, login to the VM and ensure that these settings are reflected within the guest Operating System as well.

image

That’s it. Have a good one!

Cheers,
-Charbel

About Charbel Nemnom 323 Articles

Charbel Nemnom is a Microsoft Cloud Consultant and Technical Evangelist, totally fan of the latest’s IT platform solutions, accomplished hands-on technical professional with over 15 years of broad IT Infrastructure experience serving on and guiding technical teams to optimize performance of mission-critical enterprise systems. Excellent communicator adept at identifying business needs and bridging the gap between functional groups and technology to foster targeted and innovative IT project development. Well respected by peers through demonstrating passion for technology and performance improvement. Extensive practical knowledge of complex systems builds, network design and virtualization.

Be the first to comment

Leave a Reply