From: mirabal Date: Fri, 26 May 2017 09:50:27 +0000 (+0200) Subject: Fix minor bug with bridge_data and ovs nets X-Git-Tag: v2.0.1~3 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=efc4d9792fe93ea72fa0acba22bd1fe5942ef5a6;p=osm%2Fopenvim.git Fix minor bug with bridge_data and ovs nets - bridge_data nets now create properly the linux bridge - fix minor vm naming issue Change-Id: I6ecb5d9e7445398634581a98543ddf8ffa985a24 Signed-off-by: mirabal --- diff --git a/osm_openvim/host_thread.py b/osm_openvim/host_thread.py index 1a03c7f..9fe5274 100644 --- a/osm_openvim/host_thread.py +++ b/osm_openvim/host_thread.py @@ -435,8 +435,7 @@ class host_thread(threading.Thread): if topo == None and 'metadata' in dev_list[0]: topo = dev_list[0]['metadata'].get('topology', None) #name - name = server.get('name','') + "_" + server['uuid'] - name = name[:58] #qemu impose a length limit of 59 chars or not start. Using 58 + name = server.get('name', '')[:28] + "_" + server['uuid'][:28] #qemu impose a length limit of 59 chars or not start. Using 58 text += self.inc_tab() + "" + name+ "" #uuid text += self.tab() + "" + server['uuid'] + "" diff --git a/osm_openvim/httpserver.py b/osm_openvim/httpserver.py index 43d11cf..8232df5 100644 --- a/osm_openvim/httpserver.py +++ b/osm_openvim/httpserver.py @@ -1649,14 +1649,13 @@ def http_post_server_id(tenant_id): if server_net["network"].get('provider:physical', "")[:3] == 'OVS': vlan = str(server_net['network']['provider:vlan']) dhcp_enable = bool(server_net['network']['enable_dhcp']) + vm_dhcp_ip = c2[0]["ip_address"] + config_dic['host_threads'][server['host_id']].insert_task("create-ovs-bridge-port", vlan) if dhcp_enable: dhcp_firt_ip = str(server_net['network']['dhcp_first_ip']) dhcp_last_ip = str(server_net['network']['dhcp_last_ip']) dhcp_cidr = str(server_net['network']['cidr']) gateway = str(server_net['network']['gateway_ip']) - vm_dhcp_ip = c2[0]["ip_address"] - config_dic['host_threads'][server['host_id']].insert_task("create-ovs-bridge-port", vlan) - set_mac_dhcp(vm_dhcp_ip, vlan, dhcp_firt_ip, dhcp_last_ip, dhcp_cidr, c2[0]['mac']) http_controller = config_dic['http_threads'][threading.current_thread().name] http_controller.ovim.launch_dhcp_server(vlan, dhcp_firt_ip, dhcp_last_ip, dhcp_cidr, gateway)