Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Boot from volume after the volume was migrated


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/", line 302, in attach device_type=self['device_type'], encryption=encryption)

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

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

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

File "/opt/mystack/nova/lib/python2.7/site-packages/nova/virt/xenapi/", 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/", line 210, in call_xenapi return session.xenapi_request(method, args)

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

File "/opt/mystack/nova/lib/python2.7/site-packages/", 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!