Exporting Logical Networks and IP Pools from 2016 VMM to 2019 VMM RRS feed

  • Question

  • I have an environment with a 2016 VMM and 2019 VMM. Much has already been moved to VMM 2019 manually except for one particular logical network that has many, many IP Pool sites. I'm looking for a way to export these from VMM 2016 so I can import them together into VMM 2019 without the manual effort. I've tried the script on CHARBEL NEMNOM's site but have encountered errors with host group names which match on both ends (dont understand this), and manipulating pieces of the script to only grab a particular logical network and its IP pools has failed me in Powershell as well. I don't want it to export every single logical network, but I want to be able to choose the logical network to export and then import. Any suggestions would be greatly appreciated. 

    Tuesday, June 16, 2020 11:59 AM

All replies

  • Hello,

    Based on the description for New-SCLogicalNetworkDefinition cmdlet, the -VMHostGroup parameter, you should specify a virtual machine host group object. It's not the host group name.


    Is it possible that this is the cause for the failure?

    Best regards,

    Andy Liu

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Wednesday, June 17, 2020 1:42 AM
  • I have been away, and have returned to continue this task. Thank you for the clue. I will research this and see if it applies.
    Wednesday, June 24, 2020 3:57 PM
  • I've broken down the powershell a bit to try and identify and learn whats happening a bit better. See in the attached code block the first two sections do work OK. It finds and creates the logical network and the VM network from the source VMM server.

    When I run the 3rd section to read and create the Logical Network Definitions I get the error:

    New-SCLogicalNetworkDefinition : Unable to find the specified host group. The host group name may be incorrect, or the host group may have been moved or deleted. (Error ID: 1750) 
    Verify that the host group name is correct, that the host group exists on the Virtual Machine Manager management server, and that the host group is in the specified host path.

    So its something with that -VMHostGroup $LND.HostGroups section. However if I run just the variable $LND.HostGroups it returns:

    PS C:\Windows\system32> $LND.HostGroups

    AllowUnencryptedTransfers : True
    CreationDate              : 6/4/2013 4:34:35 PM
    Creator                   : ME\user
    Description               : 
    ID                        : 17441540-f13f-438f-ac3c-81994f2d440e
    InheritNetworkSettings    : True
    IsFullyCached             : True
    IsRoot                    : False
    MarkedForDeletion         : False
    ModificationDate          : 7/17/2017 9:23:13 AM
    ModifiedBy                : ME\user
    Name                      : Group 1 Hosts
    ParentHostGroup           : All Hosts
    Path                      : All Hosts\Group 1 Hosts
    ServerConnection          : Microsoft.SystemCenter.VirtualMachineManager.Remoting.ServerConnection

    Any suggestions on how to get around this? This Logical network has about 100 IP Pools under it I would like to not have to manually re-enter. 

    # Find logical network being queried from SourceVMMsvr and Create it on DestVMMsvr
    $ReadLogicalNetwork = Get-SCLogicalNetwork -VMMServer SourceVMMsvr | Where-Object Name -eq "VM Logical Network 1"
    New-SCLogicalNetwork $ReadLogicalNetwork -VMMServer DestVMMsvr
    # Read VM Network on SourceVMMsvr and create on DestVMMsvr
    $VMNetwork = Get-SCVMNetwork -VMMServer SourceVMMsvr -LogicalNetwork $ReadLogicalNetwork
    New-SCVMNetwork -VMMServer DestVMMsvr -Name $VMNetwork.Name -LogicalNetwork $LNToCreate -IsolationType $VMNetwork.IsolationType -Description $VMNetwork.Description | Out-Null
    # Read the Logical Network Definitions from SourceVMMsvr and create on DestVMMsvr
    $LNDs = Get-SCLogicalNetworkDefinition -LogicalNetwork $ReadLogicalNetwork -VMMServer SourceVMMsvr
    ForEach ($LND in $LNDs) {
        $LNDToCreate = New-SCLogicalNetworkDefinition -VMMServer DestVMMsvr -LogicalNetwork $LND.LogicalNetwork.Name -SubnetVLan $LND.SubnetVLans -Name $LND.Name -VMHostGroup $LND.HostGroups
        # Read IP pools on this Logical Network and create on DestVMMsvr
        $IPPools = Get-SCStaticIPAddressPool -VMMServer SourceVMMsvr -LogicalNetworkDefinition $LND
        ForEach ($IPPool in $IPPools) {
            New-SCStaticIPAddressPool -VMMServer DestVMMsvr -LogicalNetworkDefinition $LNDToCreate -Name $IPPool.Name -Description $IPPool.Description -Subnet $IPPool.Subnet -Vlan $IPPool.VLanID -IPAddressRangeStart $IPPool.IPAddressRangeStart -IPAddressRangeEnd $IPPool.IPAddressRangeEnd -VIPAddressSet $IPPool.VIPAddressSet -DNSServer $IPPool.DNSServers -DNSSuffix $IPPool.DNSSuffix -NetworkRoute $IPPool.NetworkRoute -IPAddressReservedSet $IPPool.IPAddressReservedSet -WINSServer $IPPool.WINSServers -EnableNetBIOS $IPPool.EnableNetBIOS | Out-Null

    Friday, August 7, 2020 2:44 PM