cli icon indicating copy to clipboard operation
cli copied to clipboard

Can't create quota plan with 0 memory.

Open stephanme opened this issue 4 years ago • 4 comments

Please fill out the issue checklist below and provide ALL the requested information.

  • [x] I reviewed open and closed github issues that may be related to my problem.
  • [x] I tried updating to the latest version of the CF CLI to see if it fixed my problem.
  • [x] I attempted to run the command with CF_TRACE=1 to help debug the issue.
  • [x] I am reporting a bug that others will be able to reproduce.

Describe the bug and the command you saw an issue with

Can't create quota plan with 0 memory.

What happened

cf cli (7.0.2 and also 6.52.0) complains about incorrect usage. Looks like the parameter validation of cf cli doesn't allow 0 memory and 0 instance memory. There is no interaction with CF API at all.

Expected behavior

Quota plan with 0 memory and 0 instance memory is created. This was possible with cf cli 6.49.0.

Exact Steps To Reproduce

Logged in with admin rights:

[root@iacbox-v380]:/users/d047883/landscape-aws-staging$ cf7 version
cf7 version 7.0.2+17b4eeafd.2020-07-24

[root@iacbox-v380]:/users/d047883/landscape-aws-staging$ cf7 create-quota zero-mem-quota -m 0GB -r 0 -s 10 -i 0GB --allow-paid-service-plans -v
Incorrect Usage: Byte quantity must be an integer with a unit of measurement like M, MB, G, or GB

NAME:
   create-org-quota - Define a new quota for an organization

USAGE:
   cf7 create-org-quota ORG_QUOTA [-m TOTAL_MEMORY] [-i INSTANCE_MEMORY] [-r ROUTES] [-s SERVICE_INSTANCES] [-a APP_INSTANCES] [--allow-paid-service-plans] [--reserved-route-ports RESERVED_ROUTE_PORTS]

ALIAS:
   create-quota

OPTIONS:
   -a                              Total number of application instances. (Default: unlimited).
   --allow-paid-service-plans      Allow provisioning instances of paid service plans. (Default: disallowed).
   -i                              Maximum amount of memory a process can have (e.g. 1024M, 1G, 10G). (Default: unlimited).
   -m                              Total amount of memory all processes can have (e.g. 1024M, 1G, 10G).  -1 represents an unlimited amount. (Default: 0).
   -r                              Total number of routes. -1 represents an unlimited amount. (Default: 0).
   --reserved-route-ports          Maximum number of routes that may be created with ports. -1 represents an unlimited amount. (Default: 0).
   -s                              Total number of service instances. -1 represents an unlimited amount. (Default: 0).

SEE ALSO:
   create-org, org-quotas, set-org-quota

Provide more context

[root@iacbox-v380]:/users/d047883/landscape-aws-staging$ cf version
cf version 6.52.0+b086fe522.2020-08-26
[root@iacbox-v380]:/users/d047883/landscape-aws-staging$ cf7 version
cf7 version 7.0.2+17b4eeafd.2020-07-24

(running on Ubuntu)

CF 13.14.0 CF API v2.151.0, v3.86.0 (capi-release patched down to 1.96.0 because of the Azure problem in 1.97.0)

stephanme avatar Sep 07 '20 08:09 stephanme

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/174689337

The labels on this github issue will be updated when the story is started.

cf-gitbot avatar Sep 07 '20 08:09 cf-gitbot

Thanks for pointing out this reproducible issue @stephanme. Before we take action I'd like a little more information. Can you describe the use case that requires creating a quota plan with 0 mem and 0 instance mem?

Also - I'm not sure if this is helpful or not, but it is possible to create a quota plan with 0 mem in the current v7 CLI by not passing the -m flag/value in the create-*-quota command

heyjcollins avatar Sep 29 '20 05:09 heyjcollins

One of our use case is an org that just exists for owning a private domain. The private domain is then shared into other orgs where applications are deployed (and which have a real memory quota of course). There may be more use cases I need to check with colleagues who opened internal tickets.

Creating a quota without -m flag works. But if I skip the -i flag this quota plan gets unlimited instance memory. This is something we want to avoid (have seen issues with very large app instances) and we run reports about org quotas from time to time. Also, this doesn't work for cf7 update-quota.

We found two possible workarounds:

  • use a very low quota of e.g. 1M
  • use the CF API directly

Not nice either I would say.

stephanme avatar Sep 30 '20 14:09 stephanme

We're also running into this. issue using 7.4.0. Our use case is spaces dedicated to brokered service instances that don't have direct relationships to any one application instance.

bengerman13 avatar Mar 16 '22 21:03 bengerman13