MemPageSIze can be empty on a flavor

Bug #1797961 reported by Jose Perez Carranza on 2018-10-15
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Low
Chris Friesen

Bug Description

Title
-----
mem_page_size can be set to empty on a flavor, even when is not a valid value.

Brief Description
-----------------
According to the documentation of OpenStack [1] there are specific values that can be set for Large pages allocation and empty is not allowed.

1- https://docs.openstack.org/nova/pike/admin/flavors.html

Severity
--------
Minor

Steps to Reproduce
------------------
1. Create a flavor
  $ openstack flavor create --ram 4096 --disk 40 --vcpus 2 --public --id auto test-flvr

2. Modify metadata of the flavor setting the mem_page_size to empty
  $ nova flavor-key test-flvr set hw:mem_page_size=

Expected Behavior
------------------
Empty value should be rejected as valid

Actual Behavior
----------------
Empty value can be set

Reproducibility
---------------
Reproducible
100%

System Configuration
--------------------
Duplex Bare-Meta ( Two node system )

Branch/Pull Time/Commit
-----------------------
r.2018.10

Timestamp/Logs
--------------
+----------------------------+-----------------------------------------------------------------------------------+
| Property | Value |
+----------------------------+-----------------------------------------------------------------------------------+
| OS-FLV-DISABLED:disabled | False |
| OS-FLV-EXT-DATA:ephemeral | 0 |
| disk | 40 |
| extra_specs | {"hw:mem_page_size": "", "aggregate_instance_extra_specs:storage": "local_image"} |
| id | 37f30bfa-7d66-4223-b8f1-cb7422dd5887 |
| name | test-flvr |
| os-flavor-access:is_public | True |
| ram | 4096 |
| rxtx_factor | 1.0 |
| swap | |
| vcpus | 2 |
+----------------------------+-----------------------------------------------------------------------------------+

Ada Cabrales (acabrale) on 2018-10-15
tags: added: stx.2018.10
Ghada Khalil (gkhalil) wrote :

This is a minor issue and should not gate stx.2018.10. This is likely upstream nova behavior.

tags: added: stx.distro.openstack
tags: removed: stx.2018.10
Changed in starlingx:
importance: Undecided → Low
Chris Friesen (cbf123) wrote :

This is upstream behaviour.

The way the code is written, an empty value here is equivalent to not specifying a pagesize at all.

Upstream doesn't validate extra-specs at all until someone actually tries to boot or resize an instance. We have some validation when setting extra-specs but it doesn't trip over this case since it just calls the upstream code to validate the entry.

Ghada Khalil (gkhalil) wrote :

Marking as Invalid based on Chris's analysis. If the reporter feels this is important, they can open a nova bug.

Changed in starlingx:
assignee: nobody → Chris Friesen (cbf123)
status: New → Invalid
Ricardo Perez (richomx) wrote :

It accepts also weird values as:
;
``
''
""

Chris Friesen (cbf123) wrote :

Anything that converts to a boolean 'false' in python will likely be accepted. Arguably this should be tightened up, but that would be upstream development.

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

Other bug subscribers