Bug 1243829

Summary: overcloud image upload creates duplicate images
Product: Red Hat OpenStack Reporter: Steven Hardy <shardy>
Component: python-rdomanager-oscpluginAssignee: Marek Aufart <maufart>
Status: CLOSED ERRATA QA Contact: Amit Ugol <augol>
Severity: unspecified Docs Contact:
Priority: high    
Version: unspecifiedCC: akrivoka, brad, calfonso, dmacpher, jason.dobies, jslagle, maufart, mburns, rhel-osp-director-maint
Target Milestone: y1Keywords: Triaged, ZStream
Target Release: 7.0 (Kilo)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-rdomanager-oscplugin-0.0.9-2.el7ost Doc Type: Bug Fix
Doc Text:
The "openstack overcloud image upload" command uploaded Overcloud images even if old versions existed in Glance. This resulted in images with duplicate names, which caused Overcloud creation to fail. This fix modifies the tool to skip existing images. The tool also includes an "--update-existing" option to update existing images. Overcloud creation now uses the new Overcloud images stored in Glance without failure.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-08 12:15:07 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:

Description Steven Hardy 2015-07-16 12:28:51 UTC
Description of problem:
When running "openstack overcloud image upload" more than once, we create duplicate images, even if the local image files are unmodified:


Version-Release number of selected component (if applicable):
I'm running oscplugin from git @ 11bd32adf86b9bf0fb488fb16b49d38033f79440 but the issue affects all currently packaged versions too AFAICT.

How reproducible:
Always

Steps to Reproduce:
[stack@instack ~]$ glance image-list
+--------------------------------------+------------------------+-------------+------------------+----------+--------+
| ID                                   | Name                   | Disk Format | Container Format | Size     | Status |
+--------------------------------------+------------------------+-------------+------------------+----------+--------+
| a45c40e8-9fb2-4107-adf3-dafb9065c71f | bm-deploy-kernel       | aki         | aki              | 5026624  | active |
| a9297bfd-9967-42ef-a474-bcfa1b3168bd | bm-deploy-ramdisk      | ari         | ari              | 58822452 | active |
| 04322d2c-60de-41ce-89b2-bab4e5c344db | overcloud-full-initrd  | ari         | ari              | 33613984 | active |
| 8c8be470-9203-47bf-b8c1-21286bf2ff54 | overcloud-full-vmlinuz | aki         | aki              | 5026624  | active |
+--------------------------------------+------------------------+-------------+------------------+----------+--------+
[stack@instack ~]$ openstack overcloud image upload
[stack@instack ~]$ glance image-list
+--------------------------------------+------------------------+-------------+------------------+-----------+--------+
| ID                                   | Name                   | Disk Format | Container Format | Size      | Status |
+--------------------------------------+------------------------+-------------+------------------+-----------+--------+
| a45c40e8-9fb2-4107-adf3-dafb9065c71f | bm-deploy-kernel       | aki         | aki              | 5026624   | active |
| 6ea23338-edf2-4987-b15b-b9ea9912000c | bm-deploy-kernel       | aki         | aki              | 5026624   | active |
| a9297bfd-9967-42ef-a474-bcfa1b3168bd | bm-deploy-ramdisk      | ari         | ari              | 58822452  | active |
| 0aaa4c24-78c4-4635-8793-48045a30e512 | bm-deploy-ramdisk      | ari         | ari              | 58822452  | active |
| 4f3155d5-26cd-4da1-abfd-c7ea1320f3c9 | overcloud-full         | qcow2       | bare             | 978059264 | active |
| 04322d2c-60de-41ce-89b2-bab4e5c344db | overcloud-full-initrd  | ari         | ari              | 33613984  | active |
| a4b52eec-589a-455c-b12c-0303da4024af | overcloud-full-initrd  | ari         | ari              | 33613984  | active |
| 8c8be470-9203-47bf-b8c1-21286bf2ff54 | overcloud-full-vmlinuz | aki         | aki              | 5026624   | active |
| 53319340-f510-4442-ab60-1a705c7f6fc6 | overcloud-full-vmlinuz | aki         | aki              | 5026624   | active |
+--------------------------------------+------------------------+-------------+------------------+-----------+--------+


Actual results:
Duplicate images created

Expected results:
I expected one of the following:
1. Just upload the missing overcloud-full qcow image
2. Look at the images and only update those which have been modified.

I wasn't sure if we had (2) implemented, but that's the way the devtest TripleO scripts work, so probably good to replicate IMO.

I manually removed the overcloud-full image because I knew my local image was modified, but I didn't expect all the other images to end up duplicated.

Comment 3 Jay Dobies 2015-07-16 19:03:35 UTC
One possible approach will be for the CLI to do a check to see if an image already exists with the name and fail if it does. We can offer a flag to overwrite the existing image if found which would delete the existing first (assuming glance doesn't have its own sort of overwrite flag).

Ultimately, I could see a use in storing multiple versions of an image for upgrade purposes, but quite a bit of the rest of the workflow would need to change for that to make sense.

Comment 4 Marek Aufart 2015-07-24 16:29:53 UTC
*** Bug 1244139 has been marked as a duplicate of this bug. ***

Comment 7 Amit Ugol 2015-09-06 08:16:43 UTC
Latest version looks like this:

$ openstack overcloud image upload
Image "overcloud-full-vmlinuz" is up-to-date, skipping.
Image "overcloud-full-initrd" is up-to-date, skipping.
Image "overcloud-full" is up-to-date, skipping.
Image "bm-deploy-kernel" is up-to-date, skipping.
Image "bm-deploy-ramdisk" is up-to-date, skipping.
Image file "/httpboot/discovery.kernel" is up-to-date, skipping.
Image file "/httpboot/discovery.ramdisk" is up-to-date, skipping.


Updating images is a different matter and wasn't tested here. If that does not work it will need a new bug.

Comment 9 errata-xmlrpc 2015-10-08 12:15:07 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/RHSA-2015:1862