How To Migrate Virtual Machines From One Logical Switch To Another Logical Switch in Virtual Machine Manager? #SCVMM #SysCtr #HyperV

Hello folks,

A few blogs ago I showed you how to migrate from Standard Virtual Switch to Logical Switch in Virtual Machine Manager.

In today’s post I will show you how to migrate your virtual machines from an existing logical switch to another logical switch.

But before start doing that, let’s see in what scenario you might require this migration.

Scenarios

1- You have upgraded your Hyper-V host with higher network adapters and now you want to move all your VMs workload over the new NICs.

2- You are using converged virtual network within Hyper-V deployments that is managed by System Center Virtual Machine Manager, and now you need to move all your VMs traffic off the converged vSwitch and use a dedicated logical switch.

More information on how to create a Logical Switch in VMM.

In order to move your virtual machine from one logical switch to another one is very simple.

To choose a logical switch
> Open the VM and Services workspace.
> Choose any host group, and then select the desired virtual machine.
> On the Virtual Machine tab, click Properties.
> The Virtual Machine window properties opens.
> Choose the Hardware Configuration, and then browse to Network Adapters.
> Select the desired Virtual Network Adapter, and then change the Logical Switch as showing in below figure.

VMM-LS01

Select the Logical Switch for virtual machines in VMM. (Image Credit: Charbel Nemnom)

Now the challenge is, what if you need to migrate 50 VMs and each VM has multiple vNICs and each is on different VLAN? 

Because when you change the Logical Switch in the UI, you need to select again the port classification and enable the VLAN ID.

VMM-LS02

Changing the Logical Switch for virtual machines in VMM. (Image Credit: Charbel Nemnom)

This indeed a long homework! Crying face

So what is the solution then?

The answer is PowerShell of course Winking smile

I have created the following tool that will help you to migrate all Virtual Machines on a particular Hyper-V host from an existing logical switch to another logical switch, while preserving all the existing configuration:

VMM-LS03

Do you have any other scenarios? please feel free to leave a comment below.

Hope this helps!

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