X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/702322d7606180cc222987a3c0ead4c1b8629b0f..4f6d95c91069c705c3dab0a56e00d9728796b084:/lib/hypervisor.py diff --git a/lib/hypervisor.py b/lib/hypervisor.py index c1de7a6..e6f7421 100644 --- a/lib/hypervisor.py +++ b/lib/hypervisor.py @@ -699,7 +699,14 @@ class XenHvmHypervisor(XenHypervisor): vif_data = [] for nic in instance.nics: - nic_str = "mac=%s, bridge=%s, type=ioemu" % (nic.mac, nic.bridge) + if instance.hvm_nic_type is None: # ensure old instances don't change + nic_type = ", type=ioemu" + elif instance.hvm_nic_type == constants.HT_HVM_DEV_PARAVIRTUAL: + nic_type = ", type=paravirtualized" + else: + nic_type = ", model=%s, type=ioemu" % instance.hvm_nic_type + + nic_str = "mac=%s, bridge=%s%s" % (nic.mac, nic.bridge, nic_type) ip = getattr(nic, "ip", None) if ip is not None: nic_str += ", ip=%s" % ip @@ -711,8 +718,14 @@ class XenHvmHypervisor(XenHypervisor): # from what Ganeti believes it should be. Different hypervisors may have # different requirements, so we should probably review the design of # storing it altogether, for the next major version. + if ((instance.hvm_disk_type is None) or + (instance.hvm_disk_type == constants.HT_HVM_DEV_IOEMU)): + disk_type = "ioemu:" + else: + disk_type = "" + disk_data = ["'phy:%s,%s,w'" % - (dev_path, iv_name.replace("sd", "ioemu:hd")) + (dev_path, iv_name.replace("sd", "%shd" % disk_type)) for dev_path, iv_name in block_devices] if instance.hvm_cdrom_image_path is None: