From: Edgar Magana Date: Tue, 2 Aug 2011 01:32:25 +0000 (-0700) Subject: Including a flag to activate the NX-OS driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5c0dbe9aee15c403910bf7c0deb7eb92f18d0967;p=openstack-build%2Fneutron-build.git Including a flag to activate the NX-OS driver Updating the README documentation --- diff --git a/quantum/plugins/cisco/README b/quantum/plugins/cisco/README index 2672675cd..b77ce22ca 100644 --- a/quantum/plugins/cisco/README +++ b/quantum/plugins/cisco/README @@ -38,14 +38,10 @@ ucs/cisco_ucs_plugin.py common/cisco_utils.py __init__.py ucs/get-vif.sh -* Configure the L2 Network Pllugin: +* Configure the L2 Network Plugin: + In cisco_configuration.py, - change the UCSM IP in the following statement to your UCSM IP flags.DEFINE_string('ucsm_ip_address', "172.20.231.27", 'IP address of UCSM') - - change the NEXUS 7K IP in the following statement to your N7K Switch IP - flags.DEFINE_string('nexus_ip_address', "172.20.231.61", 'IP address of N7K') - - change the NEXUS Interface in the following statement to the interface number in your N7K which is connected to your UCSM UpLink port - flags.DEFINE_string('nexus_port', "3/23", 'Port number of the Interface connected from the Nexus 7K Switch to UCSM 6120') - change the Nova MySQL DB IP if you are running Quantum on a different host than the OpenStack Cloud Controller (in other words you do not need to change the IP if Quantum is running on the same host on which the Nova DB is running). DB IP is changed in the following statement: flags.DEFINE_string('db_server_ip', "127.0.0.1", 'IP address of nova DB server') - change the hostname of the OpenStack Cloud Controller below @@ -62,6 +58,24 @@ ucs/get-vif.sh flags.DEFINE_string('profile_name_prefix', "q-", 'Prefix of the name given to the port profile') - Change the path to reflect the location of the get-vif.sh script, if you have followed the instructions in this README, this location should be the same as that of your other plugin modules flags.DEFINE_string('get_next_vif', "/root/sumit/quantum/quantum/plugins/cisco/get-vif.sh", 'This is the location of the script to get the next available dynamic nic') + + + In cisco_credentials.py, + - Change the following structure to reflect the correct UCS, N7K and Nova DB details. Your UCSM_IP_ADDRESS has to match the ucsmm_ip_addresss which you provided in the cisco_configuration file earlier. Similarly, your NOVA_DATABSE_IP has to match the db_server_ip which you provided earlier. DB_USERNAME and DB_PASSWORD are those which you provided for the Nova MySQL DB when you setup OpenStack + N7K_IP_ADDRESS has to match with your Nexus 7k switch IP Address, N7K_USERNAME is the administrator user-name and N7K_PASSWORD is the password. + _creds_dictionary = { + 'UCSM_IP_ADDRESS':["UCSM_USERNAME", "UCSM_PASSWORD"], + 'NOVA_DATABASE_IP':["DB_USERNAME", "DB_PASSWORD"] + } + +* Configure the L2 Network Plugin with Nexus OS Driver for testing VLANs CRUD on Nexus 7k Switch. Making these changes requires one Nexus 7K Switch connected to the UCSM and the ncclient patch not just the regular library, otherwise the system will fail. + + In cisco_configuration.py, + - change the NEXUS 7K IP in the following statement to your N7K Switch IP + flags.DEFINE_string('nexus_ip_address', "172.20.231.61", 'IP address of N7K') + - change the NEXUS Interface in the following statement to the interface number in your N7K which is connected to your UCSM UpLink port + flags.DEFINE_string('nexus_port', "3/23", 'Port number of the Interface connected from the Nexus 7K Switch to UCSM 6120') + - change NEXUS Driver Flag to "on" in the following statement + flags.DEFINE_string('nexus_driver_active', "off", 'Flag to activate Nexus OS Driver') + + In cisco_credentials.py, - Change the following structure to reflect the correct UCS, N7K and Nova DB details. Your UCSM_IP_ADDRESS has to match the ucsmm_ip_addresss which you provided in the cisco_configuration file earlier. Similarly, your NOVA_DATABSE_IP has to match the db_server_ip which you provided earlier. DB_USERNAME and DB_PASSWORD are those which you provided for the Nova MySQL DB when you setup OpenStack N7K_IP_ADDRESS has to match with your Nexus 7k switch IP Address, N7K_USERNAME is the administrator user-name and N7K_PASSWORD is the password. @@ -70,6 +84,7 @@ ucs/get-vif.sh 'N7K_IP_ADDRESS':["N7K_USERNAME", "N7K_PASSWORD"], 'NOVA_DATABASE_IP':["DB_USERNAME", "DB_PASSWORD"] } + * Start the Quantum service ** Additional installation required on Nova Compute: diff --git a/quantum/plugins/cisco/common/cisco_configuration.py b/quantum/plugins/cisco/common/cisco_configuration.py index 12ca0d428..01762e5fa 100644 --- a/quantum/plugins/cisco/common/cisco_configuration.py +++ b/quantum/plugins/cisco/common/cisco_configuration.py @@ -31,6 +31,8 @@ flags.DEFINE_string('nexus_ip_address', "172.20.231.61", 'IP address of \ Nexus Switch') flags.DEFINE_string('nexus_port', "3/23", 'Port number of the Interface \ connected from the Nexus Switch to UCSM 6120') +flags.DEFINE_string('nexus_driver_active', "off", 'Flag to activate Nexus OS\ + Driver') flags.DEFINE_string('db_server_ip', "127.0.0.1", 'IP address of nova DB \ server') flags.DEFINE_string('nova_host_name', "openstack-0203", 'nova cloud \ @@ -74,6 +76,7 @@ flags.DEFINE_string('get_next_vif', # Inventory items UCSM_IP_ADDRESS = FLAGS.ucsm_ip_address NEXUS_IP_ADDRESS = FLAGS.nexus_ip_address +NEXUS_DRIVER_ACTIVE = FLAGS.nexus_driver_active NEXUS_PORT = FLAGS.nexus_port DB_SERVER_IP = FLAGS.db_server_ip NOVA_HOST_NAME = FLAGS.nova_host_name diff --git a/quantum/plugins/cisco/l2network_plugin.py b/quantum/plugins/cisco/l2network_plugin.py index 8be63bb06..9a8c4a4f0 100644 --- a/quantum/plugins/cisco/l2network_plugin.py +++ b/quantum/plugins/cisco/l2network_plugin.py @@ -15,6 +15,7 @@ # under the License. # # @author: Sumit Naiksatam, Cisco Systems, Inc. +# @author: Edgar Magana, Cisco Systems, Inc. # import logging as LOG @@ -65,8 +66,13 @@ class L2Network(object): new_net_id = self._get_unique_net_id(tenant_id) vlan_id = self._get_vlan_for_tenant(tenant_id, net_name) vlan_name = self._get_vlan_name(new_net_id, str(vlan_id)) - self._nexus_plugin.create_network(tenant_id, net_name, new_net_id, + nexus_driver_flag = conf.NEXUS_DRIVER_ACTIVE + if nexus_driver_flag == 'on': + LOG.debug("Nexus OS Driver called\n") + self._nexus_plugin.create_network(tenant_id, net_name, new_net_id, vlan_name, vlan_id) + else: + LOG.debug("No Nexus OS Driver available\n") self._ucs_plugin.create_network(tenant_id, net_name, new_net_id, vlan_name, vlan_id) new_net_dict = {const.NET_ID: new_net_id, @@ -88,12 +94,17 @@ class L2Network(object): """ LOG.debug("delete_network() called\n") net = self._networks.get(net_id) + nexus_driver_flag = conf.NEXUS_DRIVER_ACTIVE # TODO (Sumit) : Verify that no attachments are plugged into the # network if net: # TODO (Sumit) : Before deleting the network, make sure all the # ports associated with this network are also deleted - self._nexus_plugin.delete_network(tenant_id, net_id) + if nexus_driver_flag == 'on': + LOG.debug("Nexus OS Driver called\n") + self._nexus_plugin.delete_network(tenant_id, net_id) + else: + LOG.debug("No Nexus OS Driver available\n") self._ucs_plugin.delete_network(tenant_id, net_id) self._networks.pop(net_id) tenant = self._get_tenant(tenant_id) @@ -118,7 +129,12 @@ class L2Network(object): Virtual Network. """ LOG.debug("rename_network() called\n") - self._nexus_plugin.rename_network(tenant_id, net_id) + nexus_driver_flag = conf.NEXUS_DRIVER_ACTIVE + if nexus_driver_flag == 'on': + LOG.debug("Nexus OS Driver called\n") + self._nexus_plugin.rename_network(tenant_id, net_id) + else: + LOG.debug("No Nexus OS Driver available\n") self._ucs_plugin.rename_network(tenant_id, net_id) network = self._get_network(tenant_id, net_id) network[const.NET_NAME] = new_name diff --git a/quantum/plugins/cisco/nexus/cisco_nexus_plugin.py b/quantum/plugins/cisco/nexus/cisco_nexus_plugin.py index 4d8cfa654..349a69ca5 100644 --- a/quantum/plugins/cisco/nexus/cisco_nexus_plugin.py +++ b/quantum/plugins/cisco/nexus/cisco_nexus_plugin.py @@ -98,6 +98,7 @@ class NexusPlugin(object): Updates the symbolic name belonging to a particular Virtual Network. """ + #TODO (Edgar) We need to add an update method in the Nexus Driver LOG.debug("NexusPlugin:rename_network() called\n") network = self._get_network(tenant_id, net_id) network[const.NET_NAME] = new_name