Ask Your Question
0

Volume migration fails "NotImplementedError: Swap only supports host devices"

asked 2018-03-05 12:56:50 -0600

woltjert gravatar image

updated 2018-03-05 12:58:41 -0600

Cinder is set up to use two separate ceph storage pools. When trying to migrate an attached volume; the new volume is created on the other pool, an error occurs, the migration fails, and the new volume is eventually deleted.

The only real error output I can find is in /var/log/nova/nova-compute.log

2018-03-05 08:30:57.404 32084 INFO nova.compute.manager [req-6c1860ec-1a71-4b65-bc14-54a3fd7c7069 8bf003cdf58a4233b7e279aee1eec593 ee5d821a39174d8a91e3a741a6ecd97e - default default] [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc] Swapping volume fc8e2f25-60de-44b5-bddf-98a7d35a9c21 for 7f7bf267-2b5a-40b4-9ab6-8b509c5b45f6
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [req-6c1860ec-1a71-4b65-bc14-54a3fd7c7069 8bf003cdf58a4233b7e279aee1eec593 ee5d821a39174d8a91e3a741a6ecd97e - default default] [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc] Failed to swap volume fc8e2f25-60de-44b5-bddf-98a7d35a9c21 for 7f7bf267-2b5a-40b4-9ab6-8b509c5b45f6: NotImplementedError: Swap only supports host devices
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc] Traceback (most recent call last):
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc]   File "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 5058, in _swap_volume
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc]     resize_to)
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc]   File "/usr/lib/python2.7/dist-packages/nova/virt/libvirt/driver.py", line 1349, in swap_volume
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc]     raise NotImplementedError(_("Swap only supports host devices"))
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc] NotImplementedError: Swap only supports host devices
2018-03-05 08:30:58.501 32084 ERROR nova.compute.manager [instance: 7249d430-743e-4463-8d28-d13cdb8cfddc] 
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server [req-6c1860ec-1a71-4b65-bc14-54a3fd7c7069 8bf003cdf58a4233b7e279aee1eec593 ee5d821a39174d8a91e3a741a6ecd97e - default default] Exception during message handling: NotImplementedError: Swap only supports host devices
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server Traceback (most recent call last):
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/server.py", line 160, in _process_incoming
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server     res = self.dispatcher.dispatch(message)
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 213, in dispatch
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server     return self._do_dispatch(endpoint, method, ctxt, args)
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 183, in _do_dispatch
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server     result = func(ctxt, **new_args)
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/dist-packages/nova/exception_wrapper.py", line 76, in wrapped
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server     function_name, call_dict, binary)
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server     self.force_reraise()
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2018-03-05 08:31:02.027 32084 ERROR oslo_messaging ...
(more)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2018-03-05 14:31:48 -0600

updated 2018-03-07 17:13:05 -0600

It looks like the libvirt's volume driver for Ceph (RBD) does not support volume swapping (meaning you can't migrate an attached volume). Another driver that does not support swapping is Sheepdog, for example - maybe because they are not "mounted" on the hypervisor and thus not available as a filesystem path, but that's just my assumption.

The piece of code that decides this is located at nova/virt/libvirt/driver.py:

    if not conf.source_path:
        self._disconnect_volume(new_connection_info, disk_dev, instance)
        raise NotImplementedError(_("Swap only supports host devices"))

In other words, it tries to get a property of the particular volume driver called source_path, but RBD driver along with some others don't define one. I don't have a firsthand experience with RBD driver for Cinder, but I'm afraid the swap feature doesn't work for now: https://blueprints.launchpad.net/cind...

edit flag offensive delete link more

Comments

Just to amend - have you tried migrating the volume after detaching it from the instance? Naturally, the swap_volume() method shouldn't have to be called in that case.

Peter Slovak gravatar imagePeter Slovak ( 2018-03-06 04:29:42 -0600 )edit

My understanding of that launchpad blueprint was that cinder DOES support migration on RBD stores but it is not driver assisted and thus is ineffective. I am able to migrate volumes as long as they are not attached to an instance, and RBD does give a source path to libvirt, prefixed by rbd://

woltjert gravatar imagewoltjert ( 2018-03-06 07:57:13 -0600 )edit

You're right, the migration itself works as long as you're not migrating an attached volume and thus the migration doesn't lead to the volume swapping. I've clarified the original answer, thanks.

Peter Slovak gravatar imagePeter Slovak ( 2018-03-07 17:14:24 -0600 )edit

That conclusion does reflect what I have seen. I must say it is disappointing to me, considering ceph is one of the big ticket storage solutions for libvirt and openstack. Hopefully this issue is on their radar. Thanks for all of your help.

woltjert gravatar imagewoltjert ( 2018-03-08 07:15:49 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-03-05 12:56:50 -0600

Seen: 177 times

Last updated: Mar 07 '18