Esempio n. 1
0
def _add_updatable_args(parser):
    parser.add_argument(
        '--name',
        help=_('Name of this Tap flow.'))
    parser.add_argument(
        '--description',
        help=_('Description for this Tap flow.'))
Esempio n. 2
0
 def add_known_arguments(self, parser):
     _add_updatable_args(parser)
     parser.add_argument(
         '--port',
         dest='port_id',
         required=False,
         metavar="PORT",
         help=_('Port to which the Tap service is connected.'))
     parser.add_argument(
         '--erspan_dst_ip',
         dest='erspan_dst_ip',
         required=False,
         metavar="ERSPAN_DST_IP",
         help=_('Destination address of the ERSPAN tunnel.'))
Esempio n. 3
0
 def add_known_arguments(self, parser):
     _add_updatable_args(parser)
     parser.add_argument(
         '--port',
         dest='port_id',
         required=True,
         metavar="PORT",
         help=_('Port to which the Tap service is connected.'))
Esempio n. 4
0
 def add_known_arguments(self, parser):
     _add_updatable_args(parser)
     parser.add_argument(
         '--port',
         dest='port_id',
         required=True,
         metavar="PORT",
         help=_('Port to which the Tap service is connected.'))
Esempio n. 5
0
 def add_known_arguments(self, parser):
     _add_updatable_args(parser)
     parser.add_argument(
         '--port',
         required=True,
         metavar="SOURCE_PORT",
         help=_('Source port to which the Tap Flow is connected.'))
     parser.add_argument(
         '--tap-service',
         required=True,
         metavar="TAP_SERVICE",
         help=_('Tap Service to which the Tap Flow belongs.'))
     parser.add_argument('--direction',
                         required=True,
                         metavar="DIRECTION",
                         choices=['IN', 'OUT', 'BOTH'],
                         type=utils.convert_to_uppercase,
                         help=_('Direction of the Tap flow.'))
Esempio n. 6
0
 def add_known_arguments(self, parser):
     _add_updatable_args(parser)
     parser.add_argument(
         '--port',
         required=True,
         metavar="SOURCE_PORT",
         help=_('Source port to which the Tap Flow is connected.'))
     parser.add_argument(
         '--tap-service',
         required=True,
         metavar="TAP_SERVICE",
         help=_('Tap Service to which the Tap Flow belongs.'))
     parser.add_argument(
         '--direction',
         required=True,
         metavar="DIRECTION",
         choices=['IN', 'OUT', 'BOTH'],
         type=utils.convert_to_uppercase,
         help=_('Direction of the Tap flow.'))
     parser.add_argument(
         '--vlan-filter',
         required=False,
         metavar="VLAN_FILTER",
         help=_('VLAN Ids to be mirrored in the form of range string.'))
    def __init__(self, conf):

        LOG.debug("TaaS OVS Agent initialize called")

        self.conf = conf
        taas_driver_class_path = cfg.CONF.taas.driver
        self.taas_enabled = cfg.CONF.taas.enabled

        self.root_helper = config.get_root_helper(conf)

        try:
            self.taas_driver = importutils.import_object(
                taas_driver_class_path, self.root_helper)
            LOG.debug("TaaS Driver Loaded: '%s'", taas_driver_class_path)
        except ImportError:
            msg = _('Error importing TaaS device driver: %s')
            raise ImportError(msg % taas_driver_class_path)

        # setup RPC to msg taas plugin
        self.taas_plugin_rpc = TaasOvsPluginApi(topics.TAAS_PLUGIN, conf.host)
        super(TaasOvsAgentRpcCallback, self).__init__()

        return
Esempio n. 8
0
    # Neutron code prior to 7f23ccc (15th March 2017).
    from neutron.agent.common import config

from neutron.common import config as common_config
from neutron.common import rpc as n_rpc

from neutron_taas._i18n import _
from neutron_taas.common import topics
from neutron_taas.services.taas.agents.ovs import taas_ovs_agent


OPTS = [
    cfg.IntOpt(
        'taas_agent_periodic_interval',
        default=5,
        help=_('Seconds between periodic task runs')
    )
]


class TaaSOVSAgentService(n_rpc.Service):
    def start(self):
        super(TaaSOVSAgentService, self).start()
        self.tg.add_timer(
            cfg.CONF.taas_agent_periodic_interval,
            self.manager.periodic_tasks,
            None,
            None
        )

Esempio n. 9
0
                'type:values': direction_enum
            },
            'is_visible': True
        },
        'status': {
            'allow_post': False,
            'allow_put': False,
            'is_visible': True
        }
    }
}

