12 Feb 2014

How to change Subnet / VLanID on an existing Logical Network Definition in SCVMM

A lot of people are still using VLAN based isolation for their Software defined Network in System Center Virtual Machine Manager. Although you have 4096 VLanIDs to assign, sometimes things have to be changed. Did you ever try to change a Subnet or VLANId on a Logical Network Site that is in use?

Unfortunately, it is not possible to change the VLanID or CIDR Subnet definition on an already assigned “Logical Network Site Definition” in SCVMM Console.  Therefore I created a Powershell function which changes the VLANID on a Subnet Definition and updates all VM Network Adapters mapped to the current VLANID. It supports -verbose and -whatif switches. You can get the code here on TechNet Script Gallery

The Function is best executed within a Powershell ISE.

Update: 18.02.2014

New version uploaded with bug fixing. Thanks to Michel Lüscher (MSFT) for reporting the bug.

Update: 03.03.2014

New version 1.2 with added support for multiple Logical Network Definitions with same name