Trees | Indices | Help |
|
---|
|
KVM hypervisor
|
|||
|
|
|||
HeadRequest | |||
KVMHypervisor KVM hypervisor interface |
|
|||
|
|||
|
|||
|
|||
string |
|
||
dict |
|
||
|
|||
tuple |
|
||
tuple |
|
||
|
|
|||
psutil = None hash(x) |
|||
fdsend = None hash(x) |
|||
_KVM_NETWORK_SCRIPT = pathutils.CONF_DIR+ "/kvm-vif-bridge"
|
|||
_KVM_START_PAUSED_FLAG = "-S"
|
|||
_SPICE_ADDITIONAL_PARAMS = frozenset([constants.HV_KVM_SPICE_I SPICE parameters which depend on constants.HV_KVM_SPICE_BIND |
|||
_KVM_NICS_RUNTIME_INDEX = 1
|
|||
_KVM_DISKS_RUNTIME_INDEX = 3
|
|||
_DEVICE_RUNTIME_INDEX = {constants.HOTPLUG_TARGET_DISK: _KVM_D
|
|||
_FIND_RUNTIME_ENTRY = {constants.HOTPLUG_TARGET_NIC: lambda ni
|
|||
_RUNTIME_DEVICE = {constants.HOTPLUG_TARGET_NIC: lambda d: d,
|
|||
_RUNTIME_ENTRY = {constants.HOTPLUG_TARGET_NIC: lambda d, e: d
|
|||
_DEVICE_TYPE = {constants.HOTPLUG_TARGET_NIC: lambda hvp: hvp
|
|||
_DEVICE_DRIVER = {constants.HOTPLUG_TARGET_NIC: lambda ht: "vi
|
|||
_DEVICE_BUS = {constants.HOTPLUG_TARGET_NIC: lambda _: _PCI_BU
|
|||
_HOTPLUGGABLE_DEVICE_TYPES = {constants.HOTPLUG_TARGET_NIC: [c
|
|||
_PCI_BUS = "pci.0"
|
|||
_SCSI_BUS = "scsi.0"
|
|||
_MIGRATION_CAPS_DELIM = ":"
|
Imports: errno, os, re, tempfile, time, logging, pwd, shutil, urllib2, bitarray, utils, constants, errors, serializer, objects, uidpool, ssconf, netutils, pathutils, hv_base, utils_wrapper, QmpConnection, QmpMessage, MonitorSocket, OpenTap
|
Helper function to get the drive uri to be used in --drive kvm option Invoked during startup and disk hot-add. In latter case and if no userspace access mode is used it will be overriden with /dev/fdset/<fdset-id> (see HotAddDisk() and AddFd() of QmpConnection).
|
Helper function to generate a unique device name used by KVM QEMU monitor commands use names to identify devices. Since the UUID is too long for a device ID (36 chars vs. 30), we choose to use only the part until the third '-' with a disk/nic prefix. For example if a disk has UUID '932df160-7a22-4067-a566-7e0ca8386133' the resulting device ID would be 'disk-932df160-7a22-4067'.
|
Construct the -device option string for hvinfo dict PV disk: virtio-blk-pci,id=disk-1234,bus=pci.0,addr=0x9 PV NIC: virtio-net-pci,id=nic-1234,bus=pci.0,addr=0x9 SG disk: scsi-generic,id=disk-1234,bus=scsi.0,channel=0,scsi-id=1,lun=0
|
Helper function to generate hvinfo of a device (disk, NIC) hvinfo will hold all necessary info for generating the -device QEMU option. We have two main buses: a PCI bus and a SCSI bus (created by a SCSI controller on the PCI bus). In case of PCI devices we add them on a free PCI slot (addr) on the first PCI bus (pci.0), and in case of SCSI devices we decide to put each disk on a different SCSI target (scsi-id) on the first SCSI bus (scsi.0).
|
Helper function to get an existing device inside the runtime file Used when an instance is running. Load kvm runtime file and search for a device based on its type and uuid.
|
Upgrade runtime data Remove any deprecated fields or change the format of the data. The runtime files are not upgraded when Ganeti is upgraded, so the required modification have to be performed here.
|
Return runtime entries for a serialized runtime file
|
|
_SPICE_ADDITIONAL_PARAMSSPICE parameters which depend on constants.HV_KVM_SPICE_BIND
|
_DEVICE_RUNTIME_INDEX
|
_FIND_RUNTIME_ENTRY
|
_RUNTIME_DEVICE
|
_RUNTIME_ENTRY
|
_DEVICE_TYPE
|
_DEVICE_DRIVER
|
_DEVICE_BUS
|
_HOTPLUGGABLE_DEVICE_TYPES
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Apr 12 13:38:35 2016 | http://epydoc.sourceforge.net |