taas_quota_opts = [
    cfg.IntOpt('quota_tap_service',
               default=1,
               help=_('Number of Tap Service instances allowed per tenant')),
    cfg.IntOpt('quota_tap_flow',
               default=10,
               help=_('Number of Tap flows allowed per tenant'))
]
cfg.CONF.register_opts(taas_quota_opts, 'QUOTAS')

TaasOpts = [
    cfg.StrOpt('driver', default='', help=_("Name of the TaaS Driver")),
    cfg.BoolOpt('enabled', default=False, help=_("Enable TaaS")),
    cfg.IntOpt('vlan_range_start',
               default=3900,
               help=_("Starting range of TAAS VLAN IDs")),
    cfg.IntOpt('vlan_range_end',
               default=4000,
               help=_("End range of TAAS VLAN IDs")),
Esempio n. 10
0
class TapServiceLimitReached(qexception.OverQuota):
    message = _("Reached the maximum quota for Tap Services")
Esempio n. 11
0
class TapServiceNotBelongToTenant(qexception.NotAuthorized):
    message = _("Specified Tap Service does not belong to the tenant")
Esempio n. 12
0
class PciDeviceNotFoundById(qexception.NotFound):
    message = _("PCI device %(id)s not found")
Esempio n. 13
0
def _add_updatable_args(parser):
    parser.add_argument('--name', help=_('Name of this Tap service.'))
    parser.add_argument('--description',
                        help=_('Description for this Tap service.'))
Esempio n. 14
0
class TapFlowNotFound(qexception.NotFound):
    message = _("Tap Flow  %(flow_id)s does not exist")
Esempio n. 15
0
class TapServiceNotFound(qexception.NotFound):
    message = _("Tap Service  %(tap_id)s does not exist")
Esempio n. 16
0
        'source_port': {'allow_post': True, 'allow_put': False,
                        'validate': {'type:uuid': None},
                        'required_by_policy': True, 'is_visible': True},
        'direction': {'allow_post': True, 'allow_put': False,
                      'validate': {'type:values': direction_enum},
                      'is_visible': True},
        'status': {'allow_post': False, 'allow_put': False,
                   'is_visible': True}
    }
}


taas_quota_opts = [
    cfg.IntOpt('quota_tap_service',
               default=1,
               help=_('Number of Tap Service instances allowed per tenant')),
    cfg.IntOpt('quota_tap_flow',
               default=10,
               help=_('Number of Tap flows allowed per tenant'))
]
cfg.CONF.register_opts(taas_quota_opts, 'QUOTAS')


TaasOpts = [
    cfg.StrOpt(
        'driver',
        default='',
        help=_("Name of the TaaS Driver")),
    cfg.BoolOpt(
        'enabled',
        default=False,
Esempio n. 17
0
class TapServiceInvalidParameters(qexception.NotFound):
    message = _("Either port_id or erspan_dst_ip needs to be specified")
Esempio n. 18
0
class PciSlotNotFound(qexception.NotFound):
    message = _("PCI slot (Port-id, MAC): %(port_id)s, %(mac)s not found")
Esempio n. 19
0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

from neutron_taas._i18n import _
from oslo_config import cfg
import oslo_messaging as messaging

from neutron.common import rpc as n_rpc

TaasOpts = [
    cfg.StrOpt('driver', default='', help=_("Name of the TaaS Driver")),
    cfg.BoolOpt('enabled', default=False, help=_("Enable TaaS")),
]
cfg.CONF.register_opts(TaasOpts, 'taas')


class TaasPluginApiMixin(object):

    # Currently there are no Calls the Agent makes towards the Plugin.

    def __init__(self, topic, host):
        self.host = host
        target = messaging.Target(topic=topic, version='1.0')
        self.client = n_rpc.get_client(target)
        super(TaasPluginApiMixin, self).__init__()
        return
Esempio n. 20
0
class InvalidSourcePort(qexception.NotFound):
    message = _("Source Port  %(port)s does not exist")
Esempio n. 21
0
class PortDoesNotBelongToTenant(qexception.NotAuthorized):
    message = _("The specified port does not belong to the tenant")
Esempio n. 22
0
class InvalidDestinationPort(qexception.NotFound):
    message = _("Destination Port %(port)s does not exist")
Esempio n. 23
0
class SriovNicSwitchDriverInvocationError(qexception.Invalid):
    message = _("Failed to invoke sys_fs command on driver, with following "
                "parameters: %(tap_service_pf_device)s, "
                "%(tap_service_vf_index)s, %(source_vf_index)s, "
                "%(common_vlans_ranges_str)s, %(vf_to_vf_all_vlans)s, "
                "%(direction)s")