Bay name should be a required option when creating a bay

Bug #1453732 reported by Haiwei Xu on 2015-05-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Shu Muto

Bug Description

If bay name is not set when creating a bay, bay name will be 'None'

Haiwei Xu (xu-haiwei) on 2015-05-11
summary: - Bay name should be a required option when creating a baymodel
+ Bay name should be a required option when creating a bay
Haiwei Xu (xu-haiwei) on 2015-05-11
Changed in magnum:
assignee: nobody → Haiwei Xu (xu-haiwei)
Steven Dake (sdake) on 2015-05-11
Changed in magnum:
status: New → Triaged
importance: Undecided → Medium
Adrian Otto (aotto) wrote :

Why is this a bug? Is there some reason that a Bay name must exist? What is that reason?

Perhaps there is a use case for using a Bay, but referring to it only by its UUID. In that case, the name should not be needed, right?

Steven Dake (sdake) wrote :

The bay name is used to identify for the user the bay. If the bay name is duplicated, than accessing the bay by uuid is the only optoin. This matches other OpenStack services.

Haiwei Xu (xu-haiwei) wrote :

Adrian Otto,

Yes, without a bay name user can refer to the bay by UUID. But when creating many bays if user forgot to assign a name, it's difficult to differentiate the bays by UUID. And like other openstack service(e.x nova boot) name is also required.

Good discussion here. After twice thinking, seems adding name can make the bay/baymodel more readable.

The concept in magnum can be mapped to nova as following:

1) instance => bay
2) flavor => baymodel

So I think that a solution might be as following:
1) Make name as a MUST for both bay/baymodel
2) Update magnum client to use following style for bay-create and baymodel-create: DO NOT add "--name" option

Please show your comments if any. Thanks.

root@devstack007:/tmp# nova boot
usage: nova boot [--flavor <flavor>] [--image <image>]
                 [--image-with <key=value>] [--boot-volume <volume_id>]
                 [--snapshot <snapshot_id>] [--min-count <number>]
                 [--max-count <number>] [--meta <key=value>]
                 [--file <dst-path=src-path>] [--key-name <key-name>]
                 [--user-data <user-data>]
                 [--availability-zone <availability-zone>]
                 [--security-groups <security-groups>]
                 [--block-device-mapping <dev-name=mapping>]
                 [--block-device key1=value1[,key2=value2...]]
                 [--swap <swap_size>]
                 [--ephemeral size=<size>[,format=<format>]]
                 [--hint <key=value>]
                 [--nic <net-id=net-uuid,v4-fixed-ip=ip-addr,v6-fixed-ip=ip-addr,port-id=port-uuid>]
                 [--config-drive <value>] [--poll]
error: too few arguments
Try 'nova help boot' for more information.
root@devstack007:/tmp# nova flavor-create
usage: nova flavor-create [--ephemeral <ephemeral>] [--swap <swap>]
                          [--rxtx-factor <factor>] [--is-public <is-public>]
                          <name> <id> <ram> <disk> <vcpus>

Haiwei Xu (xu-haiwei) wrote :


A good suggestion. Even if leave 'name' optional, It's better make it blank rather than 'None' if don't give name option, just like 'glance image-create'.

Madhuri Kumari (madhuri-rai07) wrote :

I don't think name should be made mandatory as we have UUID to do operations.

But a point here, in case user doesn't pass name while creating a bay, the bay-list displays the bay with name 'None' which doesn't make any sense to user.

$ magnum bay-list
| uuid | name | node_count | status |
| 7be4a7a9-9685-46b3-8f8b-7f19a02c644e | None | 1 | CREATE_COMPLETE |
| 7d59afb0-1c24-4cae-93fc-4692f5438d34 | bay1 | 1 | CREATE_COMPLETE |
| 972a7a42-2d77-4eac-a7ba-beeee8939a98 | None | 1 | CREATE_IN_PROGRESS |

$ magnum bay-show None
ERROR: Bay None could not be found. (HTTP 404)

Rather the 'name' field here should be empty.

Digambar (digambarpatil15) wrote :

@sdake, jay - Yes, bay/Baymodel name should be "MUST". It should be empty like madhuri posted above. When multiple bay name found, we can use UUID like other openstack services.

Adrian Otto (aotto) wrote :

I am not convinced that a name is required. We allow acting on these resources using UUID values. Names are a convenience, and therefore should not be required.

Unique naming is another issue. I'd prefer not to require unique names either. If a user acts on a bay or baymodel by name, and there are multiple matches, raise an error, and require a UUID to identify the resource to act on.

Change abandoned by xu-haiwei (<email address hidden>) on branch: master

Haiwei Xu (xu-haiwei) on 2015-08-18
Changed in magnum:
assignee: Haiwei Xu (xu-haiwei) → nobody
Adrian Otto (aotto) on 2015-11-24
Changed in magnum:
milestone: none → mitaka-1
Shu Muto (shu-mutou) on 2016-01-20
Changed in magnum-ui:
assignee: nobody → Shu Muto (shu-mutou)
status: New → In Progress
Shu Muto (shu-mutou) on 2016-01-20
no longer affects: magnum-ui
Eli Qiao (taget-9) on 2016-03-06
Changed in magnum:
assignee: nobody → Eli Qiao (taget-9)
Changed in magnum:
status: Triaged → Fix Released
Eli Qiao (taget-9) on 2016-05-04
Changed in magnum:
assignee: Eli Qiao (taget-9) → Shu Muto (shu-mutou)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints