SCVMM2016 Dublicate record in the base StaticIPAddressPool

Kotenko Volodymyr 21 Reputation points
2021-09-18T09:54:15.113+00:00

Greetings,
As a result of the failure, my address pool entry was duplicated.
133574-2.jpg 133480-3.jpg
As a result, I cannot assign addresses from this pool to new Virtual Machines.
When I try to use the cmdlet, I get an error
Cmdlet:

$vm=Get-SCVirtualMachine -Name "Clients"  
$pool=Get-SCStaticIPAddressPool|? {$_.IPAddressRangeStart -eq "XXX.XXX.XXX.XXX"}  
Grant-SCIPAddress -GrantToObjectType "VirtualNetworkAdapter" -GrantToObjectID $vm.VirtualNetworkAdapters[0].ID -StaticIPAddressPool $pool  

Error:
133596-4.jpg

Only the correct record is displayed in Fabric-Logical Networks.

How can I delete a duplicate entry without deleting the entire pool?
Deleting pools and re-creating them is not acceptable as this is a production environment of 50 virtual machines.
Is it possible somehow in a variable to specify the pool through a name, and not a range of addresses?

System Center Virtual Machine Manager
0 comments No comments
{count} votes

Accepted answer
  1. XinGuo-MSFT 16,246 Reputation points
    2021-09-20T09:25:41.773+00:00

    Hi,

    As your screenshot, $pool returns is an array set, we can try the following command:

     Grant-SCIPAddress -GrantToObjectType "VirtualNetworkAdapter" -GrantToObjectID $vm.VirtualNetworkAdapters[0].ID -StaticIPAddressPool $pool **[0]**
    

    >How can I delete a duplicate entry without deleting the entire pool?

    Get-SCStaticIPAddressPool |?{$_.name -eq 'public2 pool'} | Remove-SCStaticIPAddressPool

    Please try to delete the specific pool using the above command.


0 additional answers

Sort by: Most helpful