Merge "Clean up Cisco plugin config parameters"

This commit is contained in:
Jenkins 2013-07-23 19:24:51 +00:00 committed by Gerrit Code Review
commit b5d1c993de
3 changed files with 49 additions and 55 deletions

View File

@ -1,30 +1,58 @@
[cisco_plugins] [cisco_plugins]
#nexus_plugin=neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
#vswitch_plugin=neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2 # (StrOpt) Period-separated module path to the plugin class to use for
# the Cisco Nexus switches.
#
# nexus_plugin = neutron.plugins.cisco.nexus.cisco_nexus_plugin_v2.NexusPlugin
# (StrOpt) Period-separated module path to the plugin class to use for
# the virtual switches on compute nodes.
#
# vswitch_plugin = neutron.plugins.openvswitch.ovs_neutron_plugin.OVSNeutronPluginV2
[cisco] [cisco]
#vlan_start=100
#vlan_end=3000
#vlan_name_prefix=q-
#max_ports=100
#max_port_profiles=65568
#max_networks=65568
#model_class=neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2
#manager_class=neutron.plugins.cisco.segmentation.l2network_vlan_mgr_v2.L2NetworkVLANMgr
#nexus_driver=neutron.plugins.cisco.test.nexus.fake_nexus_driver.CiscoNEXUSFakeDriver
#svi_round_robin=False
# IMPORTANT: Comment out the following two lines for production deployments
[cisco_test]
host=testhost
# (StrOpt) A short prefix to prepend to the VLAN number when creating a
# VLAN interface. For example, if an interface is being created for
# VLAN 2001 it will be named 'q-2001' using the default prefix.
# #
# Nexus Switch Format. # vlan_name_prefix = q-
# Example: vlan_name_prefix = vnet-
# (StrOpt) Period-separated module path to the model class to use for
# the Cisco neutron plugin.
#
# model_class = neutron.plugins.cisco.models.virt_phy_sw_v2.VirtualPhysicalSwitchModelV2
# (StrOpt) Period-separated module path to the driver class to use for
# the Cisco Nexus switches.
#
# If no value is configured, a fake driver will be used.
# nexus_driver = neutron.plugins.cisco.test.nexus.fake_nexus_driver.CiscoNEXUSFakeDriver
# With real hardware, use the CiscoNEXUSDriver class:
# nexus_driver = neutron.plugins.cisco.nexus.cisco_nexus_network_driver_v2.CiscoNEXUSDriver
# (BoolOpt) A flag to enable round robin scheduling of routers for SVI.
# svi_round_robin = False
# Cisco Nexus Switch configurations.
# Each switch to be managed by Openstack Neutron must be configured here.
#
# Cisco Nexus Switch Format.
# [NEXUS_SWITCH:<IP address of switch>] # [NEXUS_SWITCH:<IP address of switch>]
# <hostname>=<port> # <hostname>=<port> (1)
# ssh_port=<ssh port> # ssh_port=<ssh port> (2)
# username=<credential username> # username=<credential username> (3)
# password=<credential password> # password=<credential password> (4)
#
# (1) For each host connected to a port on the switch, specify the hostname
# and the Nexus physical port (interface) it is connected to.
# (2) The TCP port for connecting via SSH to manage the switch. This is
# port number 22 unless the switch has been configured otherwise.
# (3) The username for logging into the switch to manage it.
# (4) The password for logging into the switch to manage it.
# #
# Example: # Example:
# [NEXUS_SWITCH:1.1.1.1] # [NEXUS_SWITCH:1.1.1.1]

View File

@ -32,28 +32,14 @@ cisco_plugins_opts = [
cisco_opts = [ cisco_opts = [
cfg.StrOpt('vlan_start', default='100',
help=_("VLAN start value")),
cfg.StrOpt('vlan_end', default='3000',
help=_("VLAN end value")),
cfg.StrOpt('vlan_name_prefix', default='q-', cfg.StrOpt('vlan_name_prefix', default='q-',
help=_("VLAN Name prefix")), help=_("VLAN Name prefix")),
cfg.StrOpt('max_ports', default='100',
help=_("Maximum Port value")),
cfg.StrOpt('max_port_profiles', default='65568',
help=_("Maximum Port Profile value")),
cfg.StrOpt('max_networks', default='65568',
help=_("Maximum Network value")),
cfg.BoolOpt('svi_round_robin', default=False, cfg.BoolOpt('svi_round_robin', default=False,
help=_("Distribute SVI interfaces over all switches")), help=_("Distribute SVI interfaces over all switches")),
cfg.StrOpt('model_class', cfg.StrOpt('model_class',
default='neutron.plugins.cisco.models.virt_phy_sw_v2.' default='neutron.plugins.cisco.models.virt_phy_sw_v2.'
'VirtualPhysicalSwitchModelV2', 'VirtualPhysicalSwitchModelV2',
help=_("Model Class")), help=_("Model Class")),
cfg.StrOpt('manager_class',
default='neutron.plugins.cisco.segmentation.'
'l2network_vlan_mgr_v2.L2NetworkVLANMgr',
help=_("Manager Class")),
cfg.StrOpt('nexus_driver', cfg.StrOpt('nexus_driver',
default='neutron.plugins.cisco.test.nexus.' default='neutron.plugins.cisco.test.nexus.'
'fake_nexus_driver.CiscoNEXUSFakeDriver', 'fake_nexus_driver.CiscoNEXUSFakeDriver',

View File

@ -21,7 +21,6 @@ from sqlalchemy.orm import exc
from neutron.db import api as db from neutron.db import api as db
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.plugins.cisco.common import cisco_exceptions as c_exc from neutron.plugins.cisco.common import cisco_exceptions as c_exc
from neutron.plugins.cisco.common import config
from neutron.plugins.cisco.db import network_models_v2 from neutron.plugins.cisco.db import network_models_v2
from neutron.plugins.openvswitch import ovs_models_v2 from neutron.plugins.openvswitch import ovs_models_v2
@ -29,25 +28,6 @@ from neutron.plugins.openvswitch import ovs_models_v2
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
def create_vlanids():
"""Prepopulates the vlan_bindings table."""
LOG.debug(_("create_vlanids() called"))
session = db.get_session()
try:
vlanid = session.query(network_models_v2.VlanID).one()
except exc.MultipleResultsFound:
pass
except exc.NoResultFound:
start = int(config.CISCO.vlan_start)
end = int(config.CISCO.vlan_end)
while start <= end:
vlanid = network_models_v2.VlanID(start)
session.add(vlanid)
start += 1
session.flush()
return
def get_all_vlanids(): def get_all_vlanids():
"""Gets all the vlanids.""" """Gets all the vlanids."""
LOG.debug(_("get_all_vlanids() called")) LOG.debug(_("get_all_vlanids() called"))