openshift / installer

Install an OpenShift 4.x cluster
https://try.openshift.com
Apache License 2.0
1.42k stars 1.38k forks source link

OpenStack: Re-enable glance image import #3403

Open mandre opened 4 years ago

mandre commented 4 years ago

We've seen on a few clouds that glance image import is enabled but configured improperly, leading the installer to block on image import.

When trying to create glance image via import, the image gets stuck in the uploading status and doesn't move to importing and then active as it should.

$ glance import-info
+----------------+----------------------------------------------------------------------------------+
| Property       | Value                                                                            |
+----------------+----------------------------------------------------------------------------------+
| import-methods | {"type": "array", "description": "Import methods available.", "value": ["glance- |
|                | direct", "web-download"]}                                                        |
+----------------+----------------------------------------------------------------------------------+

$ glance image-create-via-import --container-format=bare --disk-format=qcow2 --file /home/centos/rhcos.qcow2 --name rhcos-imported

$ openstack image show rhcos-imported
+------------------+------------------------------------------------------------------+
| Field            | Value                                                            |
+------------------+------------------------------------------------------------------+
| checksum         | None                                                             |
| container_format | bare                                                             |
| created_at       | 2020-04-02T08:00:56Z                                             |
| disk_format      | qcow2                                                            |
| file             | /v2/images/8307a69e-650b-41e8-a622-1969a2f9d95e/file             |
| id               | 8307a69e-650b-41e8-a622-1969a2f9d95e                             |
| min_disk         | 0                                                                |
| min_ram          | 0                                                                |
| name             | rhcos-imported                                                   |
| owner            | ef5bc5a705ee4a33acf95fbd6ca10d8f                                 |
| properties       | locations='[]', os_hash_algo=, os_hash_value=, os_hidden='False' |
| protected        | False                                                            |
| schema           | /v2/schemas/image                                                |
| size             | None                                                             |
| status           | uploading                                                        |
| tags             |                                                                  |
| updated_at       | 2020-04-02T08:00:56Z                                             |
| virtual_size     | None                                                             |
| visibility       | shared                                                           |
+------------------+------------------------------------------------------------------+

Everything seems to point to a misconfiguration of glance. This wouldn't work for example if glance was running behind httpd, or could also be an issue with multiple stores.

However, since we had multiple report of such issue, we decided to switch back to the usual image upload until we're able to detect if the cloud really supports glance direct image import: openshift/installer#3394

This issue tracks re-enabling glance image import.

References

mandre commented 4 years ago

/label platform/openstack

openshift-bot commented 4 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

mandre commented 4 years ago

/lifecycle frozen

EmilienM commented 4 years ago

I randomly came across this one and I confirm that if Glance API is not configured with "glance-direct" in enabled_import_methods, the Glance API will reject the request and the image will be queued forever. Indeed this is not a feature that all clouds offer for various reasons (security mainly?) so at this point it's safe to not rely on it.

clnperez commented 3 years ago

Do we not know what is misconfigured, iow, a way to reliable check? The summary sounds like the presence of glance-direct isn't a guarantee this will work. The last comment has me a bit confused.