ITPub博客

首页 > 数据库 > > Quantum 数据库增加新表

Quantum 数据库增加新表

作者:gaokeke123 时间:2022-05-23 09:57:19 0 删除 编辑

本文地址: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

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26692020/viewspace-3127385/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: scalaris目录结构
请登录后发表评论 登录
全部评论
大家好

注册时间:2013-08-14

  • 博文量
    1432
  • 访问量
    31625