nova-manage creation flavor shouldn't require a flavorid

Bug #1043410 reported by Adrien Cunin
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Adrien Cunin

Bug Description

It's possible to specify a flavorid using --flavor=... (which is a different thing than the auto-incremented id in the DB) when creating a flavor but I think it shouldn't be required. If nothing is specified it could be automatically generated.

$ nova-manage flavor create --name=test --memory=512 --cpu=1 --root_gb=0 --ephemeral_gb=0
Possible wrong number of arguments supplied
Creates instance types / flavors
[...]
TypeError: create() takes at least 7 arguments (6 given)

Expected:
$ nova-manage flavor create --name=test --memory=512 --cpu=1 --root_gb=0 --ephemeral_gb=0
[...]
test created

Revision history for this message
Adrien Cunin (adri2000) wrote :

(Sorry I filed this against ubuntu/nova instead of nova.)

affects: nova (Ubuntu) → nova
Adrien Cunin (adri2000)
Changed in nova:
status: New → In Progress
Revision history for this message
Adrien Cunin (adri2000) wrote :

As this is my first patch for OpenStack and the CLA stuff is not ready yet, I can't push it to Gerrit, so I'm attaching it here if anyone would like to have a look already. Thanks.

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

Revision history for this message
Mark McLoughlin (markmc) wrote :

This makes sense to me, but I think we should also make flavorid optional when creating a flavor through the REST API

summary: - nova-manage create flavor shouldn't require a flavorid
+ nova-manage creation flavor shouldn't require a flavorid
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/12308
Committed: http://github.com/openstack/nova/commit/daf0681f064cf1de54f9c91f44737c31bf196d92
Submitter: Jenkins
Branch: master

commit daf0681f064cf1de54f9c91f44737c31bf196d92
Author: Adrien Cunin <email address hidden>
Date: Tue Sep 4 15:47:34 2012 +0200

    Generate a flavorid if needed at flavor creation

    When creating a new flavor, it's now possible to omit flavorid. In this
    case it will be automatically generated using utils.gen_uuid().
    nova-manage and OS API updated accordingly.

    Fixes: bug #1043410
    Change-Id: Ibf9229599dac953177fbf1ffac5242ed716142db

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-rc1 → 2012.2
Revision history for this message
Matt Turner (matttur) wrote :

I have a question: I thought nova-manage is deprecated? However the "new" `nova flavor-create` command requires a flavor ID. Is this a separate bug, or is this also deprecated, and if so how should I be creating flavors from the command line?

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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