#look for dhcp ip address
r2, c2 = my.db.get_table(FROM="ports", SELECT=["mac", "net_id"], WHERE={"instance_id": new_instance})
- if r2 >0 and config_dic.get("dhcp_server"):
+ if r2 >0:
for iface in c2:
- if iface["net_id"] in config_dic["dhcp_nets"]:
+ if config_dic.get("dhcp_server") and iface["net_id"] in config_dic["dhcp_nets"]:
#print "dhcp insert add task"
r,c = config_dic['dhcp_thread'].insert_task("add", iface["mac"])
if r < 0:
- print ':http_post_servers ERROR UPDATING dhcp_server !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' + c
-
- #Start server
+ print ':http_post_servers ERROR UPDATING dhcp_server !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' + c
+
+ #ensure compute contain the bridge for ovs networks:
+ server_net = get_network_id(iface['net_id'])
+ if server_net["network"].get('provider:physical', "")[:3] == 'OVS':
+ vlan = str(server_net['network']['provider:vlan'])
+ config_dic['host_threads'][server['host_id']].insert_task("create-ovs-bridge-port", vlan)
+ #Start server
server['uuid'] = new_instance
- # server_start = server.get('start', 'yes')
- if config_dic['network_type'] == 'ovs':
- server_net = get_network_id(c2[0]['net_id'])
- vlan = str(server_net['network']['provider:vlan'])
- config_dic['host_threads'][server['host_id']].insert_task("create-ovs-bridge-port", vlan)
+ server_start = server.get('start', 'yes')
+
if server_start != 'no':
server['paused'] = True if server_start == 'paused' else False
server['action'] = {"start":None}
# if bridge_net==None:
# bottle.abort(HTTP_Bad_Request, "invalid 'provider:physical', bridge '%s' is not one of the provisioned 'bridge_ifaces' in the configuration file" % bridge_net_name)
# return
- elif config_dic['network_type'] == 'bridge' and net_type =='bridge_data' or net_type == 'bridge_man' :
+ elif config_dic['network_type'] == 'bridge' and ( net_type =='bridge_data' or net_type == 'bridge_man' ):
#look for a free precreated nets
for brnet in config_dic['bridge_nets']:
if brnet[3]==None: # free
if net_vlan < 0:
bottle.abort(HTTP_Internal_Server_Error, "Error getting an available vlan")
return
- if config_dic['network_type'] == 'ovs':
+ if net_provider == 'OVS':
net_provider = 'OVS' + ":" + str(net_vlan)
network['provider'] = net_provider
network_vlan_range_start: 3000
network_vlan_range_end: 4000
-# Network overlay supported by openvim compute, bsae on openvswicth or linux bridges to manage management networks for NFVs.
-# - ovs : Create a vlxan mesh between computes to handle the network overlay, no prepopulated bridges or networks is need it.
-# - bridge: Use pre-populate linux bridges by openvim configuration scripts.
-
+# Overlay network implementation. Options are:
+# - ovs : (by default) Use a vlxan mesh between computes to handle the network overlay.
+# - bridge: Use pre-populated linux bridges with L2 conectivity at compte nodes.
network_type : ovs
#host bridge interfaces for networks
-# Openvim cannot create bridge networks automatically, in the same way as other CMS do when network type is "bridge".
+# Apply only for 'network_type: bridge'
+# Indicates the bridges at compute nodes to be used for the overlay networks
# Bridge networks need to be pre-provisioned on each host and Openvim uses those pre-provisioned bridge networks.
# Openvim assumes that the following bridge interfaces have been created on each host, appropriately associated to a physical port.
# The following information needs to be provided: