Bug 1758420

Summary: [RFE] Ability to import an image in multiple stores
Product: Red Hat OpenStack Reporter: Abhishek Kekane <akekane>
Component: openstack-glanceAssignee: Abhishek Kekane <akekane>
Status: CLOSED ERRATA QA Contact: Mike Abrams <mabrams>
Severity: high Docs Contact: Chuck Copello <ccopello>
Priority: high    
Version: 17.0 (Wallaby)CC: amcleod, athomas, cyril, dcadzow, eglynn, gcharot, jjoyce, johfulto, nwolf, pgrist
Target Milestone: betaKeywords: FutureFeature, Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: docs-accepted
Fixed In Version: openstack-glance-19.0.3-0.20200313113446.3e16bc7.el8ost, python-glanceclient-2.17.0-0.20200310160931.40c19aa.el8ost Doc Type: Release Note
Doc Text:
In Red Hat OpenStack Platform 16.1, you can use the Image Service (glance) to copy existing image data into multiple stores with a single command. This removes the need for the operator to copy data manually and update image locations.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-07-29 07:49:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1225775    
Bug Blocks: 1789430, 1802772    

Description Abhishek Kekane 2019-10-04 05:52:42 UTC
Glance currently supports configuring of multiple stores. However the import workflow only allow to push image data in one store. As a result, operators' today need to perform a number of manual steps in order to replicate image bits on backend glance stores despite using the 'enabled_backends' configuration option.

Since glance supports multi stores, it should propose a feature to upload
image data into these stores at once to facilitate operators' work.

Similar blueprint:
https://blueprints.launchpad.net/glance/+spec/import-multi-stores

Comment 2 Abhishek Kekane 2019-11-28 14:29:41 UTC
Working PoC for reference - https://review.opendev.org/667132

Comment 3 Abhishek Kekane 2020-02-10 19:32:51 UTC
Patch merged in master branch; https://review.opendev.org/#/c/667132/

Comment 4 Abhishek Kekane 2020-02-19 12:10:25 UTC
Found one issue for this feature, fixed proposed to master branch, https://review.opendev.org/708629

Need to backport this fix as well along with main patch

Comment 7 Abhishek Kekane 2020-02-26 18:00:43 UTC
Both patches has been backported to downstream train release.
https://code.engineering.redhat.com/gerrit/192742
https://code.engineering.redhat.com/gerrit/192743

Comment 8 John Fulton 2020-03-12 12:21:47 UTC
The fixed-in of this bug will need to include glance and python-glanceclient

Comment 12 Cyril Roelandt 2020-04-22 20:56:05 UTC
This also requires python-glanceclient-2.17.0-0.20200310160931.40c19aa.el8ost.

Comment 13 John Fulton 2020-04-27 19:48:43 UTC
(In reply to Cyril Roelandt from comment #12)
> This also requires
> python-glanceclient-2.17.0-0.20200310160931.40c19aa.el8ost.

I have this version but it doesn't support what we need

(undercloud) [stack@site-undercloud-0 tests]$ rpm -qa | grep glance
puppet-glance-15.4.1-0.20200413090713.a9b1a12.el8ost.noarch
python3-glanceclient-2.17.0-0.20200310160930.40c19aa.el8ost.noarch
(undercloud) [stack@site-undercloud-0 tests]$ 

Upstream I need glance-client 3.0. Was the feature backported to 2.17? 

It doesn't recognize the --stores top

(undercloud) [stack@site-undercloud-0 tests]$ glance --verbose 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 --stores default_backend,dcn1
usage: glance [--version] [-d] [-v] [--get-schema] [-f]
              [--os-image-url OS_IMAGE_URL]
              [--os-image-api-version OS_IMAGE_API_VERSION]
              [--profile HMAC_KEY] [--os-region-name OS_REGION_NAME]
              [--os-auth-token OS_AUTH_TOKEN]
              [--os-service-type OS_SERVICE_TYPE]
              [--os-endpoint-type OS_ENDPOINT_TYPE] [--insecure]
              [--os-cacert <ca-certificate>] [--os-cert <certificate>]
              [--os-key <key>] [--timeout <seconds>] [--collect-timing]
              [--os-auth-type <name>] [--os-auth-url OS_AUTH_URL]
              [--os-system-scope OS_SYSTEM_SCOPE]
              [--os-domain-id OS_DOMAIN_ID] [--os-domain-name OS_DOMAIN_NAME]
              [--os-project-id OS_PROJECT_ID]
              [--os-project-name OS_PROJECT_NAME]
              [--os-project-domain-id OS_PROJECT_DOMAIN_ID]
              [--os-project-domain-name OS_PROJECT_DOMAIN_NAME]
              [--os-trust-id OS_TRUST_ID]
              [--os-default-domain-id OS_DEFAULT_DOMAIN_ID]
              [--os-default-domain-name OS_DEFAULT_DOMAIN_NAME]
              [--os-user-id OS_USER_ID] [--os-username OS_USERNAME]
              [--os-user-domain-id OS_USER_DOMAIN_ID]
              [--os-user-domain-name OS_USER_DOMAIN_NAME]
              [--os-password OS_PASSWORD]
              <subcommand> ...
glance: error: unrecognized arguments: --stores default_backend,dcn1
(undercloud) [stack@site-undercloud-0 tests]$ 

I have multiple stores set up. 

(undercloud) [stack@site-undercloud-0 tests]$ glance stores-info
/usr/lib/python3.6/site-packages/urllib3/connection.py:362: SubjectAltNameWarning: Certificate for 192.168.24.2 has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
  SubjectAltNameWarning
/usr/lib/python3.6/site-packages/urllib3/connection.py:362: SubjectAltNameWarning: Certificate for 192.168.24.2 has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
  SubjectAltNameWarning
/usr/lib/python3.6/site-packages/urllib3/connection.py:362: SubjectAltNameWarning: Certificate for 192.168.24.2 has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
  SubjectAltNameWarning
/usr/lib/python3.6/site-packages/urllib3/connection.py:362: SubjectAltNameWarning: Certificate for 192.168.24.2 has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818. (See https://github.com/shazow/urllib3/issues/497 for details.)
  SubjectAltNameWarning
+----------+----------------------------------------------------------------------------------+
| Property | Value                                                                            |
+----------+----------------------------------------------------------------------------------+
| stores   | [{"id": "default_backend", "description": "Default glance store backend.",       |
|          | "default": "true"}, {"id": "http", "read-only": "true"}]                         |
+----------+----------------------------------------------------------------------------------+
(undercloud) [stack@site-undercloud-0 tests]$

Comment 15 John Fulton 2020-04-28 13:10:47 UTC
The fixedin for this bug needs to contain a glance client which has the features we need to actually use the new feature.

Comment 16 John Fulton 2020-04-28 13:12:52 UTC
ON_DEV was an accident

Comment 25 Cyril Roelandt 2020-06-05 15:10:26 UTC
@Jason: how can I know what versions are missing in RHOS-16.1-RHEL-8-20200602.n.1, and also why?

Comment 26 Alex McLeod 2020-06-16 12:29:58 UTC
If this bug requires doc text for errata release, please set the 'Doc Type' and provide draft text according to the template in the 'Doc Text' field. The documentation team will review, edit, and approve the text.

If this bug does not require doc text, please set the 'requires_doc_text' flag to '-'.

Comment 29 errata-xmlrpc 2020-07-29 07:49:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:3148