Creating multiple instances with a single request when using cells creates wrong instance names

Bug #1533380 reported by Belmiro Moreira
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Andrey Volkov

Bug Description

When creating multiple instances with a single request the instance name has the format defined in the "multi_instance_display_name_template" option.
By default: multi_instance_display_name_template=%(name)s-%(count)d
When booting two instances (num-instances=2) with the name=test is expected to have the following instance names:
test-1
test-2

However, if using cells (only considering 2 levels) we have the following names:
test-1-1
test-1-2

Increasing the number of cell levels adds more hops in the instance name.
Changing the "multi_instance_display_name_template" to uuids has the same problem.
For example: (consider <uuid> a random uuid)
test-<uuid1>-<uuid1>
test-<uuid1>-<uuid2>

Changed in nova:
assignee: nobody → Belmiro Moreira (moreira-belmiro-email-lists)
description: updated
Revision history for this message
Andrew Laski (alaski) wrote :

The method _apply_instance_name_template which generates the display_name for multiple created instances takes the current display_name as input to the string substitution. A simple fix would be to guard against calling this method when in the api cell.

Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Sean Dague (sdague) wrote :

Please don't assign yourself a Nova bug without a patch posted. It prevents others from working on the bug.

Changed in nova:
status: Confirmed → Triaged
tags: added: low-hanging-fruit
Changed in nova:
assignee: Belmiro Moreira (moreira-belmiro-email-lists) → nobody
Changed in nova:
assignee: nobody → Anusha Unnam (anusha-unnam)
Changed in nova:
assignee: Anusha Unnam (anusha-unnam) → nobody
Revision history for this message
STEW TY (stewie925) wrote :

Hi Belmiro, I am an OpenStack newbie and thought I'd take a stab at this. I have installed devstack and was able to re-create the "test-1 and test-2 instance names" scenario by running 'nova boot --flavor <flavor> --image <image> --max-count 2 test'. I was not able to re-create the "test-1-1 and test-1-2" scenario. Would kindly like to ask what command format was executed to re-create this scenario?

Thank you.

Changed in nova:
assignee: nobody → Dharini Chandrasekar (dharini-chandrasekar)
assignee: Dharini Chandrasekar (dharini-chandrasekar) → nobody
STEW TY (stewie925)
Changed in nova:
assignee: nobody → STEW TY (stewie925)
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/319091

Changed in nova:
assignee: STEW TY (stewie925) → Andrey Volkov (avolkov)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

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

commit 00dc082699a6ca1e3e841bb092352e4f29a3b080
Author: Andrey Volkov <email address hidden>
Date: Thu May 19 18:20:17 2016 +0300

    Skip instance name templating in API cell

    There is a template called multi_instance_display_name_template
    which is used when a user creates multiple instances in one request.
    Template is used to assign display name to instance and
    by default looks like "%(name)s-%(count)d".

    If cells are enabled template was applied two or more times (in API cell
    and in child cell).

    Changes exclude template applying in API cell.
    Also tests are changed to check display name in default environment
    and cells environment.

    Change-Id: Ib6059dc17665a540916885b8d71d63bffeb6fca6
    Co-Authored-By: Andrew Laski <email address hidden>
    Closes-Bug: #1533380

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 14.0.0.0b3

This issue was fixed in the openstack/nova 14.0.0.0b3 development milestone.

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.