Quantum 数据库增加新表

2022-05-23 00:00:00 创建 数据库 专区 订阅 量子

本文地址:http://blog.csdn.net/spch2008/article/details/9011321

1. 创建代码ovs_qos_db.py

'''
Created on 2013-6-3
@author: spch2008
'''

from sqlalchemy import Column, Integer, String
from sqlalchemy.orm import exc
from quantum.db.models_v2 import model_base

class QoSPortBinding(model_base.BASEV2):
__tablename__ = 'ovs_qos_port_binding'

port_id = Column(String(20), primary_key=True)

qos_id = Column(String(20), primary_key=True)

def __init__(self, port_id, qos_id):
self.port_id = port_id
self.qos_id = qos_id

def __repr__(self):
return "<QoSPortBinding(%s, %s, %s)>" % (self.port_id, self.qos_id)

将代码置于/usr/share/pyshared/quantum/plugins/openvswitch# 中

2. 引入该模块
在/usr/share/pyshared/quantum/plugins/openvswitch#下的ovs_db_v2.py中,导入上述模块

from quantum.plugins.openvswitch import ovs_qos_db

3. 创建软连接

/usr/lib/python2.7/dist-packages/quantum/plugins/openvswitch# ln -s ../../../../../../share/pyshared/quantum/plugins/openvswitch/ovs_qos_db.py ovs_qos_db.py


4. 重启quantum-server

service quantum-server restart
————————————————
版权声明:本文为CSDN博主「普通网友」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/spch2008/article/details/9011321

相关文章