← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1288296] [NEW] Update aggregate allows duplicate names

 

Public bug reported:

The behaviour to manage naming conflicts is different between aggregate
creation and aggregate update.

Aggregate create doesn't let you create 2 aggregates with the same name.
Aggregate update lets you update an aggregate to a name that already exists.

It seems to me it should be consistent, and probably both check for
conflict.

Here's an example, using a recent devstack:

$ nova aggregate-create test
+----+------+-------------------+-------+----------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+-------+----------+
| 14 | test | -                 |       |          |
+----+------+-------------------+-------+----------+

$ nova aggregate-create test
ERROR: There was a conflict when trying to complete your request. (HTTP 409) (Request-ID: req-6711e05e-4efc-4a2d-9117-52d034c74a4f)

$ nova aggregate-create test2
+----+-------+-------------------+-------+----------+
| Id | Name  | Availability Zone | Hosts | Metadata |
+----+-------+-------------------+-------+----------+
| 15 | test2 | -                 |       |          |
+----+-------+-------------------+-------+----------+

$ nova aggregate-update 15 test
Aggregate 15 has been successfully updated.
+----+------+-------------------+-------+----------+
| Id | Name | Availability Zone | Hosts | Metadata |
+----+------+-------------------+-------+----------+
| 15 | test | -                 |       |          |
+----+------+-------------------+-------+----------+

$ nova aggregate-list
+----+--------------------+-------------------+
| Id | Name               | Availability Zone |
+----+--------------------+-------------------+
| 14 | test               | -                 |
| 15 | test               | -                 |
+----+--------------------+-------------------+


Nova api logs from when the aggregate creation fails as expected:
2014-04-05 14:45:34.865 INFO nova.api.openstack.compute.contrib.aggregates [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] Aggregate test already exists.
2014-04-05 14:45:34.865 INFO nova.api.openstack.wsgi [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] HTTP exception thrown: There was a conflict when trying to complete your request.
2014-04-05 14:45:34.865 DEBUG nova.api.openstack.wsgi [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] Returning 409 to user: There was a conflict when trying to complete your request. from (pid=1517) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1223

** Affects: nova
     Importance: Undecided
         Status: New

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

Title:
  Update aggregate allows duplicate names

Status in OpenStack Compute (Nova):
  New

Bug description:
  The behaviour to manage naming conflicts is different between
  aggregate creation and aggregate update.

  Aggregate create doesn't let you create 2 aggregates with the same name.
  Aggregate update lets you update an aggregate to a name that already exists.

  It seems to me it should be consistent, and probably both check for
  conflict.

  Here's an example, using a recent devstack:

  $ nova aggregate-create test
  +----+------+-------------------+-------+----------+
  | Id | Name | Availability Zone | Hosts | Metadata |
  +----+------+-------------------+-------+----------+
  | 14 | test | -                 |       |          |
  +----+------+-------------------+-------+----------+

  $ nova aggregate-create test
  ERROR: There was a conflict when trying to complete your request. (HTTP 409) (Request-ID: req-6711e05e-4efc-4a2d-9117-52d034c74a4f)

  $ nova aggregate-create test2
  +----+-------+-------------------+-------+----------+
  | Id | Name  | Availability Zone | Hosts | Metadata |
  +----+-------+-------------------+-------+----------+
  | 15 | test2 | -                 |       |          |
  +----+-------+-------------------+-------+----------+

  $ nova aggregate-update 15 test
  Aggregate 15 has been successfully updated.
  +----+------+-------------------+-------+----------+
  | Id | Name | Availability Zone | Hosts | Metadata |
  +----+------+-------------------+-------+----------+
  | 15 | test | -                 |       |          |
  +----+------+-------------------+-------+----------+

  $ nova aggregate-list
  +----+--------------------+-------------------+
  | Id | Name               | Availability Zone |
  +----+--------------------+-------------------+
  | 14 | test               | -                 |
  | 15 | test               | -                 |
  +----+--------------------+-------------------+

  
  Nova api logs from when the aggregate creation fails as expected:
  2014-04-05 14:45:34.865 INFO nova.api.openstack.compute.contrib.aggregates [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] Aggregate test already exists.
  2014-04-05 14:45:34.865 INFO nova.api.openstack.wsgi [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] HTTP exception thrown: There was a conflict when trying to complete your request.
  2014-04-05 14:45:34.865 DEBUG nova.api.openstack.wsgi [req-aeb307d4-c4c9-4684-8b13-1d81f0b8c692 admin demo] Returning 409 to user: There was a conflict when trying to complete your request. from (pid=1517) __call__ /opt/stack/nova/nova/api/openstack/wsgi.py:1223

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


Follow ups

References