aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts/standalone/model.py
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/contexts/standalone/model.py')
-rw-r--r--yardstick/benchmark/contexts/standalone/model.py28
1 files changed, 22 insertions, 6 deletions
diff --git a/yardstick/benchmark/contexts/standalone/model.py b/yardstick/benchmark/contexts/standalone/model.py
index fa78fc1eb..a15426872 100644
--- a/yardstick/benchmark/contexts/standalone/model.py
+++ b/yardstick/benchmark/contexts/standalone/model.py
@@ -26,6 +26,7 @@ import xml.etree.ElementTree as ET
from yardstick import ssh
from yardstick.common import constants
from yardstick.common import exceptions
+from yardstick.common import utils as common_utils
from yardstick.common import yaml_loader
from yardstick.network_services.utils import PciAddress
from yardstick.network_services.helpers.cpu import CpuSysCores
@@ -45,7 +46,7 @@ VM_TEMPLATE = """
<vcpu cpuset='{cpuset}'>{vcpu}</vcpu>
{cputune}
<os>
- <type arch="x86_64" machine="pc-i440fx-xenial">hvm</type>
+ <type arch="x86_64" machine="{machine}">hvm</type>
<boot dev="hd" />
</os>
<features>
@@ -107,7 +108,7 @@ version: 2
ethernets:
ens3:
match:
- mac_address: {mac_address}
+ macaddress: {mac_address}
addresses:
- {ip_address}
EOF
@@ -161,7 +162,8 @@ class Libvirt(object):
return vm_pci
@classmethod
- def add_ovs_interface(cls, vpath, port_num, vpci, vports_mac, xml_str):
+ def add_ovs_interface(cls, vpath, port_num, vpci, vports_mac, xml_str,
+ queues):
"""Add a DPDK OVS 'interface' XML node in 'devices' node
<devices>
@@ -203,7 +205,7 @@ class Libvirt(object):
model.set('type', 'virtio')
driver = ET.SubElement(interface, 'driver')
- driver.set('queues', '4')
+ driver.set('queues', str(queues))
host = ET.SubElement(driver, 'host')
host.set('mrg_rxbuf', 'off')
@@ -305,6 +307,7 @@ class Libvirt(object):
cpuset = Libvirt.pin_vcpu_for_perf(connection, hw_socket)
cputune = extra_spec.get('cputune', '')
+ machine = extra_spec.get('machine_type', 'pc-i440fx-xenial')
mac = StandaloneContextHelper.get_mac_address(0x00)
image = cls.create_snapshot_qemu(connection, index,
flavor.get("images", None))
@@ -315,7 +318,8 @@ class Libvirt(object):
memory=memory, vcpu=vcpu, cpu=cpu,
numa_cpus=numa_cpus,
socket=socket, threads=threads,
- vm_image=image, cpuset=cpuset, cputune=cputune)
+ vm_image=image, cpuset=cpuset,
+ machine=machine, cputune=cputune)
# Add CD-ROM device
vm_xml = Libvirt.add_cdrom(cdrom_img, vm_xml)
@@ -551,6 +555,16 @@ class StandaloneContextHelper(object):
ip = cls.get_mgmt_ip(connection, node["mac"], mgmtip, node)
if ip:
node["ip"] = ip
+ client = ssh.SSH.from_node(node)
+ LOG.debug("OS version: %s",
+ common_utils.get_os_version(client))
+ LOG.debug("Kernel version: %s",
+ common_utils.get_kernel_version(client))
+ vnfs_data = common_utils.get_sample_vnf_info(client)
+ for vnf_name, vnf_data in vnfs_data.items():
+ LOG.debug("VNF name: '%s', commit ID/branch: '%s'",
+ vnf_name, vnf_data["branch_commit"])
+ LOG.debug("%s", vnf_data["md5_result"])
return nodes
@classmethod
@@ -564,12 +578,14 @@ class StandaloneContextHelper(object):
key_filename = ''.join(
[constants.YARDSTICK_ROOT_PATH,
'yardstick/resources/files/yardstick_key-',
- id_name])
+ id_name, '-', vm_name])
ssh.SSH.gen_keys(key_filename)
node['key_filename'] = key_filename
# Update image with public key
key_filename = node.get('key_filename')
ip_netmask = "{0}/{1}".format(node.get('ip'), node.get('netmask'))
+ ip_netmask = "{0}/{1}".format(node.get('ip'),
+ IPNetwork(ip_netmask).prefixlen)
Libvirt.gen_cdrom_image(connection, cdrom_img, vm_name, user_name, key_filename, mac,
ip_netmask)
return node