Resizing a volume that is in use fails and the volume ends up in error_extending state.
$ OS_VOLUME_API_VERSION=3.42 cinder -v extend 006e4fcc-aa4d-414b-981c-5b2360d30202 33
$ openstack volume list
+--------------------------------------+--------------------------+-----------------+------+-----------------------------------------------+
| ID | Display Name | Status | Size | Attached to |
+--------------------------------------+--------------------------+-----------------+------+-----------------------------------------------+
| 43ecd3fa-185e-49ac-99aa-d1fc569ee4ac | abcde-example-server_db | error_extending | 30 | Attached to abcde-example-server on /dev/vdb |
+--------------------------------------+--------------------------+-----------------+------+-----------------------------------------------+
The cinder API accepts the request but the actual resize of the qemu image file fails.
The cinder log file shows a Qemu file locking error
/var/log/cinder/cinder-volume.log:Command: qemu-img resize /var/lib/cinder/mnt/1f1346fd5f978eba20ba745787697239/volume-43ecd3fa-185e-49ac-99aa-d1fc569ee4ac 50G
/var/log/cinder/cinder-volume.log:Stderr: u'WARNING: Image format was not specified for \'/var/lib/cinder/mnt/1f1346fd5f978eba20ba745787697239/volume-43ecd3fa-185e-49ac-99aa-d1fc569ee4ac\' and probing guessed raw.\n Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n Specify the \'raw\' format explicitly to remove the restrictions.\nqemu-img: Could not open \'/var/lib/cinder/mnt/1f1346fd5f978eba20ba745787697239/volume-43ecd3fa-185e-49ac-99aa-d1fc569ee4ac\': Failed to get "write" lock\nIs another process using the image?\n'
/var/log/cinder/cinder-volume.log:2020-02-06 10:13:17.087 12523 ERROR cinder.volume.manager Command: qemu-img resize /var/lib/cinder/mnt/1f1346fd5f978eba20ba745787697239/volume-43ecd3fa-185e-49ac-99aa-d1fc569ee4ac 50G
/var/log/cinder/cinder-volume.log:2020-02-06 10:13:17.087 12523 ERROR cinder.volume.manager Stderr: u'WARNING: Image format was not specified for \'/var/lib/cinder/mnt/1f1346fd5f978eba20ba745787697239/volume-43ecd3fa-185e-49ac-99aa-d1fc569ee4ac\' and probing guessed raw.\n Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n Specify the \'raw\' format explicitly to remove the restrictions.\nqemu-img: Could not open \'/var/lib/cinder/mnt/1f1346fd5f978eba20ba745787697239/volume-43ecd3fa-185e-49ac-99aa-d1fc569ee4ac\': Failed to get "write" lock\nIs another process using the image?\n'
The same command worked with an instance still running qemu 2.9
Used versions:
Cinder: 12.0.9-0ubuntu1
Qemu: 1:2.11+dfsg-1ubuntu7.21~cloud0
libvirt: 4.0.0-1ubuntu8.14~cloud0
I am using Quobyte as Cinder driver.
This is probably related to https:/ /bugs.launchpad .net/cinder/ +bug/1870367