From 012e2db39f103293e140a11fbb6ac417538a3f78 Mon Sep 17 00:00:00 2001 From: Stepan Andrushko Date: Mon, 29 Oct 2018 21:32:44 +0200 Subject: Update: assign static IP to VM for standalone Updated cloud-init network file to be used on Ubuntu 16.04 and Ubuntu 18.04. Fields 'macaddress' and 'prefix' modified in network-config file. JIRA: YARDSTICK-1402 Change-Id: Ibe7fb9dbf23326a0a6106f98d3b2b9fedf81f79a Signed-off-by: Stepan Andrushko --- yardstick/benchmark/contexts/standalone/model.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'yardstick/benchmark/contexts/standalone/model.py') diff --git a/yardstick/benchmark/contexts/standalone/model.py b/yardstick/benchmark/contexts/standalone/model.py index 1004c62d1..ab5fec012 100644 --- a/yardstick/benchmark/contexts/standalone/model.py +++ b/yardstick/benchmark/contexts/standalone/model.py @@ -107,7 +107,7 @@ version: 2 ethernets: ens3: match: - mac_address: {mac_address} + macaddress: {mac_address} addresses: - {ip_address} EOF @@ -570,6 +570,8 @@ class StandaloneContextHelper(object): # 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 -- cgit 1.2.3-korg