aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
diff options
context:
space:
mode:
authorStepan Andrushko <stepanx.andrushko@intel.com>2018-06-27 21:43:18 +0300
committerStepan Andrushko <stepanx.andrushko@intel.com>2018-08-23 12:24:22 +0300
commit39bcfa45da62a3126ad2a2290aaaa0670e8c5cb0 (patch)
treeeac9695b5bf4a93503e7755274c266de41d6625c /yardstick/benchmark/contexts/standalone/ovs_dpdk.py
parentc6175b5bc59706c3a423fe2781f99e32930bb570 (diff)
Provide access to VM in Standalone context
Add possibility to access VM with SampleVNF image, which is spawned on baremetal server using password or key pairs (provided or generated). Changes provided for OVS-DPDK and SRIOV cases. JIRA: YARDSTICK-1260 Change-Id: I89cf17dc83f02abe23d206b24b9d0ec1298d3231 Signed-off-by: Stepan Andrushko <stepanx.andrushko@intel.com>
Diffstat (limited to 'yardstick/benchmark/contexts/standalone/ovs_dpdk.py')
-rw-r--r--yardstick/benchmark/contexts/standalone/ovs_dpdk.py25
1 files changed, 17 insertions, 8 deletions
diff --git a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
index 88ad598c3..5891f798e 100644
--- a/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
+++ b/yardstick/benchmark/contexts/standalone/ovs_dpdk.py
@@ -394,13 +394,14 @@ class OvsDpdkContext(base.Context):
for index, (key, vnf) in enumerate(collections.OrderedDict(
self.servers).items()):
cfg = '/tmp/vm_ovs_%d.xml' % index
- vm_name = "vm_%d" % index
+ vm_name = "vm-%d" % index
+ cdrom_img = "/var/lib/libvirt/images/cdrom-%d.img" % index
# 1. Check and delete VM if already exists
model.Libvirt.check_if_vm_exists_and_delete(vm_name,
self.connection)
xml_str, mac = model.Libvirt.build_vm_xml(
- self.connection, self.vm_flavor, vm_name, index)
+ self.connection, self.vm_flavor, vm_name, index, cdrom_img)
# 2: Cleanup already available VMs
for vfs in [vfs for vfs_name, vfs in vnf["network_ports"].items()
@@ -411,16 +412,24 @@ class OvsDpdkContext(base.Context):
model.Libvirt.write_file(cfg, xml_str)
self.connection.put(cfg, cfg)
+ node = self.vnf_node.generate_vnf_instance(self.vm_flavor,
+ self.networks,
+ self.host_mgmt.get('ip'),
+ key, vnf, mac)
+ # Generate public/private keys if password or private key file is not provided
+ node = model.StandaloneContextHelper.check_update_key(self.connection,
+ node,
+ vm_name,
+ self.name,
+ cdrom_img)
+
+ # store vnf node details
+ nodes.append(node)
+
# NOTE: launch through libvirt
LOG.info("virsh create ...")
model.Libvirt.virsh_create_vm(self.connection, cfg)
self.vm_names.append(vm_name)
- # build vnf node details
- nodes.append(self.vnf_node.generate_vnf_instance(self.vm_flavor,
- self.networks,
- self.host_mgmt.get('ip'),
- key, vnf, mac))
-
return nodes