The Modular L2 Plugin uses drivers to support separately extensible sets of network types and of mechanisms for accessing networks of those types. This is an initial implementation that has been tested with the openvswitch and linuxbridge agents, and should also work with the hyperv agent. See quantum/plugins/ml2/README for details. Implements: blueprint modular-l2 Change-Id: Ia8cae480180f0990af7d5e5e56f29eaeac205e0e
85 lines
2.8 KiB
Python
85 lines
2.8 KiB
Python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
|
#
|
|
# Copyright 2013 OpenStack Foundation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# 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.
|
|
#
|
|
|
|
"""ml2_initial
|
|
|
|
Revision ID: 5ac71e65402c
|
|
Revises: 32b517556ec9
|
|
Create Date: 2013-05-27 16:08:40.853821
|
|
|
|
"""
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = '5ac71e65402c'
|
|
down_revision = '32b517556ec9'
|
|
|
|
# Change to ['*'] if this migration applies to all plugins
|
|
|
|
migration_for_plugins = [
|
|
'quantum.plugins.ml2.plugin.Ml2Plugin'
|
|
]
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
|
|
|
|
from quantum.db import migration
|
|
|
|
|
|
def upgrade(active_plugin=None, options=None):
|
|
if not migration.should_run(active_plugin, migration_for_plugins):
|
|
return
|
|
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.create_table(
|
|
'ml2_network_segments',
|
|
sa.Column('id', sa.String(length=36), nullable=False),
|
|
sa.Column('network_id', sa.String(length=36), nullable=False),
|
|
sa.Column('network_type', sa.String(length=32), nullable=False),
|
|
sa.Column('physical_network', sa.String(length=64), nullable=True),
|
|
sa.Column('segmentation_id', sa.Integer(), nullable=True),
|
|
sa.ForeignKeyConstraint(['network_id'], ['networks.id'],
|
|
ondelete='CASCADE'),
|
|
sa.PrimaryKeyConstraint('id')
|
|
)
|
|
op.create_table(
|
|
'ml2_vlan_allocations',
|
|
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
|
sa.Column('vlan_id', sa.Integer(), autoincrement=False,
|
|
nullable=False),
|
|
sa.Column('allocated', sa.Boolean(), autoincrement=False,
|
|
nullable=False),
|
|
sa.PrimaryKeyConstraint('physical_network', 'vlan_id')
|
|
)
|
|
op.create_table(
|
|
'ml2_flat_allocations',
|
|
sa.Column('physical_network', sa.String(length=64), nullable=False),
|
|
sa.PrimaryKeyConstraint('physical_network')
|
|
)
|
|
### end Alembic commands ###
|
|
|
|
|
|
def downgrade(active_plugin=None, options=None):
|
|
if not migration.should_run(active_plugin, migration_for_plugins):
|
|
return
|
|
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
op.drop_table('ml2_network_segments')
|
|
op.drop_table('ml2_flat_allocations')
|
|
op.drop_table('ml2_vlan_allocations')
|
|
### end Alembic commands ###
|