From: Sumit Naiksatam Date: Tue, 30 Aug 2011 23:12:49 +0000 (-0700) Subject: Changes to incorporate earlier review comments, also for multiport resource X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=613a30b5a2df33568466800323b476ac3be8caa6;p=openstack-build%2Fneutron-build.git Changes to incorporate earlier review comments, also for multiport resource --- diff --git a/quantum/plugins/cisco/README b/quantum/plugins/cisco/README index ef8a49afb..29ebea720 100755 --- a/quantum/plugins/cisco/README +++ b/quantum/plugins/cisco/README @@ -84,11 +84,13 @@ Then run "yum install python-routes". Module Structure: ----------------- * quantum/plugins/cisco/ - Contains the L2-Network Plugin Framework + /client - CLI module for core and extensions /common - Modules common to the entire plugin /conf - All configuration files /db - Persistence framework /models - Class(es) which tie the logical abstractions to the physical topology + /nova - Scheduler and VIF-driver to be used by Nova /nexus - Nexus-specific modules /segmentation - Implementation of segmentation manager, e.g. VLAN Manager @@ -109,7 +111,7 @@ provider = quantum.plugins.cisco.l2network_plugin.L2Network Quantum-aware scheduler by editing the /etc/nova/nova.conf file with the following entries: ---scheduler_driver=quantum.plugins.cisco.nova.quantum_aware_scheduler.QuantumScheduler +--scheduler_driver=quantum.plugins.cisco.nova.quantum_port_aware_scheduler.QuantumPortAwareScheduler --quantum_host=127.0.0.1 --quantum_port=9696 --libvirt_vif_driver=quantum.plugins.cisco.nova.vifdirect.Libvirt802dot1QbhDriver @@ -187,7 +189,7 @@ password=mySecretPasswordForNexus 7. Configure the UCS systems' information in your deployment by editing the quantum/plugins/cisco/conf/ucs_inventory.ini file. You can configure multiple - UCSMs per deployment, multiple chasses per UCSM, and multiple blades per + UCSMs per deployment, multiple chassis per UCSM, and multiple blades per chassis. Chassis ID and blade ID can be obtained from the UCSM (they will typically numbers like 1, 2, 3, etc. diff --git a/quantum/plugins/cisco/client/cli.py b/quantum/plugins/cisco/client/cli.py index 834cef4d4..c1dee388c 100644 --- a/quantum/plugins/cisco/client/cli.py +++ b/quantum/plugins/cisco/client/cli.py @@ -124,15 +124,15 @@ def schedule_host(tenant_id, instance_id, user_id=None): print("Quantum service returned host: %s" % hostname) -def create_ports(tenant_id, net_id_list, *args): +def create_multiport(tenant_id, net_id_list, *args): """Creates ports on a single host""" net_list = net_id_list.split(",") ports_info = {'multiport': \ {'status': 'ACTIVE', 'net_id_list': net_list, - 'ports_desc': {}}} + 'ports_desc': {'key': 'value'}}} - request_url = "/multiport/create_ports" + request_url = "/multiport" client = Client(HOST, PORT, USE_SSL, format='json', tenant=tenant_id, action_prefix=ACTION_PREFIX_CSCO) data = client.do_request('POST', request_url, body=ports_info) @@ -141,8 +141,8 @@ def create_ports(tenant_id, net_id_list, *args): COMMANDS = { - "create_ports": { - "func": create_ports, + "create_multiport": { + "func": create_multiport, "args": ["tenant-id", "net-id-list (comma separated list of netword IDs)"]}, "list_extensions": { diff --git a/quantum/plugins/cisco/l2network_plugin.py b/quantum/plugins/cisco/l2network_plugin.py index 832c6c22d..8ffcdf84d 100644 --- a/quantum/plugins/cisco/l2network_plugin.py +++ b/quantum/plugins/cisco/l2network_plugin.py @@ -41,8 +41,9 @@ LOG.getLogger(const.LOGGER_COMPONENT_NAME) class L2Network(QuantumPluginBase): """ L2 Network Framework Plugin """ - supported_extension_aliases = ["Cisco Credential", "Cisco Port Profile", - "Cisco qos", "Cisco Nova Tenant"] + supported_extension_aliases = ["Cisco Multiport", "Cisco Credential", + "Cisco Port Profile", "Cisco qos", + "Cisco Nova Tenant"] def __init__(self): cdb.initialize() @@ -470,7 +471,7 @@ class L2Network(QuantumPluginBase): instance_id, instance_desc]) - def create_ports(self, tenant_id, net_id_list, port_state, ports_desc): + def create_multiport(self, tenant_id, net_id_list, port_state, ports_desc): """ Creates multiple ports on the specified Virtual Network. """ diff --git a/quantum/plugins/cisco/models/l2network_multi_blade.py b/quantum/plugins/cisco/models/l2network_multi_blade.py index 598c588c2..d74ac2d60 100644 --- a/quantum/plugins/cisco/models/l2network_multi_blade.py +++ b/quantum/plugins/cisco/models/l2network_multi_blade.py @@ -172,7 +172,7 @@ class L2NetworkMultiBlade(L2NetworkModelBase): return self._invoke_inventory(const.UCS_PLUGIN, self._func_name(), args) - def create_ports(self, args): + def create_multiport(self, args): """Support for extension API call""" self._invoke_plugin_per_device(const.UCS_PLUGIN, self._func_name(), args) diff --git a/quantum/plugins/cisco/models/l2network_single_blade.py b/quantum/plugins/cisco/models/l2network_single_blade.py index 3b0f62e31..5636c0665 100644 --- a/quantum/plugins/cisco/models/l2network_single_blade.py +++ b/quantum/plugins/cisco/models/l2network_single_blade.py @@ -163,7 +163,7 @@ class L2NetworkSingleBlade(L2NetworkModelBase): return self._invoke_inventory(const.UCS_PLUGIN, self._func_name(), args) - def create_ports(self, args): + def create_multiport(self, args): """Support for extension API call""" self._invoke_plugin_per_device(const.UCS_PLUGIN, self._func_name(), args) diff --git a/quantum/plugins/cisco/nova/quantum_aware_scheduler.py b/quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py similarity index 98% rename from quantum/plugins/cisco/nova/quantum_aware_scheduler.py rename to quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py index 4394980df..27b56bf97 100644 --- a/quantum/plugins/cisco/nova/quantum_aware_scheduler.py +++ b/quantum/plugins/cisco/nova/quantum_port_aware_scheduler.py @@ -43,7 +43,7 @@ CSCO_EXT_NAME = 'Cisco Nova Tenant' ACTION = '/schedule_host' -class QuantumScheduler(driver.Scheduler): +class QuantumPortAwareScheduler(driver.Scheduler): """ Quantum network service dependent scheduler Obtains the hostname from Quantum using an extension API diff --git a/quantum/plugins/cisco/ucs/cisco_ucs_inventory.py b/quantum/plugins/cisco/ucs/cisco_ucs_inventory.py index ccc409a2c..cb4ab9f4f 100644 --- a/quantum/plugins/cisco/ucs/cisco_ucs_inventory.py +++ b/quantum/plugins/cisco/ucs/cisco_ucs_inventory.py @@ -692,7 +692,7 @@ class UCSInventory(L2NetworkDeviceInventoryBase): LOG.debug("vif_desc is: %s" % vif_desc) return vif_desc - def create_ports(self, args): + def create_multiport(self, args): """ Create multiple ports for a VM """ diff --git a/quantum/plugins/cisco/ucs/cisco_ucs_plugin.py b/quantum/plugins/cisco/ucs/cisco_ucs_plugin.py index 7ce896549..1019413bc 100644 --- a/quantum/plugins/cisco/ucs/cisco_ucs_plugin.py +++ b/quantum/plugins/cisco/ucs/cisco_ucs_plugin.py @@ -297,7 +297,7 @@ class UCSVICPlugin(L2DevicePluginBase): self._ucsm_username = cred.Store.getUsername(conf.UCSM_IP_ADDRESS) self._ucsm_password = cred.Store.getPassword(conf.UCSM_IP_ADDRESS) - def create_ports(self, tenant_id, net_id_list, ports_num, port_id_list, + def create_multiport(self, tenant_id, net_id_list, ports_num, port_id_list, **kwargs): """ Creates a port on the specified Virtual Network.