Bug 1654408 - Glance image conversion fails when using files
Summary: Glance image conversion fails when using files
Keywords:
Status: CLOSED DUPLICATE of bug 1712001
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-heat-templates
Version: 14.0 (Rocky)
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: beta
: 16.2 (Train on RHEL 8.4)
Assignee: Pranali Deore
QA Contact: Mike Abrams
URL:
Whiteboard:
Depends On: 1654413
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-11-28 17:27 UTC by Gregory Charot
Modified: 2023-09-15 01:27 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Release Note
Doc Text:
For Image service (glance) image conversion, the `glance-direct` method is not enabled by default. To enable this feature, set `enabled_import_methods` to `[glance-direct,web-download]` or `[glance-direct]` in the `DEFAULT` section of the `glance-api.conf` file. + The Image service must have a staging area when you use the `glance-direct` import method. Set the `node_staging_uri` option in the `DEFAULT` section of the `glance-api.conf` file to `file://<absolute-directory-path>`. This path must be on a shared file system that is available to all Image service API nodes.
Clone Of:
Environment:
Last Closed: 2021-05-20 05:33:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-3837 0 None None None 2022-08-18 17:14:32 UTC

Description Gregory Charot 2018-11-28 17:27:08 UTC
Description of problem:

It is not possible to convert a glance image with a file path, only url are enabled by default.

Version-Release number of selected component (if applicable):

14

How reproducible:

Always

Steps to Reproduce:
1. glance image-create-via-import --disk-format qcow2 --container-format bare --name cirros --file cirros-0.4.0-x86_64-disk.img
Import method 'glance-direct' is not valid for this cloud. Valid values can be retrieved with import-info command.
2.  glance import-info
+----------------+----------------------------------------------------------------------------------+
| Property       | Value                                                                            |
+----------------+----------------------------------------------------------------------------------+
| import-methods | {"type": "array", "description": "Import methods available.", "value": ["web-    |
|                | download"]}                                                                      |
+----------------+----------------------------------------------------------------------------------+

3.  grep web-download /etc/glance/ -ri | grep -v '#'
/etc/glance/glance-api.conf:enabled_import_methods = [web-download]


Actual results:

Not able to convert a glance image when using a file

Expected results:

able to convert a glance image when using a file


Additional info:

Need to enable it in glance config

enabled_import_methods = [glance-direct,web-download]
/var/lib/config-data/puppet-generated/glance_api/etc/glance/glance-api.conf

This should be added in THT

Comment 1 Gregory Charot 2018-11-28 17:50:37 UTC
Looks like GlanceEnabledImportMethods defaults to web-download 

We may want to add glance-direct as well or document it downstream so that users are aware.

Comment 3 Cyril Roelandt 2020-05-05 17:35:41 UTC
Assigning to Pranali since she's back :)

Is this serious enough to justify a backport to 16.1, 16, 15 and 13?

Comment 4 Giulio Fidente 2020-05-05 17:43:41 UTC
(In reply to Cyril Roelandt from comment #3)
> Assigning to Pranali since she's back :)
> 
> Is this serious enough to justify a backport to 16.1, 16, 15 and 13?

to me, unless there are obscure reasons to avoid glance-direct, it seems just a matter of adding it to the default list in [1] so safe to backport

maybe use "allowed_values" [2] to restrict the available values

1. https://github.com/openstack/tripleo-heat-templates/blob/master/deployment/glance/glance-api-container-puppet.yaml#L162
2. https://docs.openstack.org/heat/rocky/template_guide/hot_spec.html#allowed-values

Comment 5 Pranali Deore 2020-05-06 05:35:09 UTC
GlanceEnabledImportMethods set the default value to 'web-download' and restrict Glance
from using its 'glance-direct' import method because the 'glance-direct' method requires
a special configuration when deployed in an HA environment.


In the case of an HA setup if image import method is 'glance-direct', it requires a shared
consistent staging location on the controller nodes otherwise it might happen that the image
is uploaded to one node and triggering the import is executed on a different node - where
the image does not exist.

Hence when import method 'glance-direct' is needed, operators need to enable it explicitly
with enabling NFS across the controller nodes to share the staging. 

Ex. By setting up below THT parameter via env file,

parameter_defaults:
  GlanceEnabledImportMethods: web-download, glance-direct

  # NFS share to mount for image import staging
  # Type: string
  GlanceStagingNfsShare: '192.168.122.1:/export/glance-staging'


And seems it is already documented here[1]
https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html/advanced_overcloud_customization/storage_configuration

Comment 9 Cyril Roelandt 2020-07-03 18:05:10 UTC
The Doc Text does not specify that a shared staging location must be available.

@Alex: is this something that should be added?


@Greg: NFS would only be used for the staging area, not as an actual backend. I'm not sure whether CephFS could fill that role. Could you quote what Erno told you about this?

Comment 10 Alex McLeod 2020-07-06 08:30:18 UTC
Hi @Cyril, sounds like it should be added. I am not all that familiar with glance - I am compiling the Release Notes, which rely on the 'Doc Text' field, and editing the 'Doc Text' for Red Hat style and consistency. So I will defer to your expertise on technical issues! If you would like to add anything to the 'Doc Text' field, please feel free to do so. Thanks!

Comment 11 Cyril Roelandt 2020-07-06 17:50:17 UTC
@Alex: thanks, I updated the doc text.

Comment 20 Pranali Deore 2021-05-20 05:33:32 UTC
Yes, the shared staging location will be supported in newly added Distributed Image Import feature.
Marking this duplicate of #1712001

*** This bug has been marked as a duplicate of bug 1712001 ***

Comment 21 Red Hat Bugzilla 2023-09-15 01:27:55 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days


Note You need to log in before you can comment on or make changes to this bug.