Commit ced51149 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis Committed by Iustin Pop
Browse files

Modify RemoveInstance() to support networks

Release any IPs held the instance before actually removing.
Signed-off-by: default avatarDimitris Aragiorgis <>
Reviewed-by: default avatarIustin Pop <>
parent e8e079f3
......@@ -1421,6 +1421,16 @@ class ConfigWriter:
if network_port is not None:
instance = self._UnlockedGetInstanceInfo(instance_name)
for nic in instance.nics:
if is not None and nic.ip is not None:
net_uuid = self._UnlockedLookupNetwork(
if net_uuid:
# Return all IP addresses to the respective address pools
self._UnlockedCommitIp('release', net_uuid, nic.ip)
del self._config_data.instances[instance_name]
self._config_data.cluster.serial_no += 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment