Bug 1625122

Summary: [rhos14] nova reporting incorrect available memory
Product: Red Hat OpenStack Reporter: Sahid Ferdjaoui <sferdjao>
Component: openstack-novaAssignee: OSP DFG:Compute <osp-dfg-compute>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: high Docs Contact:
Priority: high    
Version: 14.0 (Rocky)CC: berrange, coldford, cswanson, dasmith, dvd, eglynn, jamsmith, jhakimra, kchamart, marjones, mbooth, mmethot, nova-maint, rosingh, sbauza, sgordon, smooney, srevivo, stephenfin, vromanso
Target Milestone: betaKeywords: Reopened, Triaged, ZStream
Target Release: 14.0 (Rocky)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-18.0.1-0.20180908065419.f5a5287.el7ost Doc Type: Bug Fix
Doc Text:
With this update, Nova screens for the NUMA affinity of host huge pages when booting instances with huge pages. Nova rejects NUMA nodes with insufficient huge pages. Prior to this update, Nova did not screen for NUMA affinity of huge pages. If the host had insufficient NUMA pages, even with sufficient CPUs, the instance boot would fail.
Story Points: ---
Clone Of: 1625120 Environment:
Last Closed: 2019-01-11 11:51:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1569678    
Bug Blocks: 1519540, 1625119, 1625120, 1664698    

Comment 9 Joe H. Rahme 2019-01-09 18:28:22 UTC
Validated that the code works as intended but noted that this code
breaks oversubscription of memory for instances with a NUMA topology
but no hugepages: 

https://bugzilla.redhat.com/show_bug.cgi?id=1664698


verification steps
------------------

1. On the controller node of a fresh deployment:

    $ mysql -u nova -ss -r -e "select numa_topology from nova.compute_nodes where ID=2 ;" | python -m json.tool
    
    ...
                        "mempages": [
                            {
                                "nova_object.changes": [
                                    "total",
                                    "used",
                                    "reserved",
                                    "size_kb"
                                ],
                                "nova_object.data": {
                                    "reserved": 0,
                                    "size_kb": 4,
                                    "total": 8594000,
                                    "used": 0
                                },
                                "nova_object.name": "NUMAPagesTopology",
                                "nova_object.namespace": "nova",
                                "nova_object.version": "1.1"
                            },
    ...
    
2. launch a flavor

    $ openstack flavor create --id 1234 --vcpus 1 --ram 64 --disk 15 test-flavor
    $ openstack flavor set --property hw:numa_nodes=1 test-flavor
    $ openstack server create test-vm --flavor test-flavor --image test-rhel75

3. Comparing the value in the db


$ mysql -u nova -ss -r -e "select numa_topology from nova.compute_nodes where ID=2 ;" | python -m json.tool

    ...
                        "mempages": [
                            {
                                "nova_object.changes": [
                                    "total",
                                    "used",
                                    "reserved",
                                    "size_kb"
                                ],
                                "nova_object.data": {
                                    "reserved": 0,
                                    "size_kb": 4,
                                    "total": 8594000,
                                    "used": 16384
                                },
                                "nova_object.name": "NUMAPagesTopology",
                                "nova_object.namespace": "nova",
                                "nova_object.version": "1.1"
                            },
    ...


Running a full diff on the output of both requests we can check:

	$ diff before.log after.log                                                                                                                       
	...
	20c20
	<                     "cpu_usage": 0,
	---
	>                     "cpu_usage": 1,
	41c41
	<                     "memory_usage": 0,
	---
	>                     "memory_usage": 64,
	54c54
	<                                 "used": 0
	---
	>                                 "used": 16384
	62d61
	...

Comment 11 errata-xmlrpc 2019-01-11 11:51:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:0045