from ganeti import errors # pylint: disable=W0611
from ganeti import utils
from ganeti import objects
+from ganeti import pathutils
from ganeti.hypervisor import hv_base
from ganeti.errors import HypervisorError
- instance alive check is based on whether any process is using the chroot
"""
- _ROOT_DIR = constants.RUN_DIR + "/chroot-hypervisor"
+ _ROOT_DIR = pathutils.RUN_DIR + "/chroot-hypervisor"
PARAMETERS = {
constants.HV_INIT_SCRIPT: (True, utils.IsNormAbsPath,
from ganeti import objects
from ganeti import uidpool
from ganeti import ssconf
-from ganeti.hypervisor import hv_base
from ganeti import netutils
+from ganeti import pathutils
+from ganeti.hypervisor import hv_base
from ganeti.utils import wrapper as utils_wrapper
-_KVM_NETWORK_SCRIPT = constants.SYSCONFDIR + "/ganeti/kvm-vif-bridge"
+_KVM_NETWORK_SCRIPT = pathutils.SYSCONFDIR + "/ganeti/kvm-vif-bridge"
_KVM_START_PAUSED_FLAG = "-S"
# TUN/TAP driver constants, taken from <linux/if_tun.h>
"""
CAN_MIGRATE = True
- _ROOT_DIR = constants.RUN_DIR + "/kvm-hypervisor"
+ _ROOT_DIR = pathutils.RUN_DIR + "/kvm-hypervisor"
_PIDS_DIR = _ROOT_DIR + "/pid" # contains live instances pids
_UIDS_DIR = _ROOT_DIR + "/uid" # contains instances reserved uids
_CTRL_DIR = _ROOT_DIR + "/ctrl" # contains instances control sockets
if nic.nicparams[constants.NIC_MODE] == constants.NIC_MODE_BRIDGED:
env["BRIDGE"] = nic.nicparams[constants.NIC_LINK]
- result = utils.RunCmd([constants.KVM_IFUP, tap], env=env)
+ result = utils.RunCmd([pathutils.KVM_IFUP, tap], env=env)
if result.failed:
raise errors.HypervisorError("Failed to configure interface %s: %s."
" Network configuration script output: %s" %
if hvp[constants.HV_KVM_SPICE_USE_TLS]:
spice_arg = ("%s,tls-port=%s,x509-cacert-file=%s" %
(spice_arg, instance.network_port,
- constants.SPICE_CACERT_FILE))
+ pathutils.SPICE_CACERT_FILE))
spice_arg = ("%s,x509-key-file=%s,x509-cert-file=%s" %
- (spice_arg, constants.SPICE_CERT_FILE,
- constants.SPICE_CERT_FILE))
+ (spice_arg, pathutils.SPICE_CERT_FILE,
+ pathutils.SPICE_CERT_FILE))
tls_ciphers = hvp[constants.HV_KVM_SPICE_TLS_CIPHERS]
if tls_ciphers:
spice_arg = "%s,tls-ciphers=%s" % (spice_arg, tls_ciphers)
"""
if hvparams[constants.HV_SERIAL_CONSOLE]:
- cmd = [constants.KVM_CONSOLE_WRAPPER,
+ cmd = [pathutils.KVM_CONSOLE_WRAPPER,
constants.SOCAT_PATH, utils.ShellQuote(instance.name),
utils.ShellQuote(cls._InstanceMonitor(instance.name)),
"STDIO,%s" % cls._SocatUnixConsoleParams(),
from ganeti.hypervisor import hv_base
from ganeti import netutils
from ganeti import objects
+from ganeti import pathutils
XEND_CONFIG_FILE = "/etc/xen/xend-config.sxp"
kind=constants.CONS_SSH,
host=instance.primary_node,
user=constants.GANETI_RUNAS,
- command=[constants.XM_CONSOLE_WRAPPER,
+ command=[pathutils.XM_CONSOLE_WRAPPER,
instance.name])
def Verify(self):
"""Xen HVM hypervisor interface"""
ANCILLARY_FILES = XenHypervisor.ANCILLARY_FILES + [
- constants.VNC_PASSWORD_FILE,
+ pathutils.VNC_PASSWORD_FILE,
]
ANCILLARY_FILES_OPT = XenHypervisor.ANCILLARY_FILES_OPT + [
- constants.VNC_PASSWORD_FILE,
+ pathutils.VNC_PASSWORD_FILE,
]
PARAMETERS = {