From ac061be9ee8e66e0e93e86b607f19593bca8ee4a Mon Sep 17 00:00:00 2001 From: Guido Trotter Date: Fri, 5 Jun 2009 15:38:38 +0100 Subject: [PATCH] nic parameters: constants Introducing the constants used for implementing nic parameters in Ganeti, according to the 2.1 design. Signed-off-by: Guido Trotter Reviewed-by: Iustin Pop --- lib/constants.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/constants.py b/lib/constants.py index 82d9186..260b509 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -346,6 +346,21 @@ BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys()) # Instance Parameters Profile PP_DEFAULT = "default" +NIC_MODE = "mode" +NIC_LINK = "link" + +NIC_MODE_BRIDGED = "bridged" +NIC_MODE_ROUTED = "routed" + +NIC_VALID_MODES = frozenset([NIC_MODE_BRIDGED, NIC_MODE_ROUTED]) + +NICS_PARAMETER_TYPES = { + NIC_MODE: VTYPE_STRING, + NIC_LINK: VTYPE_STRING, + } + +NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys()) + # Hypervisor constants HT_XEN_PVM = "xen-pvm" HT_FAKE = "fake" @@ -535,4 +550,9 @@ BEC_DEFAULTS = { BE_AUTO_BALANCE: True, } +NICC_DEFAULTS = { + NIC_MODE: NIC_MODE_BRIDGED, + NIC_LINK: DEFAULT_BRIDGE, + } + MASTER_POOL_SIZE_DEFAULT = 10 -- 1.7.10.4