Absolute Limits fails when returned unknown limits
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Fix Released
|
Undecided
|
rahul bardia |
Bug Description
Running `nova absolute-limits` or `nova limits` can fail when unaccounted for limits are returned, with the error:
DEBUG (shell:894) Field names must be unique!
Traceback (most recent call last):
File "/Users/
OpenStackCo
File "/Users/
args.
File "/Users/
_print_
File "/Users/
utils.
File "/Users/
pt = prettytable.
File "/Users/
self.
File "/Users/
self.
File "/Users/
self.
File "/Users/
raise Exception("Field names must be unique!")
Exception: Field names must be unique!
ERROR (Exception): Field names must be unique!
The way absolute limits are display was refactored to combine a limit type's "Used" and "Max" values into a single pretty table row.
Old Format:
+------
| Name | Value |
+------
| maxServerMeta | 40 |
| maxPersonality | 5 |
| totalPrivateNet
| maxImageMeta | 40 |
| maxPersonalitySize | 1000 |
| maxTotalRAMSize | 131072 |
| maxSecurityGrou
| maxTotalKeypairs | 100 |
| totalCoresUsed | 55 |
| totalRAMUsed | 56320 |
| maxSecurityGroups | -1 |
| totalFloatingIp
| totalInstancesUsed | 15 |
| totalSecurityGr
| maxTotalPrivate
| maxTotalFloatingIps | -1 |
| maxTotalInstances | 100 |
| maxTotalCores | -1 |
+------
New Format:
+------
| Name | Used | Max |
+------
| Cores | 103 | -1 |
| FloatingIps | 0 | -1 |
| ImageMeta | - | 40 |
| Instances | 27 | 250 |
| Keypairs | - | 100 |
| Personality | - | 5 |
| Personality Size | - | 1000 |
| PrivateNetworks | 2 | 30 |
| RAM | 108544 | 512000 |
| SecurityGroupRules | - | -1 |
| SecurityGroups | 0 | -1 |
| Server Meta | - | 40 |
+------
This is accomplished by a static limit_map that looks like the following:
limit_map = {
}
This works OK for a standard Vanilla OpenStack deployment today, but is quite fragile if new limit types are introduced in the future, or if a deployer sends back other custom limits.
For instance, my limits include `maxTotalPrivat
There seems to be a well established naming convention for these limits:
max[limit-type]
total[limit-
The Used / Max mapping could be done in a more dynamic manner, which will allow deployers to return custom limits, and future proofing the Nova client from any newly introduced limits going forward.
description: | updated |
Changed in python-novaclient: | |
assignee: | nobody → Mohammed Ashraf (mohammed-asharaf) |
status: | New → In Progress |
Changed in python-novaclient: | |
assignee: | Mohammed Ashraf (mohammed-asharaf) → nobody |
Changed in python-novaclient: | |
assignee: | nobody → Mohammed Ashraf (mohammed-asharaf) |
Changed in python-novaclient: | |
assignee: | Mohammed Ashraf (mohammed-asharaf) → Bhargavi (challa-bhargavi1) |
Changed in python-novaclient: | |
assignee: | Bhargavi (challa-bhargavi1) → nobody |
Changed in python-novaclient: | |
assignee: | nobody → rahul bardia (rahulbardia) |
Can you please provide the steps for reproduce this issue.