← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1708961] Re: migration of single instance from multi-instance request spec fails with IndexError

 

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

commit 2bd7df84dcf8a45ce92b82f2360a1b39df522297
Author: Sylvain Bauza <sbauza@xxxxxxxxxx>
Date:   Mon Aug 7 13:03:37 2017 +0200

    Fix migrate single instance when it was created concurrently
    
    When a multiple-instance creation is requested by the user, we create a
    single RequestSpec per instance (each of them having the corresponding
    instance UUID) but we keep track of how many concurrent instances were
    created at once by updating a field named 'num_instances' and we persist
    it.
    
    Unfortunately, due to Ifc5cf482209e4f6f4e3e39b24389bd3563d86444 we now
    lookup that field in the scheduler for knowing how many allocations to
    do. Since a move operation will only pass a single instance UUID to
    migrate to the scheduler, there is a discrepancy that can lead to an
    ugly IndexError. Defaulting that loop to be what is passed over RPC
    unless we don't have it and then we default back to what we know from
    the RequestSpec record.
    
    Change-Id: If7da79356174be57481ef246618221e3b2ff8200
    Closes-Bug: #1708961


** Changed in: nova
       Status: In Progress => Fix Released

-- 
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/1708961

Title:
  migration of single instance from multi-instance request spec fails
  with IndexError

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Nova master, as of August 6th, 2017 (head is
  5971dde5d945bcbe1e81b87d342887abd5d2eece).

  If you make multiple instances from one request:

     openstack server create --flavor c1 --image $IMAGE --nic net-
  id=$NET_ID --min 5 --max 10 x2

  and then try to migrate just one of those instances:

     nova migrate --poll x2-1

  The API generates a 500 because there's an IndexError in the
  filter_scheduler, at line 190. `num_instances` is 9 and the loop
  continues after the first allocations are claimed. On the second loop
  `num` is one, but the list of instance_uuids is only one item long, so
  IndexError.

  At line 162 where num_instances is assigned we probably need to take
  the length of instance_uuids (if it is not None) instead the
  num_instances from the spec_obj.

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


References