I am looking for some assistance. I am scripting the allocation of IP's for VM's deployed to a org network backed by a specific external network.
Currently I am running:
$extnet = get-externalnetwork "externalnetworkname"
I then want to get the list of IP's from this network that have been allocated to VM's already:
$AllocatedIps = $extnet.ExtensionData.GetallocatedAddresses().IpAddres.IPAddress
I thought this was working, until I started picking up duplicate IP allocations.
It turns out this only returns the first 128 allocated IP addresses. (Currently I have a possible 939 available IP addresses on this external network)
How can I return the full list of IP addresses that have already been allocated?
ok, so it appears I may have more joy using this:
$AllocatedIPs = $extnet.ExtensionData.configuration.ipscopes.ipscope.allocatedipaddresses.ipaddress
If I do a count on this it currently matches the 157 allocated IP's. So I will update my script and then feedback regarding whether this issue has bene resolved.
ok, so it appears I may have more joy using this:
$AllocatedIPs = $extnet.ExtensionData.configuration.ipscopes.ipscope.allocatedipaddresses.ipaddress
If I do a count on this it currently matches the 157 allocated IP's. So I will update my script and then feedback regarding whether this issue has bene resolved.
I can confirm this has resolved the issue I was having with manual IP assignments.