← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1766692] [NEW] instance.uuid no longer being a str breaks powervm scsi disconnect

 

Public bug reported:

Long-standing code in pypowervm [1] used isinstance(..., str) to help
identify whether an input was a UUID or an integer short ID.  This is
used with to find SCSI mappings [2] with Instance.uuid [3] when
disconnecting a disk during destroy [4].

Then this change in oslo.versionedobjects happened [5], resulting in
instance.uuid no longer being a str.  So the check at [1] fails, and we
try to int() a UUID string, resulting in [6], pasted here in case that
link expires:

PowerVM error destroying instance.: ValueError: invalid literal for int() with base 10: '4E27E1E6-6A24-4F0A-8E7B-2BBE7B4A28BA'
 Traceback (most recent call last):
   File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/driver.py", line 672, in _destroy
     _setup_flow_and_run()
   File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/driver.py", line 668, in _setup_flow_and_run
     tf_base.run(flow, instance=instance)
   File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/tasks/base.py", line 40, in run
     return eng.run()
   File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 247, in run
     for _state in self.run_iter(timeout=timeout):
   File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 340, in run_iter
     failure.Failure.reraise_if_any(er_failures)
   File "/usr/local/lib/python2.7/dist-packages/taskflow/types/failure.py", line 336, in reraise_if_any
     failures[0].reraise()
   File "/usr/local/lib/python2.7/dist-packages/taskflow/types/failure.py", line 343, in reraise
     six.reraise(*self._exc_info)
   File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
     result = task.execute(**arguments)
   File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/tasks/storage.py", line 452, in execute
     self.instance, stg_ftsk=self.stg_ftsk, disk_type=self.disk_type)
   File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/disk/ssp.py", line 174, in disconnect_disk
     match_func=match_func)
   File "/usr/local/lib/python2.7/dist-packages/pypowervm/tasks/scsi_mapper.py", line 503, in find_maps
     is_uuid, client_id = uuid.id_or_uuid(client_lpar_id)
   File "/usr/local/lib/python2.7/dist-packages/pypowervm/utils/uuid.py", line 55, in id_or_uuid
     ret_id = int(an_id)
 ValueError: invalid literal for int() with base 10: '4E27E1E6-6A24-4F0A-8E7B-2BBE7B4A28BA'

(Okay, our bad for using str at all - though to be fair, it's possible
that code predates the very existence of py3.)

The right fix is for [1] to use is_uuid_like from oslo.utils.  This
shall be done.  However, since [5] was backported to queens and pike,
unless we can get away with backporting requirements changes, we may
have to do something backportable in nova-powervm and nova as well.

[1] https://github.com/powervm/pypowervm/blob/release/1.1.14/pypowervm/utils/uuid.py#L50
[2] https://github.com/powervm/pypowervm/blob/release/1.1.14/pypowervm/tasks/scsi_mapper.py#L503
[3] https://github.com/openstack/nova/blob/1605391084d6a1f57384ef48bad8ca2185cf6fa7/nova/virt/powervm/disk/ssp.py#L128
[4] https://github.com/openstack/nova/blob/1605391084d6a1f57384ef48bad8ca2185cf6fa7/nova/virt/powervm/driver.py#L272
[5] https://review.openstack.org/#/q/Ic6b6308fb1960ec40407e6efde30137b64543e72
[6] http://184.172.12.213/58/557958/10/check/nova-out-of-tree-pvm/c1d7e99/logs/n-cpu.txt.gz?#_Apr_20_08_51_16_452651

** Affects: nova
     Importance: Undecided
         Status: New

** Affects: nova-powervm
     Importance: Undecided
         Status: New

** Affects: pypowervm
     Importance: Undecided
         Status: New

** Also affects: nova
   Importance: Undecided
       Status: New

** Also affects: pypowervm
   Importance: Undecided
       Status: New

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

Title:
  instance.uuid no longer being a str breaks powervm scsi disconnect

Status in OpenStack Compute (nova):
  New
Status in nova-powervm:
  New
Status in pypowervm:
  New

Bug description:
  Long-standing code in pypowervm [1] used isinstance(..., str) to help
  identify whether an input was a UUID or an integer short ID.  This is
  used with to find SCSI mappings [2] with Instance.uuid [3] when
  disconnecting a disk during destroy [4].

  Then this change in oslo.versionedobjects happened [5], resulting in
  instance.uuid no longer being a str.  So the check at [1] fails, and
  we try to int() a UUID string, resulting in [6], pasted here in case
  that link expires:

  PowerVM error destroying instance.: ValueError: invalid literal for int() with base 10: '4E27E1E6-6A24-4F0A-8E7B-2BBE7B4A28BA'
   Traceback (most recent call last):
     File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/driver.py", line 672, in _destroy
       _setup_flow_and_run()
     File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/driver.py", line 668, in _setup_flow_and_run
       tf_base.run(flow, instance=instance)
     File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/tasks/base.py", line 40, in run
       return eng.run()
     File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 247, in run
       for _state in self.run_iter(timeout=timeout):
     File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/engine.py", line 340, in run_iter
       failure.Failure.reraise_if_any(er_failures)
     File "/usr/local/lib/python2.7/dist-packages/taskflow/types/failure.py", line 336, in reraise_if_any
       failures[0].reraise()
     File "/usr/local/lib/python2.7/dist-packages/taskflow/types/failure.py", line 343, in reraise
       six.reraise(*self._exc_info)
     File "/usr/local/lib/python2.7/dist-packages/taskflow/engines/action_engine/executor.py", line 53, in _execute_task
       result = task.execute(**arguments)
     File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/tasks/storage.py", line 452, in execute
       self.instance, stg_ftsk=self.stg_ftsk, disk_type=self.disk_type)
     File "/opt/stack/nova-powervm/nova_powervm/virt/powervm/disk/ssp.py", line 174, in disconnect_disk
       match_func=match_func)
     File "/usr/local/lib/python2.7/dist-packages/pypowervm/tasks/scsi_mapper.py", line 503, in find_maps
       is_uuid, client_id = uuid.id_or_uuid(client_lpar_id)
     File "/usr/local/lib/python2.7/dist-packages/pypowervm/utils/uuid.py", line 55, in id_or_uuid
       ret_id = int(an_id)
   ValueError: invalid literal for int() with base 10: '4E27E1E6-6A24-4F0A-8E7B-2BBE7B4A28BA'

  (Okay, our bad for using str at all - though to be fair, it's possible
  that code predates the very existence of py3.)

  The right fix is for [1] to use is_uuid_like from oslo.utils.  This
  shall be done.  However, since [5] was backported to queens and pike,
  unless we can get away with backporting requirements changes, we may
  have to do something backportable in nova-powervm and nova as well.

  [1] https://github.com/powervm/pypowervm/blob/release/1.1.14/pypowervm/utils/uuid.py#L50
  [2] https://github.com/powervm/pypowervm/blob/release/1.1.14/pypowervm/tasks/scsi_mapper.py#L503
  [3] https://github.com/openstack/nova/blob/1605391084d6a1f57384ef48bad8ca2185cf6fa7/nova/virt/powervm/disk/ssp.py#L128
  [4] https://github.com/openstack/nova/blob/1605391084d6a1f57384ef48bad8ca2185cf6fa7/nova/virt/powervm/driver.py#L272
  [5] https://review.openstack.org/#/q/Ic6b6308fb1960ec40407e6efde30137b64543e72
  [6] http://184.172.12.213/58/557958/10/check/nova-out-of-tree-pvm/c1d7e99/logs/n-cpu.txt.gz?#_Apr_20_08_51_16_452651

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


Follow ups