Ask Your Question
1

How to create quota using rest api? [closed]

asked 2015-07-29 07:30:53 -0600

soumitrakarmakar gravatar image

I was trying to create a project using rest api's but cannot set quotas to it. Projects and users are being created.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by soumitrakarmakar
close date 2015-07-30 00:38:39.718848

Comments

The only issue is floating_ips don't change in the GUI i.e. dashboard.

soumitrakarmakar gravatar imagesoumitrakarmakar ( 2015-07-30 02:49:26 -0600 )edit

1 answer

Sort by » oldest newest most voted
1

answered 2015-07-29 08:24:39 -0600

Hey!

Depending on which quotas you want to modify you will either use Nova or Neutron's API. Neutron is used for the networking related quotas (routers, networks, subnets, etc) and Nova is used for the compute resources (RAM, CPU, etc).

To set quotas using the Nova API you will use a PUT against '/v2.1/os-quota-sets/​{tenant_id}​' with the following as an example:

{
"quota_set": {
    "cores": 20,
    "fixed_ips": -1,
    "floating_ips": 10,
    "injected_file_content_bytes": 10240,
    "injected_file_path_bytes": 255,
    "injected_files": 5,
    "instances": 10,
    "key_pairs": 100,
    "metadata_items": 128,
    "ram": 51200,
    "security_group_rules": 20,
    "security_groups": 45,
    "server_groups": 10,
    "server_group_members": 10
    }
}

You could also use the CLI's to do this and use '--debug' to extract the exact API call being used.

edit flag offensive delete link more

Comments

Not working "Internal Server Error 500" can you please share cli command.

soumitrakarmakar gravatar imagesoumitrakarmakar ( 2015-07-29 09:03:54 -0600 )edit

Sure, first issue 'nova quota-show --tenant <tenant-uuid>' to see the quota classes and then to actually update them you would do:

nova quota-update --tenant <tenant-UUID> --instances <new_quota>

The example above would update the instances quota on the specified project (tenant).

raul.flores gravatar imageraul.flores ( 2015-07-29 09:07:18 -0600 )edit

Doesn't work with OpenStack Kilo, maybe these were from Juno release. Only this command works nova quota-show --tenant <tenant-uuid>

soumitrakarmakar gravatar imagesoumitrakarmakar ( 2015-07-29 09:21:42 -0600 )edit

I was referencing the current CLI reference documentation. There may be an underlying issue, did the CLI return a 500 error as well?

raul.flores gravatar imageraul.flores ( 2015-07-29 09:41:20 -0600 )edit

Returns unknown command --tenant

soumitrakarmakar gravatar imagesoumitrakarmakar ( 2015-07-29 10:07:08 -0600 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-07-29 07:30:53 -0600

Seen: 477 times

Last updated: Jul 29 '15