Skip to content
Snippets Groups Projects
Commit d271c6fd authored by Iustin Pop's avatar Iustin Pop
Browse files

Add a hypervisor constant for migration support


This variable can be used by other tools to determine in a generic way
whether a given hypervisor supports migration or not.

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 96d1a0c5
No related branches found
No related tags found
No related merge requests found
...@@ -101,10 +101,14 @@ class BaseHypervisor(object): ...@@ -101,10 +101,14 @@ class BaseHypervisor(object):
- a function to check for parameter validity on the remote node, - a function to check for parameter validity on the remote node,
in the L{ValidateParameters} function in the L{ValidateParameters} function
- an error message for the above 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 = {} PARAMETERS = {}
ANCILLARY_FILES = [] ANCILLARY_FILES = []
CAN_MIGRATE = False
def __init__(self): def __init__(self):
pass pass
......
...@@ -40,6 +40,8 @@ class FakeHypervisor(hv_base.BaseHypervisor): ...@@ -40,6 +40,8 @@ class FakeHypervisor(hv_base.BaseHypervisor):
a real virtualisation software installed. a real virtualisation software installed.
""" """
CAN_MIGRATE = True
_ROOT_DIR = constants.RUN_DIR + "/ganeti-fake-hypervisor" _ROOT_DIR = constants.RUN_DIR + "/ganeti-fake-hypervisor"
def __init__(self): def __init__(self):
......
...@@ -44,6 +44,7 @@ from ganeti.hypervisor import hv_base ...@@ -44,6 +44,7 @@ from ganeti.hypervisor import hv_base
class KVMHypervisor(hv_base.BaseHypervisor): class KVMHypervisor(hv_base.BaseHypervisor):
"""KVM hypervisor interface""" """KVM hypervisor interface"""
CAN_MIGRATE = True
_ROOT_DIR = constants.RUN_GANETI_DIR + "/kvm-hypervisor" _ROOT_DIR = constants.RUN_GANETI_DIR + "/kvm-hypervisor"
_PIDS_DIR = _ROOT_DIR + "/pid" # contains live instances pids _PIDS_DIR = _ROOT_DIR + "/pid" # contains live instances pids
......
...@@ -39,6 +39,7 @@ class XenHypervisor(hv_base.BaseHypervisor): ...@@ -39,6 +39,7 @@ class XenHypervisor(hv_base.BaseHypervisor):
all the functionality that is identical for both. all the functionality that is identical for both.
""" """
CAN_MIGRATE = True
REBOOT_RETRY_COUNT = 60 REBOOT_RETRY_COUNT = 60
REBOOT_RETRY_INTERVAL = 10 REBOOT_RETRY_INTERVAL = 10
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment