NSX|V3+P: Do not set default Qos policy on external networks
Change-Id: I9cee1ac13f70268055eaa2598061a6e80b9c94cc
This commit is contained in:
parent
dcb586f893
commit
94bd8e335c
@ -1485,7 +1485,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
|
|||||||
|
|
||||||
def _update_qos_on_created_network(self, context, net_data, new_net):
|
def _update_qos_on_created_network(self, context, net_data, new_net):
|
||||||
qos_policy_id = qos_com_utils.set_qos_policy_on_new_net(
|
qos_policy_id = qos_com_utils.set_qos_policy_on_new_net(
|
||||||
context, net_data, new_net)
|
context, net_data, new_net, allow_external=True)
|
||||||
|
|
||||||
if qos_policy_id:
|
if qos_policy_id:
|
||||||
# update the QoS data on the backend
|
# update the QoS data on the backend
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from neutron_lib.api.definitions import external_net
|
||||||
|
from neutron_lib.api import validators
|
||||||
from neutron_lib.exceptions import qos as qos_exc
|
from neutron_lib.exceptions import qos as qos_exc
|
||||||
from neutron_lib.objects import registry as obj_reg
|
from neutron_lib.objects import registry as obj_reg
|
||||||
from neutron_lib.services.qos import constants as qos_consts
|
from neutron_lib.services.qos import constants as qos_consts
|
||||||
@ -76,14 +78,19 @@ def get_network_policy_id(context, net_id):
|
|||||||
return policy.id
|
return policy.id
|
||||||
|
|
||||||
|
|
||||||
def set_qos_policy_on_new_net(context, net_data, created_net):
|
def set_qos_policy_on_new_net(context, net_data, created_net,
|
||||||
|
allow_external=False):
|
||||||
"""Update the network with the assigned or default QoS policy
|
"""Update the network with the assigned or default QoS policy
|
||||||
|
|
||||||
Update the network-qos binding table, and the new network structure
|
Update the network-qos binding table, and the new network structure
|
||||||
"""
|
"""
|
||||||
qos_policy_id = net_data.get(qos_consts.QOS_POLICY_ID)
|
qos_policy_id = net_data.get(qos_consts.QOS_POLICY_ID)
|
||||||
if not qos_policy_id:
|
if not qos_policy_id:
|
||||||
# try and get the default one
|
# try and get the default qos policy. If the plugin does not allow
|
||||||
|
# qos on external networks, check it.
|
||||||
|
external = net_data.get(external_net.EXTERNAL)
|
||||||
|
is_external_net = validators.is_attr_set(external) and external
|
||||||
|
if allow_external or not is_external_net:
|
||||||
qos_obj = obj_reg.load_class('QosPolicyDefault').get_object(
|
qos_obj = obj_reg.load_class('QosPolicyDefault').get_object(
|
||||||
context, project_id=created_net['project_id'])
|
context, project_id=created_net['project_id'])
|
||||||
if qos_obj:
|
if qos_obj:
|
||||||
|
Loading…
Reference in New Issue
Block a user