I faced a same error when executing 'nova volume-update' in mitaka version with LVMVolumeDriver and found out what root cause is.
To begin with, current code has a problem that there is no exception code.
So, we can not find out what root cause is.
I've modified nova/virt/libvirt/driver.py like this:
@@ -1394,6 +1395,9 @@ while dev.wait_for_job(wait_for_job_clean=True): time.sleep(0.5) dev.resize(resize_to * units.Gi / units.Ki)
+ except Exception:
+ with excutils.save_and_reraise_exception():
+ LOG.exception(_LE("Failed to swap volume"))
finally: self._host.write_instance_config(xml)
<error logs after patching above>
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/driver.py", line 1389, in _swap_volume
dev.abort_job(pivot=True)
File "/usr/lib/python2.7/site-packages/nova/virt/libvirt/guest.py", line 500, in abort_job
self._guest._domain.blockJobAbort(self._disk, flags=flags)
File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 183, in doit
result = proxy_call(self._autowrap, f, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 141, in proxy_call
rv = execute(f, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 122, in execute
six.reraise(c, e, tb)
File "/usr/lib/python2.7/site-packages/eventlet/tpool.py", line 80, in tworker
rv = meth(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 733, in blockJobAbort
if ret == -1: raise libvirtError ('virDomainBlockJobAbort() failed', dom=self)
libvirtError: block copy still active: disk 'vdb' not ready for pivot yet
As you can see, a root cause is a abort_job method.
Before executing this method, nova executes a wait_for_job method to wait for job completion, but it seems that it doesn't work correctly.
I added a following sleep method as a test and confirmed a 'nova volume-update' command works correctly.
@@ -1386,6 +1386,7 @@
while dev.wait_for_job(): time.sleep(0.5)
+ time.sleep(10) dev.abort_job(pivot=True)
if resize_to:
# NOTE(alex_xu): domain.blockJobAbort isn't sync call. This
I don't know the reason why wait_for_job method doesn't work correctly.
Does anyone know it?
I faced a same error when executing 'nova volume-update' in mitaka version with LVMVolumeDriver and found out what root cause is. libvirt/ driver. py like this:
To begin with, current code has a problem that there is no exception code.
So, we can not find out what root cause is.
I've modified nova/virt/
@@ -1394,6 +1395,9 @@
while dev.wait_ for_job( wait_for_ job_clean= True):
time.sleep( 0.5)
dev. resize( resize_ to * units.Gi / units.Ki) save_and_ reraise_ exception( ): _LE("Failed to swap volume"))
self. _host.write_ instance_ config( xml)
+ except Exception:
+ with excutils.
+ LOG.exception(
finally:
<error logs after patching above>
Traceback (most recent call last): python2. 7/site- packages/ nova/virt/ libvirt/ driver. py", line 1389, in _swap_volume abort_job( pivot=True) python2. 7/site- packages/ nova/virt/ libvirt/ guest.py" , line 500, in abort_job _guest. _domain. blockJobAbort( self._disk, flags=flags) python2. 7/site- packages/ eventlet/ tpool.py" , line 183, in doit self._autowrap, f, *args, **kwargs) python2. 7/site- packages/ eventlet/ tpool.py" , line 141, in proxy_call python2. 7/site- packages/ eventlet/ tpool.py" , line 122, in execute python2. 7/site- packages/ eventlet/ tpool.py" , line 80, in tworker python2. 7/site- packages/ libvirt. py", line 733, in blockJobAbort kJobAbort( ) failed', dom=self)
File "/usr/lib/
dev.
File "/usr/lib/
self.
File "/usr/lib/
result = proxy_call(
File "/usr/lib/
rv = execute(f, *args, **kwargs)
File "/usr/lib/
six.reraise(c, e, tb)
File "/usr/lib/
rv = meth(*args, **kwargs)
File "/usr/lib64/
if ret == -1: raise libvirtError ('virDomainBloc
libvirtError: block copy still active: disk 'vdb' not ready for pivot yet
As you can see, a root cause is a abort_job method.
Before executing this method, nova executes a wait_for_job method to wait for job completion, but it seems that it doesn't work correctly.
I added a following sleep method as a test and confirmed a 'nova volume-update' command works correctly.
@@ -1386,6 +1386,7 @@
time. sleep(0. 5)
while dev.wait_for_job():
+ time.sleep(10)
dev. abort_job( pivot=True) blockJobAbort isn't sync call. This
if resize_to:
# NOTE(alex_xu): domain.
I don't know the reason why wait_for_job method doesn't work correctly.
Does anyone know it?
<my environment> 1.2.17- 13.el7_ 2.5.x86_ 64 nova-compute- 13.1.1- 2.el7ost. noarch common- rhev-2. 3.0-31. el7_2.21. x86_64 rhev-2. 3.0-31. el7_2.21. x86_64
libvirt-
openstack-
qemu-kvm-
qemu-kvm-