diff --git a/lib/hypervisor/hv_base.py b/lib/hypervisor/hv_base.py index 58db39599a3165d22317ed0f64445c642cb1df76..1465da2401a570e4232604403e295acca1d4dc45 100644 --- a/lib/hypervisor/hv_base.py +++ b/lib/hypervisor/hv_base.py @@ -101,10 +101,14 @@ class BaseHypervisor(object): - a function to check for parameter validity on the remote node, in the L{ValidateParameters} function - an error message for the above function + @type CAN_MIGRATE: boolean + @cvar CAN_MIGRATE: whether this hypervisor can do migration (either + live or non-live) """ PARAMETERS = {} ANCILLARY_FILES = [] + CAN_MIGRATE = False def __init__(self): pass diff --git a/lib/hypervisor/hv_fake.py b/lib/hypervisor/hv_fake.py index cea05d61ef7c2cdd8e629915cdf4d5e3b26c5b27..a97bebe299c502406e692cc712108b041882d9c6 100644 --- a/lib/hypervisor/hv_fake.py +++ b/lib/hypervisor/hv_fake.py @@ -40,6 +40,8 @@ class FakeHypervisor(hv_base.BaseHypervisor): a real virtualisation software installed. """ + CAN_MIGRATE = True + _ROOT_DIR = constants.RUN_DIR + "/ganeti-fake-hypervisor" def __init__(self): diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py index b311a8de5ed692796640f0a423a4c1aa19c04251..13c09ddce547c8bfb9da5f096075a97d58641afb 100644 --- a/lib/hypervisor/hv_kvm.py +++ b/lib/hypervisor/hv_kvm.py @@ -44,6 +44,7 @@ from ganeti.hypervisor import hv_base class KVMHypervisor(hv_base.BaseHypervisor): """KVM hypervisor interface""" + CAN_MIGRATE = True _ROOT_DIR = constants.RUN_GANETI_DIR + "/kvm-hypervisor" _PIDS_DIR = _ROOT_DIR + "/pid" # contains live instances pids diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py index 575e3b9404e990bd1de7589c1da3939ba8958897..a281e6a9b41d9434162a10847bfe010494b2e8f7 100644 --- a/lib/hypervisor/hv_xen.py +++ b/lib/hypervisor/hv_xen.py @@ -39,6 +39,7 @@ class XenHypervisor(hv_base.BaseHypervisor): all the functionality that is identical for both. """ + CAN_MIGRATE = True REBOOT_RETRY_COUNT = 60 REBOOT_RETRY_INTERVAL = 10