VMware: get_info() fails if properties are missing

Bug #1317912 reported by Radoslav Gerganov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Radoslav Gerganov
Icehouse
Fix Released
Undecided
Unassigned

Bug Description

The properties that we retrieve from VirtualMachineConfigSummary are optional and if they are missing get_info() throws an exception (tracebacks below). We should use default values when the properties are not available.

stack/common/vmware/vim.py:126

2014-05-06 21:52:44.485 421 DEBUG nova.openstack.common.vmware.vim [-] No faults found in RetrievePropertiesEx API response. _retrieve_properties_ex_fault_checker /usr/lib/python2.7/dist-packages/nova/ope

nstack/common/vmware/vim.py:153

2014-05-06 21:52:44.486 421 DEBUG nova.openstack.common.vmware.vim [-] Invocation of RetrievePropertiesEx on (propertyCollector){

   value = "propertyCollector"

   _type = "PropertyCollector"

 } completed successfully. vim_request_handler /usr/lib/python2.7/dist-packages/nova/openstack/common/vmware/vim.py:187

2014-05-06 21:52:44.487 421 DEBUG nova.openstack.common.vmware.api [-] Function _invoke_api returned successfully after 0 retries. _func /usr/lib/python2.7/dist-packages/nova/openstack/common/vmware/api.py:88

2014-05-06 21:52:44.491 421 ERROR nova.openstack.common.threadgroup [-] int() argument must be a string or a number, not 'NoneType'

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup Traceback (most recent call last):

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/openstack/common/threadgroup.py", line 117, in wait

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup x.wait()

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/openstack/common/threadgroup.py", line 49, in wait

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup return self.thread.wait()

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 168, in wait

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup return self._exit_event.wait()

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/eventlet/event.py", line 116, in wait

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup return hubs.get_hub().switch()

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/eventlet/hubs/hub.py", line 187, in switch

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup return self.greenlet.switch()

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/eventlet/greenthread.py", line 194, in main

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup result = function(*args, **kwargs)

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/openstack/common/service.py", line 65, in run_service

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup service.start()

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/service.py", line 154, in start

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup self.manager.init_host()

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 792, in init_host

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup self._init_instance(context, instance)

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 700, in _init_instance

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup drv_state = self._get_power_state(context, instance)

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 808, in _get_power_state

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup return self.driver.get_info(instance)["state"]

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/virt/vmwareapi/driver.py", line 737, in get_info

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup return _vmops.get_info(instance)

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup File "/usr/lib/python2.7/dist-packages/nova/virt/vmwareapi/vmops.py", line 1493, in get_info

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup max_mem = int(query['summary.config.memorySizeMB']) * 1024

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup TypeError: int() argument must be a string or a number, not 'NoneType'

2014-05-06 21:52:44.491 421 TRACE nova.openstack.common.threadgroup

2014-05-06 21:52:44.496 421 DEBUG amqp [-] Closed channel #1 _do_close /usr/lib/python2.7/dist-packages/amqp/channel.py:88

2014-05-06 21:52:44.902 421 INFO nova.openstack.common.vmware.api [-] Logging out and terminating the current session with ID = 526ac461-2770-40fa-a53e-7fe742d2499a.

2014-05-06 21:52:44.903 421 DEBUG nova.openstack.common.vmware.vim [-] Invoking Logout on (sessionManager){

   value = "SessionManager"

Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/93040

Changed in nova:
status: New → In Progress
Gary Kotton (garyk)
Changed in nova:
importance: Low → High
tags: added: havana-backport-potential icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/93040
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2db7528ca258d7b0c1205ab2f9a76569d9f9a82d
Submitter: Jenkins
Branch: master

commit 2db7528ca258d7b0c1205ab2f9a76569d9f9a82d
Author: Radoslav Gerganov <email address hidden>
Date: Wed May 7 17:57:31 2014 +0300

    VMware: use default values in get_info() when properties are missing

    The properties that we retrieve from VirtualMachineConfigSummary are
    optional ('summary.config.numCpu', 'summary.config.memorySizeMB') and
    if they are missing we should return default values from get_info()

    This patch also improves the unit test for get_info(). It removes the
    test in test_driver_api.py (test_get_info() and test_spawn() are the
    same) and adds a new test in test_vmops.py

    Closes-Bug: 1317912
    Change-Id: Ibbb28985d13de371fdac8a119ad820d25acc21be

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/94406

Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/94406
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=0617601de93ed2149ac16d6c10e46e508a0977b0
Submitter: Jenkins
Branch: stable/icehouse

commit 0617601de93ed2149ac16d6c10e46e508a0977b0
Author: Radoslav Gerganov <email address hidden>
Date: Wed May 7 17:57:31 2014 +0300

    VMware: use default values in get_info() when properties are missing

    The properties that we retrieve from VirtualMachineConfigSummary are
    optional ('summary.config.numCpu', 'summary.config.memorySizeMB') and
    if they are missing we should return default values from get_info()

    This patch also improves the unit test for get_info(). It removes the
    test in test_driver_api.py (test_get_info() and test_spawn() are the
    same) and adds a new test in test_vmops.py

    Conflicts:

     nova/tests/virt/vmwareapi/test_driver_api.py
     nova/tests/virt/vmwareapi/test_vmops.py

    Closes-Bug: 1317912
    Change-Id: Ibbb28985d13de371fdac8a119ad820d25acc21be
    (cherry picked from commit 2db7528ca258d7b0c1205ab2f9a76569d9f9a82d)

tags: added: in-stable-icehouse
Chuck Short (zulcss)
tags: removed: icehouse-backport-potential
Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.