max_net_count doesn't interact properly with min_count when booting multiple instances

Bug #1549032 reported by Chris Friesen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Chris Friesen
Liberty
Fix Released
Undecided
Unassigned

Bug Description

In compute.api.API._create_instance() we have a min_count that is optionally passed in by the end user as part of the boot request.

We calculate max_net_count based on networking constraints.

Currently we error out if max_net_count is zero, but we don't check it against min_count. If the end user specifies a min_count that is greater than the calculated max_net_count the resulting error isn't very useful.

We know that min_count is guaranteed to be at least 1, so we can replace the existing test against zero with one against min_count. Doing this gives a much more reasonable error message:

controller-0:~$ nova boot --image myimage --flavor simple --min-count 2 --max-count 3 test
ERROR (Forbidden): Maximum number of ports exceeded (HTTP 403) (Request-ID: req-f7ff28bf-5708-4cbf-a634-2e9686afd970)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/283861

Changed in nova:
assignee: nobody → Chris Friesen (cbf123)
status: New → In Progress
Matt Riedemann (mriedem)
tags: added: api
Changed in nova:
importance: Undecided → Medium
tags: added: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/283861
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e015a98b9e99dca7b97e97bb48af4392fd34dddb
Submitter: Jenkins
Branch: master

commit e015a98b9e99dca7b97e97bb48af4392fd34dddb
Author: Chris Friesen <email address hidden>
Date: Tue Feb 23 17:27:00 2016 -0600

    check max_net_count against min_count when booting

    If the user has specified a min_count when booting instances, and
    our calculated max_net_count is smaller than the specified min_count
    then we want to fail with an easily-interpreted error.

    Change-Id: I7f8bde68e315dc39942faff4065db927e477e1f1
    Closes-Bug: #1549032

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/nova 13.0.0.0rc1

This issue was fixed in the openstack/nova 13.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.