Reviewed: https://review.openstack.org/390919 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d32d8c0ee1dbbdcc161bf6a7fcee3c5209be6e18 Submitter: Jenkins Branch: master
commit d32d8c0ee1dbbdcc161bf6a7fcee3c5209be6e18 Author: Sergey Nikitin <[email protected]> Date: Wed Oct 26 18:56:30 2016 +0300 Catch NUMA related exceptions in create server API method The exceptions are raised by numa_get_constraints() method should be caught by REST API layer explicitly. If we wouldn't catch them nova will return responce with 500 status code instead of 400. Following exceptions were caught: * CPUThreadPolicyConfigurationInvalid * ImageCPUPinningForbidden * ImageCPUThreadPolicyForbidden * MemoryPageSizeInvalid * MemoryPageSizeForbidden * RealtimeConfigurationInvalid * RealtimeMaskNotFoundOrInvalid Closes-Bug: #1636911 Closes-Bug: #1636688 Change-Id: I7c06bb2c3094eee403e615d6027c38502eaabd49 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1636688 Title: 500 error while create instance with numa flavor setting Status in OpenStack Compute (nova): Fix Released Status in OpenStack Compute (nova) newton series: New Bug description: stack@s2600wt:~/devstack$ openstack flavor create --vcpus 6 --ram 6144 --disk 40 --property hw:numa_nodes=2 --property hw:numa_cpus.0=0,1 --property hw:numa_mem.0=2048 --p│····· roperty hw:numa_cpus.1=2,3,4,5 --property hw:numa_mem.1=4096 --property hw:cpu_policy=shared --property hw:cpu_thread_policy=require test_numa_with_shared_thread_require │·····WARNING: openstackclient.common.utils is deprecated and will be removed after Jun 2017. Please use osc_lib.utils │·····+----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+│····· | Field | Value |│····· +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+│····· | OS-FLV-DISABLED:disabled | False |│····· | OS-FLV-EXT-DATA:ephemeral | 0 |│····· | disk | 40 |│····· | id | 94b49753-abad-4753-b0df-1699da04baa4 |│····· | name | test_numa_with_shared_thread_require |│····· | os-flavor-access:is_public | True |│····· | properties | hw:cpu_policy='shared', hw:cpu_thread_policy='require', hw:numa_cpus.0='0,1', hw:numa_cpus.1='2,3,4,5', hw:numa_mem.0='2048', |│····· | | hw:numa_mem.1='4096', hw:numa_nodes='2' |│····· | ram | 6144 |│····· | rxtx_factor | 1.0 |│····· | swap | |│····· | vcpus | 6 |│····· +----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ stack@s2600wt:~/devstack$ nova boot --flavor test_numa_with_shared_thread_require --image cirros-0.3.4-x86_64-uec test1 │····· ERROR (ClientException): Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. │····· <class 'nova.exception.CPUThreadPolicyConfigurationInvalid'> (HTTP 500) (Request-ID: req-5f0efa65-6545-45d1-b499-a48817720f44) ========= API LOG====================== 2016-10-26 11:53:01.735 ERROR nova.api.openstack.extensions [req-5f0efa65-6545-45d1-b499-a48817720f44 admin admin] Unexpected exception in API method │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions Traceback (most recent call last): │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/extensions.py", line 338, in wrapped │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions return f(*args, **kwargs) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/validation/__init__.py", line 73, in wrapper │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions return func(*args, **kwargs) │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/validation/__init__.py", line 73, in wrapper │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions return func(*args, **kwargs) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/validation/__init__.py", line 73, in wrapper │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions return func(*args, **kwargs) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/validation/__init__.py", line 73, in wrapper │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions return func(*args, **kwargs) │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/validation/__init__.py", line 73, in wrapper │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions return func(*args, **kwargs) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/api/openstack/compute/servers.py", line 631, in create │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions **create_kwargs) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/hooks.py", line 154, in inner │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions rv = f(*args, **kwargs) │·····2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 1525, in create │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions check_server_group_quota=check_server_group_quota) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 1127, in _create_instance │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions reservation_id, max_count) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/compute/api.py", line 850, in _validate_and_build_base_options │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions instance_type, image_meta) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/virt/hardware.py", line 1236, in numa_get_constraints │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions return _add_cpu_pinning_constraint(flavor, image_meta, numa_topology) │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions File "/opt/stack/nova/nova/virt/hardware.py", line 1155, in _add_cpu_pinning_constraint │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions raise exception.CPUThreadPolicyConfigurationInvalid() │····· 2016-10-26 11:53:01.735 TRACE nova.api.openstack.extensions CPUThreadPolicyConfigurationInvalid: Cannot set cpu thread pinning policy in a non dedicated cpu pinning policy To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1636688/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

