(2.10) Mark cluster's IPs as externally reserved
authorDimitris Aragiorgis <dimara@grnet.gr>
Fri, 1 Nov 2013 14:24:37 +0000 (16:24 +0200)
committerDimitris Aragiorgis <dimara@grnet.gr>
Thu, 27 Mar 2014 07:57:07 +0000 (09:57 +0200)
Currently, upon network creation, nodes' and master's IPs
are reserved in the pool.

This leads to pool reservations ('X' in map) that cannot be changed
afterwards, although they may need to (e.g. in case of node
removal/modification). Also, these IPs are not actually handled by
Ganeti in the sense that they are not assigned to the cluster's VMs.

Thus, we should mark the as externally reserved and not just reserved.

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

lib/cmdlib/network.py

index 430cdb3..32e3ff7 100644 (file)
@@ -169,7 +169,7 @@ class LUNetworkAdd(LogicalUnit):
         for ip in [node.primary_ip, node.secondary_ip]:
           try:
             if pool.Contains(ip):
-              pool.Reserve(ip)
+              pool.Reserve(ip, external=True)
               self.LogInfo("Reserved IP address of node '%s' (%s)",
                            node.name, ip)
           except errors.AddressPoolError, err:
@@ -179,7 +179,7 @@ class LUNetworkAdd(LogicalUnit):
       master_ip = self.cfg.GetClusterInfo().master_ip
       try:
         if pool.Contains(master_ip):
-          pool.Reserve(master_ip)
+          pool.Reserve(master_ip, external=True)
           self.LogInfo("Reserved cluster master IP address (%s)", master_ip)
       except errors.AddressPoolError, err:
         self.LogWarning("Cannot reserve cluster master IP address (%s): %s",