VM Network Wizard fails with errorcode 12416

I found a bug in the creation of VM networks.
I received the error:

VMM is unable to process one of the provided parameters for the cmdlet (New-SCVMSubnet):

Cannot convert ‘System.Object[]’ to the type ‘Microsoft.SystemCenter.VirtualMachineManager.LogicalNetworkDefinition’ required by parameter ‘LogicalNetworkDefinition’. Specified method is not supported

ID: 12416

I created a Network site called “ABC” on my logical network “Internet” and added a VLAN and IP Subnet:

LN_NS1

I entered the name of the VM Network in the “Create VM Network Wizard”

LN_NS2

Specified the right VLAN and subnet I just created in the logical network:

LN_NS3

Hit “Finish” and got the following error:
LN_NS4

The VM Network has been created, but it has no VM Subnets assigned.
LN_NS5
LN_NS6

The following Powershell scripts is used for the creation of the VM Network and Subnet VLAN.
In the scripts it shows the Get-SCLogicalNetworkDefinition:

$logicalNetwork = Get-SCLogicalNetwork -Name "Internet" -ID "ab0b05a3-92f7-4ae3-aed7-23e5e1d85824"
$vmNetwork = New-SCVMNetwork -Name "ABC - VLAN10" -LogicalNetwork $logicalNetwork -IsolationType "VLANNetwork"
Write-Output $vmNetwork
$logicalNetworkDefinition = Get-SCLogicalNetworkDefinition -Name "ABC"
$subnetVLAN = New-SCSubnetVLan -Subnet "10.10.10.0/24" -VLanID 10
$vmSubnet = New-SCVMSubnet -Name "ABC - VLAN10_0" -LogicalNetworkDefinition $logicalNetworkDefinition -SubnetVLan $subnetVLAN -VMNetwork $vmNetwork

The reason why this script fails is because I have another Logical Network called “Switch” and on this I have a network site called “ABC” as well.
So when the $logicalNetworkDefinition = Get-SCLogicalNetworkDefinition -Name “ABC” runs it will receive two Logical Network Definitions.
This seems very much to be a bug, I dont understand why the Get-SCLogicalNetworkDefinition cmdlet doesn’t use a Unique Identifier.

LN_NS7

When I rename the Network Site on Infra-Switch to “ABD” the “Create VM Network Wizard” runs fine.

You could workarround this issue by editing the powershell script and using it instead of the wizard.
Add the name of the Logical Network Definition in the script:

$logicalNetwork = Get-SCLogicalNetwork -Name "Internet" -ID "ab0b05a3-92f7-4ae3-aed7-23e5e1d85824"
$vmNetwork = New-SCVMNetwork -Name "ABC - VLAN10" -LogicalNetwork $logicalNetwork -IsolationType "VLANNetwork"
Write-Output $vmNetwork
$logicalNetworkDefinition = Get-SCLogicalNetworkDefinition -Name "ABC" -LogicalNetwork $logicalNetwork
$subnetVLAN = New-SCSubnetVLan -Subnet "10.10.10.0/24" -VLanID 10
$vmSubnet = New-SCVMSubnet -Name "ABC - VLAN10_0" -LogicalNetworkDefinition $logicalNetworkDefinition -SubnetVLan $subnetVLAN -VMNetwork $vmNetwork

Got a Microsoft support case running.

Update:

Bug accepted by Microsoft, “this will be addressed in future release.”

Leave a Reply

Your email address will not be published. Required fields are marked *