Bug 1421083 - storage migration of instance boot from volume fails with InvalidType
Summary: storage migration of instance boot from volume fails with InvalidType
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-nova
Version: 9.0 (Mitaka)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: async
: 9.0 (Mitaka)
Assignee: Matthew Booth
QA Contact: Prasanth Anbalagan
URL:
Whiteboard:
Depends On: 1419480 1421100
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-10 10:14 UTC by Matthew Booth
Modified: 2022-07-09 11:49 UTC (History)
14 users (show)

Fixed In Version: openstack-nova-13.1.2-19.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1419480
Environment:
Last Closed: 2017-06-19 18:30:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1554859 0 None None None 2017-02-10 10:14:20 UTC
OpenStack gerrit 315864 0 None None None 2017-02-10 10:14:20 UTC
Red Hat Issue Tracker OSP-17262 0 None None None 2022-07-09 11:49:11 UTC
Red Hat Product Errata RHSA-2017:1508 0 normal SHIPPED_LIVE Moderate: openstack-nova security, bug fix, and enhancement update 2017-06-19 22:28:35 UTC

Description Matthew Booth 2017-02-10 10:14:20 UTC
+++ This bug was initially created as a clone of Bug #1419480 +++

Description of problem:

When boot an instance from volume created from an instance, like:

# nova boot --flavor m1.tiny --block-device source=image,id=5875cad9-4662-41da-b390-4638df154e01,dest=volume,size=1,shutdown=preserve,bootindex=0 --nic net-id=a5b46d6b-e89f-4399-ac62-1f33dee55662 cirros-nfs-from-volume

With this the source_type of the volume is image
# mysql -u root nova -e "select source_type,volume_id from block_device_mapping where volume_id='89aa74f6-459a-41da-a1c5-584f975c96a5'\G;"
*************************** 1. row ***************************
source_type: image
  volume_id: 89aa74f6-459a-41da-a1c5-584f975c96a5

As a result if we migrate the volume to a different storage backend, the migration fails with:

2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [req-62a58fdd-031f-4117-a959-7f9008eae1d0 7de1d918a88540ee9cf9a15d845dad8f 6741168c17524c24b79ce5af6373a7c4 - - -] [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2] Failed to swap volume 89aa74f6-459a-41da-a1c5-584f975c96a5 for
46123a0e-e158-4c32-8e24-125105b0f6bc
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2] Traceback (most recent call last):
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]   File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 4861, in _swap_volume
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]     resize_to)
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]   File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 1210, in swap_volume
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]     driver_bdm = driver_block_device.DriverVolumeBlockDevice(bdm)
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]   File "/usr/lib/python2.7/site-packages/nova/virt/block_device.py", line 105, in __init__
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]     self._transform()
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]   File "/usr/lib/python2.7/site-packages/nova/virt/block_device.py", line 207, in _transform
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]     raise _InvalidType
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2] _InvalidType
2017-02-06 04:53:35.432 899 ERROR nova.compute.manager [instance: 18bdbbd8-684d-49a4-92ea-aa2ee335ccf2]

This got fixed upstream with :
https://review.openstack.org/#/c/315864/

With this change the migration is successful

Version-Release number of selected component (if applicable):
OSP8 ,python-nova-12.0.4-8.el7ost.noarch

How reproducible:
always

Steps to Reproduce:
1. boot instance from volume as above
2. migrate volume to different storage backend:
# cinder migrate 89aa74f6-459a-41da-a1c5-584f975c96a5 osp8-controller@nfs2\#nfs2


Actual results:
result in migration error

Expected results:
successful migration

Additional info:

--- Additional comment from Red Hat Bugzilla Rules Engine on 2017-02-06 10:07:52 GMT ---

This bugzilla has been removed from the release and needs to be reviewed and Triaged for another Target Release.

Comment 1 Matthew Booth 2017-02-10 10:35:38 UTC
https://code.engineering.redhat.com/gerrit/97406

Comment 3 Prasanth Anbalagan 2017-04-27 00:03:50 UTC
Verified as follows,
 
+--------------------------------------+-------------------------------------------------+
| Property                             | Value                                           |
+--------------------------------------+-------------------------------------------------+
| OS-DCF:diskConfig                    | MANUAL                                          |
| OS-EXT-AZ:availability_zone          |                                                 |
| OS-EXT-SRV-ATTR:host                 | -                                               |
| OS-EXT-SRV-ATTR:hypervisor_hostname  | -                                               |
| OS-EXT-SRV-ATTR:instance_name        | instance-00000001                               |
| OS-EXT-STS:power_state               | 0                                               |
| OS-EXT-STS:task_state                | scheduling                                      |
| OS-EXT-STS:vm_state                  | building                                        |
| OS-SRV-USG:launched_at               | -                                               |
| OS-SRV-USG:terminated_at             | -                                               |
| accessIPv4                           |                                                 |
| accessIPv6                           |                                                 |
| adminPass                            | 4FE3BaDrju7N                                    |
| config_drive                         |                                                 |
| created                              | 2017-04-26T23:26:51Z                            |
| flavor                               | m1.tiny (1)                                     |
| hostId                               |                                                 |
| id                                   | 5a831bda-4fca-4786-b76d-4d860b382ca6            |
| image                                | Attempt to boot from volume - no image supplied |
| key_name                             | -                                               |
| metadata                             | {}                                              |
| name                                 | cirros-nfs-from-volume                          |
| os-extended-volumes:volumes_attached | []                                              |
| progress                             | 0                                               |
| security_groups                      | default                                         |
| status                               | BUILD                                           |
| tenant_id                            | a1905277048b4c6f911b75cb40892592                |
| updated                              | 2017-04-26T23:26:52Z                            |
| user_id                              | 2d38202756c34ab1b693a63cccc061c3                |
+--------------------------------------+-------------------------------------------------+
[user@serverX]# 
[user@serverX]# 
[user@serverX]# nova list
+--------------------------------------+------------------------+--------+------------+-------------+---------------------+
| ID                                   | Name                   | Status | Task State | Power State | Networks            |
+--------------------------------------+------------------------+--------+------------+-------------+---------------------+
| 5a831bda-4fca-4786-b76d-4d860b382ca6 | cirros-nfs-from-volume | ACTIVE | -          | Running     | public=172.24.4.227 |
+--------------------------------------+------------------------+--------+------------+-------------+---------------------+
[user@serverX]# cinder list
+--------------------------------------+--------+------+------+-------------+----------+--------------------------------------+
|                  ID                  | Status | Name | Size | Volume Type | Bootable |             Attached to              |
+--------------------------------------+--------+------+------+-------------+----------+--------------------------------------+
| 23971086-1d69-41a2-9057-b058783412bc | in-use |      |  1   |      -      |   true   | 5a831bda-4fca-4786-b76d-4d860b382ca6 |
+--------------------------------------+--------+------+------+-------------+----------+--------------------------------------+

[user@serverX]# 
[user@serverX]# cinder migrate 23971086-1d69-41a2-9057-b058783412bc serverA@iscsi#iscsi
Request to migrate volume <Volume: 23971086-1d69-41a2-9057-b058783412bc> has been accepted.
[user@serverX]# 
[user@serverX]# cinder show 23971086-1d69-41a2-9057-b058783412bc | grep migration_status
|        migration_status        |                                                                                                                success                                                                                                                |

Comment 7 errata-xmlrpc 2017-06-19 18:30:33 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, 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/RHSA-2017:1508


Note You need to log in before you can comment on or make changes to this bug.