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 <[email protected]>
---
 lib/cmdlib/network.py |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/cmdlib/network.py b/lib/cmdlib/network.py
index 4f172a4..01bd948 100644
--- a/lib/cmdlib/network.py
+++ b/lib/cmdlib/network.py
@@ -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",
-- 
1.7.10.4

Reply via email to