question

KotenkoVolodymyr avatar image
0 Votes"
KotenkoVolodymyr asked KotenkoVolodymyr edited

SCVMM2016 Dublicate record in the base StaticIPAddressPool

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?


msc-virtual-machine-manager
2.jpg (122.4 KiB)
3.jpg (108.4 KiB)
4.jpg (62.7 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

XinGuo-MSFT avatar image
0 Votes"
XinGuo-MSFT answered KotenkoVolodymyr edited

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.
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@XinGuo-MSFT Thanks for your reply. He helped me a lot.
I used your code to form a query based on the pool name and was able to assign the desired range to the variable.
Instead of:


 $pool=Get-SCStaticIPAddressPool|? {$_.IPAddressRangeStart -eq "XXX.XXX.XXX.XXX"}

I use:

 $pool=Get-SCStaticIPAddressPool|? {$_.Name -eq 'Public2 Pool'}

Was also able to remove unneeded pool.

0 Votes 0 ·