constants.HV_VGA: hv_base.NO_CHECK,
constants.HV_KVM_EXTRA: hv_base.NO_CHECK,
constants.HV_KVM_MACHINE_VERSION: hv_base.NO_CHECK,
+ constants.HV_VNET_HDR: hv_base.NO_CHECK,
}
_VIRTIO = "virtio"
kvm_cmd.extend(["-uuid", instance.uuid])
if hvp[constants.HV_KVM_EXTRA]:
- kvm_cmd.extend([hvp[constants.HV_KVM_EXTRA]])
+ kvm_cmd.extend(hvp[constants.HV_KVM_EXTRA].split(" "))
# Save the current instance nics, but defer their expansion as parameters,
# as we'll need to generate executable temp files for them.
devlist = self._GetKVMOutput(kvm_path, self._KVMOPT_DEVICELIST)
if self._NEW_VIRTIO_RE.search(devlist):
nic_model = self._VIRTIO_NET_PCI
- vnet_hdr = True
+ vnet_hdr = up_hvp[constants.HV_VNET_HDR]
except errors.HypervisorError, _:
# Older versions of kvm don't support DEVICE_LIST, but they don't
# have new virtio syntax either.
else:
self.StopInstance(instance, force=True)
- def MigrateInstance(self, instance, target, live):
+ def MigrateInstance(self, cluster_name, instance, target, live):
"""Migrate an instance to a target node.
The migration will not be attempted if the instance is not
currently running.
+ @type cluster_name: string
+ @param cluster_name: name of the cluster
@type instance: L{objects.Instance}
@param instance: the instance to be migrated
@type target: string
@type hvparams: dict of strings
@param hvparams: hypervisor parameters, not used in this class
- @return: a dict with the following keys (values in MiB):
- - memory_total: the total memory size on the node
- - memory_free: the available memory on the node for instances
- - memory_dom0: the memory used by the node itself, if available
+ @return: a dict as returned by L{BaseHypervisor.GetLinuxNodeInfo} plus
+ the following keys:
- hv_version: the hypervisor version in the form (major, minor,
revision)
return result
@classmethod
- def GetInstanceConsole(cls, instance, hvparams, beparams):
+ def GetInstanceConsole(cls, instance, primary_node, hvparams, beparams):
"""Return a command for connecting to the console of an instance.
"""
"UNIX-CONNECT:%s" % cls._InstanceSerial(instance.name)]
return objects.InstanceConsole(instance=instance.name,
kind=constants.CONS_SSH,
- host=instance.primary_node,
+ host=primary_node.name,
user=constants.SSH_CONSOLE_USER,
command=cmd)