Boot from volume after the volume was migrated

asked 2017-09-08 11:06:39 -0500

xroot gravatar image

Scenario:

Launch a new instance with the boot from volume option similar to this:

# nova boot --flavor 1 --block-device source=image,id=uuid,dest=volume,size=100,shutdown=preserve,bootindex=0 test-server-boot-volume0

Then stop the instance, detach the volume, and migrate the new volume to a different storage node. The volume retains the same volume UUID after migration.

After migration attaching the volume back to the same instance does not work. The error I get is this: ['HANDLE_INVALID', 'SR', 'OpaqueRef:67a0a74b-a461-9f08-8a4f-cfead65fcfd1']. The hypervisor is Xen.

Debugging this led me to this stacktrace:

File "/opt/mystack/nova/lib/python2.7/site-packages/nova/virt/block_device.py", line 302, in attach device_type=self['device_type'], encryption=encryption)

File "/opt/mystack/nova/lib/python2.7/site-packages/nova/virt/xenapi/driver.py", line 429, in attach_volume mountpoint)

File "/opt/mystack/nova/lib/python2.7/site-packages/nova/virt/xenapi/volumeops.py", line 47, in attach_volume instance_name, dev_number, hotplug)

File "/opt/mystack/nova/lib/python2.7/site-packages/nova/virt/xenapi/volumeops.py", line 67, in _attach_volume connection_data)

File "/opt/mystack/nova/lib/python2.7/site-packages/nova/virt/xenapi/volume_utils.py", line 272, in forget_sr session.call_xenapi("SR.forget", sr_ref)

File "/opt/mystack/nova/lib/python2.7/site-packages/nova/virt/xenapi/client/session.py", line 210, in call_xenapi return session.xenapi_request(method, args)

File "/opt/mystack/nova/lib/python2.7/site-packages/XenAPI.py", line 133, in xenapi_request result = _parse_result(getattr(self, methodname)(*full_params))

File "/opt/mystack/nova/lib/python2.7/site-packages/XenAPI.py", line 203, in _parse_result raise Failure(result['ErrorDescription'])

The above code could be modified a little while I was debugging, but the call sequence is right.

Curiously, the same volume can be attached to a different VM and booted off of with no problems. It's only when I attach the volume to the original VM it belonged to before the volume migration.

Could you shed some light on this? Thank you!

edit retag flag offensive close merge delete

Comments

is that volume encrypted before ?

billy gravatar imagebilly ( 2017-09-08 14:04:53 -0500 )edit

No, the volume is not encrypted. Thanks.

xroot gravatar imagexroot ( 2017-09-08 14:33:09 -0500 )edit

seems to me an xen hypervisor issue ( did you cheked xen logs for any erros ?) i never faced this kind issue with KVM ,it will be good if you paste nova-compute logs with this call

billy gravatar imagebilly ( 2017-09-08 16:45:19 -0500 )edit