← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1467728] [NEW] Do not check neutron port quota in API layer

 

Public bug reported:

Now  neutron API does not provide reservation mechanism, so if a tenant has a large number of ports, in function validate_networks, 
'list_ports' will be very expensive, and port creation depends in some cases on mac addresses only available on the compute manager, so I think it is better to remove this check in function validate_networks:

def validate_networks(self, context, requested_networks, num_instances):
        ...
        neutron = get_client(context)
        ports_needed_per_instance = self._ports_needed_per_instance(
            context, neutron, requested_networks)
        if ports_needed_per_instance:
            ports = neutron.list_ports(tenant_id=context.project_id)['ports']
            quotas = neutron.show_quota(tenant_id=context.project_id)['quota']
            if quotas.get('port', -1) == -1:
                # Unlimited Port Quota
                return num_instances

** Affects: nova
     Importance: Undecided
     Assignee: shihanzhang (shihanzhang)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => shihanzhang (shihanzhang)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1467728

Title:
  Do not check neutron port quota in API layer

Status in OpenStack Compute (Nova):
  New

Bug description:
  Now  neutron API does not provide reservation mechanism, so if a tenant has a large number of ports, in function validate_networks, 
  'list_ports' will be very expensive, and port creation depends in some cases on mac addresses only available on the compute manager, so I think it is better to remove this check in function validate_networks:

  def validate_networks(self, context, requested_networks, num_instances):
          ...
          neutron = get_client(context)
          ports_needed_per_instance = self._ports_needed_per_instance(
              context, neutron, requested_networks)
          if ports_needed_per_instance:
              ports = neutron.list_ports(tenant_id=context.project_id)['ports']
              quotas = neutron.show_quota(tenant_id=context.project_id)['quota']
              if quotas.get('port', -1) == -1:
                  # Unlimited Port Quota
                  return num_instances

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1467728/+subscriptions


Follow ups

References