diff --git a/lib/bootstrap.py b/lib/bootstrap.py index af9cb9297b4843231d117c1c3067e640a394dba3..a873a63a001c6aa2fa1b05ca2fad9b6f937d8b17 100644 --- a/lib/bootstrap.py +++ b/lib/bootstrap.py @@ -114,7 +114,7 @@ def InitCluster(cluster_name, hypervisor_type, mac_prefix, def_bridge, if config.ConfigWriter.IsCluster(): raise errors.OpPrereqError("Cluster is already initialised") - if hypervisor_type == constants.HT_XEN_HVM31: + if hypervisor_type == constants.HT_XEN_HVM: if not os.path.exists(constants.VNC_PASSWORD_FILE): raise errors.OpPrereqError("Please prepare the cluster VNC" "password file %s" % diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 8c038458836a57f94daa9d48c5f66ef7cd717054..eaefed1d85dc4ad874761c9b21e5a44bc814fbed 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -1814,7 +1814,7 @@ class LUAddNode(LogicalUnit): (fname, to_node)) to_copy = [] - if constants.HT_XEN_HVM31 in self.cfg.GetClusterInfo().enabled_hypervisors: + if constants.HT_XEN_HVM in self.cfg.GetClusterInfo().enabled_hypervisors: to_copy.append(constants.VNC_PASSWORD_FILE) for fname in to_copy: result = rpc.call_upload_file([node], fname) @@ -3493,7 +3493,7 @@ class LUCreateInstance(LogicalUnit): self.op.vnc_bind_address) # Xen HVM device type checks - if self.op.hypervisor == constants.HT_XEN_HVM31: + if self.op.hypervisor == constants.HT_XEN_HVM: if self.op.hvm_nic_type not in constants.HT_HVM_VALID_NIC_TYPES: raise errors.OpPrereqError("Invalid NIC type %s specified for Xen HVM" " hypervisor" % self.op.hvm_nic_type) @@ -4433,11 +4433,11 @@ class LUQueryInstanceData(NoHooksLU): } htkind = instance.hypervisor - if htkind == constants.HT_XEN_PVM30: + if htkind == constants.HT_XEN_PVM: idict["kernel_path"] = instance.kernel_path idict["initrd_path"] = instance.initrd_path - if htkind == constants.HT_XEN_HVM31: + if htkind == constants.HT_XEN_HVM: idict["hvm_boot_order"] = instance.hvm_boot_order idict["hvm_acpi"] = instance.hvm_acpi idict["hvm_pae"] = instance.hvm_pae @@ -4659,7 +4659,7 @@ class LUSetInstanceParams(LogicalUnit): " node %s" % node) # Xen HVM device type checks - if instance.hypervisor == constants.HT_XEN_HVM31: + if instance.hypervisor == constants.HT_XEN_HVM: if self.op.hvm_nic_type is not None: if self.op.hvm_nic_type not in constants.HT_HVM_VALID_NIC_TYPES: raise errors.OpPrereqError("Invalid NIC type %s specified for Xen" diff --git a/lib/constants.py b/lib/constants.py index afd40c772af0d7df1469bb86d9ab555b9c0332b1..56896645a57ad3ff9bb6ae6a113d480377dca54d 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -253,12 +253,12 @@ INSTANCE_REBOOT_HARD = "hard" INSTANCE_REBOOT_FULL = "full" # Hypervisor constants -HT_XEN_PVM30 = "xen-3.0" +HT_XEN_PVM = "xen-pvm" HT_FAKE = "fake" -HT_XEN_HVM31 = "xen-hvm-3.1" +HT_XEN_HVM = "xen-hvm" HT_KVM = "kvm" -HYPER_TYPES = frozenset([HT_XEN_PVM30, HT_FAKE, HT_XEN_HVM31, HT_KVM]) -HTS_REQ_PORT = frozenset([HT_XEN_HVM31]) +HYPER_TYPES = frozenset([HT_XEN_PVM, HT_FAKE, HT_XEN_HVM, HT_KVM]) +HTS_REQ_PORT = frozenset([HT_XEN_HVM]) HT_HVM_VNC_BASE_PORT = 5900 HT_HVM_DEFAULT_BOOT_ORDER = 'dc' diff --git a/lib/hypervisor/__init__.py b/lib/hypervisor/__init__.py index d8721959784ea4ddbd802f9ac8e0dde8c6ae0f9d..83604022d553430a3a55dc5f37c0ec8498e4d7f4 100644 --- a/lib/hypervisor/__init__.py +++ b/lib/hypervisor/__init__.py @@ -32,8 +32,8 @@ from ganeti.hypervisor import hv_kvm _HYPERVISOR_MAP = { - constants.HT_XEN_PVM30: hv_xen.XenPvmHypervisor, - constants.HT_XEN_HVM31: hv_xen.XenHvmHypervisor, + constants.HT_XEN_PVM: hv_xen.XenPvmHypervisor, + constants.HT_XEN_HVM: hv_xen.XenHvmHypervisor, constants.HT_FAKE: hv_fake.FakeHypervisor, constants.HT_KVM: hv_kvm.KVMHypervisor, }