Bug 1899893

Summary: [RHOS 16.2] Add missing nova exception GetPMEMNamespacesFailed
Product: Red Hat OpenStack Reporter: Stephen Finucane <stephenfin>
Component: openstack-novaAssignee: Stephen Finucane <stephenfin>
Status: CLOSED ERRATA QA Contact: OSP DFG:Compute <osp-dfg-compute>
Severity: medium Docs Contact:
Priority: medium    
Version: 16.2 (Train)CC: amodi, dasmith, eglynn, jhakimra, kchamart, nova-maint, sbauza, sgordon, stephenfin, vromanso
Target Milestone: AlphaKeywords: Triaged
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-nova-20.4.2-2.20201123134919.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1899686 Environment:
Last Closed: 2021-09-15 07:10:23 UTC Type: ---
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:    
Bug Blocks: 1899686    

Description Stephen Finucane 2020-11-20 10:35:20 UTC
+++ This bug was initially created as a clone of Bug #1899686 +++

Description of problem: During validation of the NVDIMM RFE the following exception came up as missing and addt'l info is summarized below from Stephen's change:

Change Idd49b0c70caedfcd42420ffa2ac926a6087d406e added support for
discovery of PMEM devices by the libvirt driver. Some error handling
code in this was expected to raise a 'GetPMEMNamespacesFailed'
exception, however, a typo meant the exception was actually called
'GetPMEMNamespaceFailed' (singular). This exception was later removed in
change I6fd027fb51823b8a8a24ed7b864a2191c4e8e8c0 because it had no
references.

Re-introduce the exception, this time with the correct name, and add
some unit tests to prevent us regressing.

How reproducible: always

Steps to Reproduce:
1. Deploy RHOS 16.1 with NVDIMM namespaces
2. Invoke failures while creating instances, here it was due to missing ndctl pkg defined in nova_compute Dockerfile
3. Attribute error shown: module 'nova.exception' has no attribute 'GetPMEMNamespacesFailed'

Actual results:
/nova-compute.log.1:2020-11-16 16:00:47.574 7 WARNING nova.virt.libvirt.host [req-adf0ddc8-2f75-4d81-98df-d72ef125411c - - - - -] URI qemu:///system does not support events: internal error: could not initialize domain event timer: libvir
t.libvirtError: internal error: could not initialize domain event timer                                                                                                                                                                       
./nova-compute.log.1:2020-11-16 16:00:48.689 7 CRITICAL nova [req-adf0ddc8-2f75-4d81-98df-d72ef125411c - - - - -] Unhandled error: AttributeError: module 'nova.exception' has no attribute 'GetPMEMNamespacesFailed'                         
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova Traceback (most recent call last):                                                                                                                                                 
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 508, in _get_vpmems_on_host                                                                            
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     output = nova.privsep.libvirt.get_pmem_namespaces()                                                                                                                            
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/oslo_privsep/priv_context.py", line 245, in _wrap                                                                                         
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     return self.channel.remote_call(name, args, kwargs)                                                                                                                            
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/oslo_privsep/daemon.py", line 224, in remote_call                                                                                         
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     raise exc_type(*result[2])                                                                                                                                                     
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova FileNotFoundError: [Errno 2] No such file or directory: 'ndctl'         
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova                                                                                                                                                                                     
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova During handling of the above exception, another exception occurred:                                                                                                                 
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova             
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova Traceback (most recent call last):                                                            
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/bin/nova-compute", line 10, in <module>
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     sys.exit(main())                                                                        
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/cmd/compute.py", line 57, in main
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     topic=compute_rpcapi.RPC_TOPIC)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/service.py", line 271, in create
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     periodic_interval_max=periodic_interval_max)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/service.py", line 129, in __init__
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     self.manager = manager_class(host=self.host, *args, **kwargs)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/compute/manager.py", line 571, in __init__
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     self.driver = driver.load_compute_driver(self.virtapi, compute_driver)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/virt/driver.py", line 1911, in load_compute_driver
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     virtapi)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/oslo_utils/importutils.py", line 44, in import_object
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     return import_class(import_str)(*args, **kwargs)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 446, in __init__
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     vpmem_conf=CONF.libvirt.pmem_namespaces)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 477, in _discover_vpmems
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     vpmems_host = self._get_vpmems_on_host()
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova   File "/usr/lib/python3.6/site-packages/nova/virt/libvirt/driver.py", line 512, in _get_vpmems_on_host
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova     raise exception.GetPMEMNamespacesFailed(reason=reason)
./nova-compute.log.1:2020-11-16 16:00:48.689 7 ERROR nova AttributeError: module 'nova.exception' has no attribute 'GetPMEMNamespacesFailed'


Expected results:
Instances created successfully

Additional info:
Related to BZ #1640742

Comment 14 errata-xmlrpc 2021-09-15 07:10:23 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 (Red Hat OpenStack Platform (RHOSP) 16.2 enhancement 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-2021:3483