Can't import an image

Bug #1820939 reported by Ray
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Unassigned

Bug Description

Running ansible aio 18.1.5. I am unable to import an image through the GUI.
Is just states cant upload an image. It's a local iso image.
When I refresh the page it comes back as pending forever

Revision history for this message
Joshua Randall (jcrandall) wrote :
Download full text (6.1 KiB)

We have also run into this issue, in our case on a stein system. Any use of the glance import functionality (such as by using `web-download` to import directly from a URL) results in the image having `queued` status forever and associated tasks remaining forever in the `pending` state.

For example, this is the result from attempting to import a cirros image:
```
# glance task-show 24c6c9d3-c47c-48ad-8666-4bedfee56714
+------------+----------------------------------------------------------------------------------+
| Property | Value |
+------------+----------------------------------------------------------------------------------+
| created_at | 2021-01-28T11:50:36Z |
| id | 24c6c9d3-c47c-48ad-8666-4bedfee56714 |
| input | {"import_req": {"method": {"name": "web-download", "uri": |
| | "http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img"}}, |
| | "image_id": "660cd94f-4cca-4dc3-92a7-b94e2557b358", "backend": null} |
| message | |
| owner | 7d11762e74654761944a4d158333d289 |
| result | None |
| status | pending |
| type | api_image_import |
| updated_at | 2021-01-28T11:50:36Z |
+------------+----------------------------------------------------------------------------------+
# glance image-show 660cd94f-4cca-4dc3-92a7-b94e2557b358
+------------------+--------------------------------------+
| Property | Value |
+------------------+--------------------------------------+
| checksum | None |
| container_format | bare |
| created_at | 2021-01-28T11:50:36Z |
| disk_format | qcow2 |
| id | 660cd94f-4cca-4dc3-92a7-b94e2557b358 |
| locations | [] |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros-0.5.1-test5 |
| os_hash_algo | None |
| os_hash_value | None |
| os_hidden | False |
| owner | 7d11762e74654761944a4d158333d289 |
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated_at | 2021-01-28T11:50:36Z ...

Read more...

Revision history for this message
Joshua Randall (jcrandall) wrote :

This issue has been addressed for the train release (and continues to be supported in victoria) via the os_glance role variable `glance_use_uwsgi` which defaults to True (https://github.com/openstack/openstack-ansible-os_glance/blob/stable/train/defaults/main.yml#L264-L266).

With the default setting on train, the situation is improved because the template for glance.api.conf will set `enable_image_import = False` when `glance_use_uwsgi` is set (https://github.com/openstack/openstack-ansible-os_glance/blob/stable/train/templates/glance-api.conf.j2#L19). Thus, a default deployment of a train release will have a glance service that simply refuses to support import requests with an error message saying it is unsupported.

In pike, the default value for `enable_image_import` was False, so there is no issue with that release - my expectation (unverified) is that a pike deployment of openstack-ansible would by default refuse to import images with an appropriate error message.

However, the queens, rocky, and stein releases have `enable_image_import` set to True by default and since there is no role option in the `os_glance` role provided by openstack-ansible to disable uWSGI, the situation ends up being that the glance API offers import functionality to clients, but it is broken (as reported here - the task list fills up with pending tasks indefinitely and -- perhaps worse -- no errors of any kind are logged to indicate the problem, not even with debug logging enabled).

A simple fix might have been to simply hard-code `enable_image_import = False` to the queens, rocky, and stein releases. However, while that will work for queens, according to the documentation, it is longer possible to set `enable_image_import = False` since the rocky release (from https://docs.openstack.org/glance/rocky/admin/interoperable-image-import.html):
```
enable_image_import must be either absent or set to True (the default).

 Note

In the Pike release, the default value for this option was False. This option is DEPRECATED and will be removed in the Rocky release.
```

Thus I think the current functionality of openstack-ansible for train and onwards that sets `enable_image_import = False` in `glance-api.conf` when uWSGI is enabled is unsupported (and it was removed from the documentation entirely as of the ussuri release).

Therefore, I think there is no supported fix for the behaviour of queens, rocky, and stein other than backporting the `glance_use_uwsgi` role option and the `enable_image_import` config templating from the train release to queens, rocky, and stein.

Perhaps a separate bug should be opened regarding the invalid `glance-api.conf` configuration generated by openstack-ansible when `glance_use_uwsgi` is set to True (the default).

Revision history for this message
Joshua Randall (jcrandall) wrote :

After discussion in IRC, I believe the situation as I understand it for each release is as follows:

Victoria (and onwards): running glance in WSGI (including uWSGI) is now supported (see https://review.opendev.org/c/openstack/glance/+/756865/1#message-daaca94a08228abfa2b6f41b21255a416cc42c4c and https://review.opendev.org/c/openstack/glance/+/754748)

Train, Ussuri: openstack-ansible has an option `glance_use_uwsgi` that should be set to `False` if you want interoperable image import to work. If you don't need image import to work, you should be able to edit your `glance-api.conf` and set `enabled_import_methods = []` to effectively disable imports (such that users get an error rather than endlessly pending import tasks).

Queens, Rocky, Stein: out of maintenance so will not be updated. `glance_use_uwsgi` is not an option, _but_ you can set `wsgi_app: False` in the `glance-api` service definition. I.e. something like: http://paste.openstack.org/show/802089/

Changed in openstack-ansible:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.