[Bug 1948439] Re: Not able to create image with cinder as storage backend
Hemanth Nakkina
1948439 at bugs.launchpad.net
Thu Oct 28 05:47:39 UTC 2021
Verified the test case on focal and its successful.
Package installed:
$ sudo dpkg -l | grep glance-store
ii python3-glance-store 2.0.0-0ubuntu3 all OpenStack Image Service store library - Python 3.x
$ sudo systemctl restart glance-api.service
Create a single image
$ openstack image create --container-format bare --disk-format qcow2 --file /home/ubuntu/images/cirros-0.4.0-x86_64-disk.img test
+------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| container_format | bare |
| created_at | 2021-10-28T03:27:03Z |
| disk_format | qcow2 |
| file | /v2/images/00207cb6-a16d-4aad-80ad-a78fbe37a454/file |
| id | 00207cb6-a16d-4aad-80ad-a78fbe37a454 |
| min_disk | 0 |
| min_ram | 0 |
| name | test |
| owner | 5f8dd88e2e2c436cb44098f4f63d0fe8 |
| properties | os_hidden='False', owner_specified.openstack.md5='', owner_specified.openstack.object='images/test', owner_specified.openstack.sha256='' |
| protected | False |
| schema | /v2/schemas/image |
| status | queued |
| tags | |
| updated_at | 2021-10-28T03:27:03Z |
| visibility | shared |
+------------------+------------------------------------------------------------------------------------------------------------------------------------------+
$ openstack image list
+--------------------------------------+------+--------+
| ID | Name | Status |
+--------------------------------------+------+--------+
| 00207cb6-a16d-4aad-80ad-a78fbe37a454 | test | active |
+--------------------------------------+------+--------+
Created 4 more images in parallel and successful
$ openstack image list
+--------------------------------------+-------+--------+
| ID | Name | Status |
+--------------------------------------+-------+--------+
| 00207cb6-a16d-4aad-80ad-a78fbe37a454 | test | active |
| 09843e9d-2527-4e38-9c62-e217257cc0c5 | test1 | active |
| 5a577248-30b5-45af-958d-a9a52af46ac6 | test2 | active |
| 8e9e4097-557e-4afc-8e3d-5590d0c90189 | test3 | active |
| 710d3697-b2d3-4259-9028-28bd7609f4c8 | test4 | active |
+--------------------------------------+-------+--------+
** Tags removed: verification-needed-focal
** Tags added: verification-done-focal
--
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to Ubuntu Cloud Archive.
https://bugs.launchpad.net/bugs/1948439
Title:
Not able to create image with cinder as storage backend
Status in Ubuntu Cloud Archive:
Fix Released
Status in Ubuntu Cloud Archive ussuri series:
Triaged
Status in python-glance-store package in Ubuntu:
Fix Released
Status in python-glance-store source package in Focal:
Fix Committed
Bug description:
On Ussuri, creation of image with cinder as glance storage backend
fails.
Reproduction Steps:
1. Deploy cloud environment - focal ussuri
2. Change the following configuration in /etc/glance/glance-api.conf to setup Cinder as Storage backend to Glance.
[DEFAULT]
enabled_backends = local:file, cinder:cinder
[glance_store]
default_backend = cinder
Restart glance-api service
systemctl restart glance-api.service
3. Upload a cirros image to glance
openstack image create --container-format bare --disk-format qcow2 --file /home/ubuntu/images/cirros-0.4.0-x86_64-disk.img test
The above command throws an exception.
Exception in /var/log/glance/glance-api.log
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder [req-282b09b7-3db4-44f7-937c-b7c2fb71453b da9d04a5652c41b98126e1a2b1ce9601 1c133b846e4e4948873aa3af847c23df - 4d430c7d67e0416a95e38b10aad4fc5f 4d430c7d67e0416a95e38b10aad4fc5f] Exception while accessing to cinder volume 7553d4cd-d315-4f97-8abe-f375864fa84a.: TypeError: temporary_chown() got an unexpected keyword argument 'backend'
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder Traceback (most recent call last):
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder File "/usr/lib/python3/dist-packages/glance_store/_drivers/cinder.py", line 575, in _open_cinder_volume
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder with self.temporary_chown(
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder File "/usr/lib/python3.8/contextlib.py", line 240, in helper
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder return _GeneratorContextManager(func, args, kwds)
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder File "/usr/lib/python3.8/contextlib.py", line 83, in __init__
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder self.gen = func(*args, **kwds)
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder TypeError: temporary_chown() got an unexpected keyword argument 'backend'
2021-10-20 06:34:34.894 279293 ERROR glance_store._drivers.cinder
Package used:
python3-glance-store/focal-updates,now 2.0.0-0ubuntu2 all [installed,automatic]
Analysis:
The method signature and the calling method args seems different for function temporary_chown
https://opendev.org/openstack/glance_store/src/tag/2.0.0/glance_store/_drivers/cinder.py#L458
https://opendev.org/openstack/glance_store/src/tag/2.0.0/glance_store/_drivers/cinder.py#L573
This is fixed in upstream as part of https://bugs.launchpad.net/glance-store/+bug/1870289
The bug fix for LP#1870289 need to be SRU'ed to Ubuntu python3-glance-store packages.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
[Impact]
Not able to upload an image to glance
[Test Case]
1. Deploy cloud with focal ussuri
2. Configure cinder as glance storage backend
Ensure the following configurations in glance-api.conf
[DEFAULT]
enabled_backends = local:file, cinder:cinder
[glance_store]
default_backend = cinder
Restart glance-api service
systemctl restart glance-api.service
3. Upload an image to glance
openstack image create --container-format bare --disk-format qcow2 --file /home/ubuntu/images/cirros-0.4.0-x86_64-disk.img test
Image creation should be successful.
4. Repeat step 3 with creation of 5 images concurrently.
Run the command in step3 in 5 different consoles.
Verify if image creation is successful for all of them.
'openstack image list' should list all the 5 images
[Regression Potential]
The fix enhanced the locking mechanism to support concurrent image creation requests in addition to correcting the function signature that caused the initial problem. The test case is enhanced to verify concurrent
creation of images to avoid any regressions.
Also the patch is verified upstream via CI unit test cases and functional test cases.
To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1948439/+subscriptions
More information about the Ubuntu-openstack-bugs
mailing list