Ask Your Question
1

OverQuotaClient: Quota exceeded for resources: ['port']

asked 2016-04-15 03:29:39 -0500

vuhiep gravatar image

I using openstack network api to create network and router. then I want to attach that network to router: " def CreateRouter(self, router_name): self.neutron.format = 'json' request = {'router' : {'name' : router_name, 'admin_state_up' : True}} router = self.neutron.create_router(request) router_id = router['router']['id'] router = self.neutron.show_router(router_id) return router_id

def AddPort(self, router_id, network_id, ports):
    server_detail = router_id
    if server_detail != None:
        body_value = {'port' : {'admin_state_up' : True,
                                   'device_id' : router_id,
                                   'name' : 'port{0}'.format(ports),
                                   'network_id' : network_id}}
        response = self.neutron.create_port(body = body_value)
    return response
def CreateNetwork(self, course_id, network_name, subnets):
    data = {'network' : {'name' : utils.NET_NAME % (course_id, network_name), 
                         'admin_state_up' : True}}
    netw = self.neutron.create_network(body = data)
    net_dict = netw['network']
    network_id = net_dict['id']

    #Create subnets
    subnet_data = {'subnets' : []}
    subnet_data['subnets'].append({'cidr' : subnets,
                                    'ip_version' : 4,
                                    'network_id' : network_id})
    self.neutron.create_subnet(body = subnet_data)
    return network_id
    ##attach network to router
    response = net.AddPort(router_id = routerid, network_id = network, ports = name)

" when it run I get the error: OverQuotaClient: Quota exceeded for resources: ['port'] Neutron server returns request_ids: ['req-3b93501b-d4d0-46f1-90e7-80f5eb916b2d']

please teach me how to fix this, tks

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2016-04-15 10:09:59 -0500

dbaxps gravatar image

updated 2016-04-15 10:20:49 -0500

I would try as admin :-

neutron quota-update --tenant_id $CI_TENANT_ID --port 100

See
https://access.redhat.com/documentati...
Section "3.10.3.1. Basic quota configuration" in particular:-

neutron quota-show --tenant_id 6f88036c45344d9999a1f971e4882723
neutron quota-update --tenant_id 6f88036c45344d9999a1f971e4882723 --subnet 5 --port 20

Just try and see would it work for you or no.
Personally , I used only

openstack quota set --secgroup-rules 10000 --secgroups 1000 $CI_TENANT_ID

Openstack client worked for me ( forking SAHARA Cluster for non Vanilla plugins )
Ran a quick test

root@ip-192-169-142-127 ~(keystone_admin)]# openstack project list
+----------------------------------+----------+
| ID                               | Name     |
+----------------------------------+----------+
| d93cd65b9a074b878bb94a5efa993f3c | admin    |
| edf899e41b4546689a9678db4c8e7567 | demo     |
| f494b397a1474c0e92a72b01f9ed7932 | services |
+----------------------------------+----------+

[root@ip-192-169-142-127 ~(keystone_admin)]# neutron quota-show --tenant_id edf899e41b4546689a9678db4c8e7567

+---------------------+-------+
| Field               | Value |
+---------------------+-------+
| floatingip          | 50    |
| network             | 10    |
| port                | 50    |
| rbac_policy         | 10    |
| router              | 10    |
| security_group      | 10    |
| security_group_rule | 100   |
| subnet              | 10    |
| subnetpool          | -1    |
+---------------------+-------+

[root@ip-192-169-142-127 ~(keystone_admin)]# neutron quota-update --tenant_id edf899e41b4546689a9678db4c8e7567 --port 100

+---------------------+-------+
| Field               | Value |
+---------------------+-------+
| floatingip          | 50    |
| network             | 10    |
| port                | 100   |
| rbac_policy         | 10    |
| router              | 10    |
| security_group      | 10    |
| security_group_rule | 100   |
| subnet              | 10    |
| subnetpool          | -1    |
+---------------------+-------+

[root@ip-192-169-142-127 ~(keystone_admin)]# neutron quota-show --tenant_id edf899e41b4546689a9678db4c8e7567

+---------------------+-------+
| Field               | Value |
+---------------------+-------+
| floatingip          | 50    |
| network             | 10    |
| port                | 100   |
| rbac_policy         | 10    |
| router              | 10    |
| security_group      | 10    |
| security_group_rule | 100   |
| subnet              | 10    |
| subnetpool          | -1    |
+---------------------+-------+
edit flag offensive delete link more

Comments

Thank you. It work for me after I add more 50 port.

vuhiep gravatar imagevuhiep ( 2016-04-22 01:36:11 -0500 )edit

so I have one more question: I have many networks, when I launch a instance how can I assign it to what network I want? using libcloud api.

vuhiep gravatar imagevuhiep ( 2016-04-22 01:39:21 -0500 )edit

What is libcloud api ? I can do it via Python API or via Nova CLI

dbaxps gravatar imagedbaxps ( 2016-04-22 03:29:08 -0500 )edit

libcloud is a library to interactive with multi cloud platform (example amazon, openstack, ..). my project using this lib to launch instance(of course using python),I show code here: https://ask.openstack.org/en/question/91404/how-to-attach-instance-to-different-networks/ (https://ask.openstack.org/en/question...)

vuhiep gravatar imagevuhiep ( 2016-04-22 03:52:23 -0500 )edit

Sorry, I can only write it in Python via novaclient.v2 . See :-
http://dbaxps.blogspot.com/2016/02/py...

dbaxps gravatar imagedbaxps ( 2016-04-22 03:56:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2016-04-15 03:29:39 -0500

Seen: 5,428 times

Last updated: Apr 15 '16