Q&A: Does the computer import uses recycled ipaddresses?


If I have already a lot of clients in my network and 30 clients need to be replaced, will the freed IP addresses after deleting the clients be reused?
Does the import will use these freed IP addresses or will it use the IP addresses till the end of the defined subnet and fail, if no IP address is available anymore?


In ucs-school-lib/modules/ucsschool/lib/models/computer.py
we see

if self._ip_is_set_to_subnet(ipv4_network):
        "IP was set to subnet. Unsetting it on the computer so that UDM can do some magic: "
        "Assign next free IP!"
    udm_obj["ip"] = []

So this seems to be a UDM feature.

If a network is set but the IP address not, UDM starts with the first usable IP address of the network.


self['nextIp'] = str(network.network_address + 1)  # first usable host address in network

and in a loop

  • looks for an aRecord with that value
  • if the aRecord exist, the next IP address (stepIP) is calculated and we start another search
  • if no aRecord exist we have our IP address

So the IP addresses will be ‘recycled’.

Creating a computer object with network but no IP address in UMC, computer got as address. When the computer is removed and another one created, the new computer object got also as IP address.