(ipfix) Allow NICs with mode=routed and ip=none
authorDimitris Aragiorgis <dimara@grnet.gr>
Mon, 16 Dec 2013 01:13:48 +0000 (03:13 +0200)
committerDimitris Aragiorgis <dimara@grnet.gr>
Tue, 17 Dec 2013 10:46:55 +0000 (12:46 +0200)
This allows us to define an IPv6 only network (currently with a
dummy IPv4 network) with connectivity mode 'routed' and let
the NICs inside this network have only IPv6 address (auto-generated
from their MAC and the network's prefix).

Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>

lib/cmdlib/instance.py

index 74ddfdc..85c6ef3 100644 (file)
@@ -205,11 +205,6 @@ def _ComputeNics(op, cluster, default_ip, cfg, ec_id):
 
       nic_ip = ip
 
-    # TODO: check the ip address for uniqueness
-    if nic_mode == constants.NIC_MODE_ROUTED and not nic_ip:
-      raise errors.OpPrereqError("Routed nic mode requires an ip address",
-                                 errors.ECODE_INVAL)
-
     # MAC address verification
     mac = nic.get(constants.INIC_MAC, constants.VALUE_AUTO)
     if mac not in (constants.VALUE_AUTO, constants.VALUE_GENERATE):
@@ -2523,9 +2518,6 @@ class LUInstanceSetParams(LogicalUnit):
 
     elif new_mode == constants.NIC_MODE_ROUTED:
       ip = params.get(constants.INIC_IP, old_ip)
-      if ip is None:
-        raise errors.OpPrereqError("Cannot set the NIC IP address to None"
-                                   " on a routed NIC", errors.ECODE_INVAL)
 
     elif new_mode == constants.NIC_MODE_OVS:
       # TODO: check OVS link