← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1565466] [NEW] pci detach failed with 'PciDevice' object has no attribute '__getitem__'

 

Public bug reported:

when doing suspend with pci device, nova tries to detach the pci device from libvrit dom.
after calling  guest.detach_device nova checks the dom to ensure the detaching is finished.
 if that detach failed (because of using old qemu in my case) the _detach_pci_devices method failed with the following error instead of raising PciDeviceDetachFailed


2016-03-31 08:50:46.727 10338 DEBUG nova.objects.instance [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] Lazy-loading 'pci_devices' on Instance uuid 7114fa62-10bb-45dc-b64e-b301bfce4dfa obj_load_attr /opt/stack/nova/nova/objects/instance.py:895
2016-03-31 08:50:46.727 10338 DEBUG oslo_messaging._drivers.amqpdriver [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] CALL msg_id: c96a579643054867adc0e119d93cc6a9 exchange 'nova' topic 'conductor' _send /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:454
2016-03-31 08:50:46.745 10338 DEBUG oslo_messaging._drivers.amqpdriver [-] received reply msg_id: c96a579643054867adc0e119d93cc6a9 __call__ /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:302
2016-03-31 08:50:46.751 10338 DEBUG nova.virt.libvirt.config [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] Generated XML ('<hostdev mode="subsystem" type="pci" managed="yes">\n  <source>\n    <address bus="0x04" domain="0x0000" function="0x7" slot="0x00"/>\n  </source>\n</hostdev>\n',)  to_xml /opt/stack/nova/nova/virt/libvirt/config.py:82
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa] Setting instance vm_state to ERROR
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa] Traceback (most recent call last):
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/compute/manager.py", line 6588, in _error_out_instance_on_exception
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     yield
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/compute/manager.py", line 4196, in suspend_instance
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     self.driver.suspend(context, instance)
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2641, in suspend
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     self._detach_sriov_ports(context, instance, guest)
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3432, in _detach_sriov_ports
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     self._detach_pci_devices(guest, sriov_devs)
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3350, in _detach_pci_devices
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     dbsf = pci_utils.parse_address(dev['address'])
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa] TypeError: 'PciDevice' object has no attribute '__getitem__'
2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]
2016-03-31 08:50:51.792 10338 DEBUG oslo_messaging._drivers.amqpdriver [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] CALL msg_id: b5353aecfd4a44aa8735c46a0427a12d exchange 'nova' topic 'conductor' _send /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:454

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: pci

-- 
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/1565466

Title:
  pci detach failed with 'PciDevice' object has no attribute
  '__getitem__'

Status in OpenStack Compute (nova):
  New

Bug description:
  when doing suspend with pci device, nova tries to detach the pci device from libvrit dom.
  after calling  guest.detach_device nova checks the dom to ensure the detaching is finished.
   if that detach failed (because of using old qemu in my case) the _detach_pci_devices method failed with the following error instead of raising PciDeviceDetachFailed

  
  2016-03-31 08:50:46.727 10338 DEBUG nova.objects.instance [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] Lazy-loading 'pci_devices' on Instance uuid 7114fa62-10bb-45dc-b64e-b301bfce4dfa obj_load_attr /opt/stack/nova/nova/objects/instance.py:895
  2016-03-31 08:50:46.727 10338 DEBUG oslo_messaging._drivers.amqpdriver [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] CALL msg_id: c96a579643054867adc0e119d93cc6a9 exchange 'nova' topic 'conductor' _send /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:454
  2016-03-31 08:50:46.745 10338 DEBUG oslo_messaging._drivers.amqpdriver [-] received reply msg_id: c96a579643054867adc0e119d93cc6a9 __call__ /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:302
  2016-03-31 08:50:46.751 10338 DEBUG nova.virt.libvirt.config [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] Generated XML ('<hostdev mode="subsystem" type="pci" managed="yes">\n  <source>\n    <address bus="0x04" domain="0x0000" function="0x7" slot="0x00"/>\n  </source>\n</hostdev>\n',)  to_xml /opt/stack/nova/nova/virt/libvirt/config.py:82
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa] Setting instance vm_state to ERROR
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa] Traceback (most recent call last):
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/compute/manager.py", line 6588, in _error_out_instance_on_exception
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     yield
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/compute/manager.py", line 4196, in suspend_instance
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     self.driver.suspend(context, instance)
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 2641, in suspend
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     self._detach_sriov_ports(context, instance, guest)
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3432, in _detach_sriov_ports
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     self._detach_pci_devices(guest, sriov_devs)
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]   File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 3350, in _detach_pci_devices
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]     dbsf = pci_utils.parse_address(dev['address'])
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa] TypeError: 'PciDevice' object has no attribute '__getitem__'
  2016-03-31 08:50:51.784 10338 ERROR nova.compute.manager [instance: 7114fa62-10bb-45dc-b64e-b301bfce4dfa]
  2016-03-31 08:50:51.792 10338 DEBUG oslo_messaging._drivers.amqpdriver [req-225f9ed4-1f93-427b-a045-84535b3aeb55 admin demo] CALL msg_id: b5353aecfd4a44aa8735c46a0427a12d exchange 'nova' topic 'conductor' _send /usr/lib/python2.7/site-packages/oslo_messaging/_drivers/amqpdriver.py:454

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1565466/+subscriptions


Follow ups