]))
# TODO: DDM_SWAP, DDM_MOVE?
+# device types to hotplug
+HOTPLUG_TARGET_DISK = "hotdisk"
+HOTPLUG_TARGET_NIC = "hotnic"
+HOTPLUG_ALL_TARGETS = frozenset([
+ HOTPLUG_TARGET_DISK,
+ HOTPLUG_TARGET_NIC
+ ])
+
+# hotplug actions
+HOTPLUG_ACTION_ADD = "hotadd"
+HOTPLUG_ACTION_REMOVE = "hotremove"
+HOTPLUG_ACTION_MODIFY = "hotmod"
+HOTPLUG_ALL_ACTIONS = frozenset([
+ HOTPLUG_ACTION_ADD,
+ HOTPLUG_ACTION_REMOVE,
+ HOTPLUG_ACTION_MODIFY
+ ])
+
# common exit codes
EXIT_SUCCESS = 0
EXIT_FAILURE = 1
class NIC(ConfigObject):
"""Config object representing a network card."""
- __slots__ = ["name", "mac", "ip", "network", "nicparams", "netinfo"] + _UUID
+ __slots__ = ["name", "mac", "ip", "network",
+ "nicparams", "netinfo", "pci"] + _UUID
@classmethod
def CheckParameterSyntax(cls, nicparams):
class Disk(ConfigObject):
"""Config object representing a block device."""
__slots__ = ["name", "dev_type", "logical_id", "physical_id",
- "children", "iv_name", "size", "mode", "params"] + _UUID
+ "children", "iv_name", "size", "mode", "params", "pci"] + _UUID
def CreateOnSecondary(self):
"""Test if this device needs to be created on a secondary node."""
"Whether to wait for the disk to synchronize, when changing template"),
("offline", None, ht.TMaybeBool, "Whether to mark instance as offline"),
("conflicts_check", True, ht.TBool, "Check for conflicting IPs"),
+ ("hotplug", False, ht.TBool, "Whether to hotplug device"),
+ ("hotplug_if_possible", False, ht.TBool, "If possible then hotplug device"),
]
OP_RESULT = _TSetParamsResult