Bug 1275326 - openstack overcloud image upload --image-path <path> ignores image-path option
Summary: openstack overcloud image upload --image-path <path> ignores image-path option
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-tripleoclient
Version: 10.0 (Newton)
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Jose Luis Franco
QA Contact: Gurenko Alex
URL:
Whiteboard:
: 1327414 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-26 14:15 UTC by Jeremy
Modified: 2022-03-13 14:07 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-29 15:09:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log for upload attempt (16.05 KB, text/plain)
2015-10-26 14:16 UTC, Jeremy
no flags Details
Proposed patch (3.41 KB, patch)
2017-09-05 12:29 UTC, Morgan Weetman
mweetman: review+
Details | Diff
Proposed patch - updated (3.06 KB, patch)
2017-09-06 06:14 UTC, Morgan Weetman
mweetman: review+
Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker OSP-13531 0 None None None 2022-03-13 14:07:38 UTC

Description Jeremy 2015-10-26 14:15:53 UTC
Description of problem:

Rather than running "openstack overcloud image upload" from the same directory as the images I attempted to run the upload from /home/stack 

This resulted in an error:
[mchappel-director.ostack.qa.int.phx1.redhat.com] [09:40:19 AM]
[stack@mchappel-director ~]$ openstack overcloud image upload --image-path /home/stack/images/
ERROR: openstack [Errno 2] No such file or directory: 'overcloud-full.vmlinuz'

when I changed into /home/stack/images/ the command ran fine.

This is contrary to the built in help:
$ openstack help overcloud image upload
usage: openstack overcloud image upload [-h] [--image-path IMAGE_PATH]
                                        [--os-image OS_IMAGE]
                                        [--http-boot HTTP_BOOT]
                                        [--update-existing]

Create overcloud glance images from existing image files.

optional arguments:
  -h, --help            show this help message and exit
  --image-path IMAGE_PATH
                        Path to directory containing image files
  --os-image OS_IMAGE   OpenStack disk image filename
  --http-boot HTTP_BOOT
                        Root directory for discovery images
  --update-existing     Update images if already exist



For debugging I've also run with lots of -v's 
[mchappel-director.ostack.qa.int.phx1.redhat.com] [09:48:38 AM]
[stack@mchappel-director ~]$ ls -la /home/stack/images/ 
total 2307088
drwxrwxr-x.  3 stack stack      4096 Oct 26 09:32 .
drwx------. 12 stack stack      4096 Oct 26 09:44 ..
drwxrwxr-x.  2 stack stack      4096 Oct 26 09:21 7.0
-rw-rw-r--.  1 stack stack  61419520 Oct  7 17:12 deploy-ramdisk-ironic-7.1.0-39.tar
-rw-r--r--.  1 stack stack  56384263 Oct  7 15:16 deploy-ramdisk-ironic.initramfs
-rwxr-xr-x.  1 stack stack   5027648 Oct  7 15:16 deploy-ramdisk-ironic.kernel
-rw-rw-r--.  1 stack stack 155238400 Oct  7 17:12 discovery-ramdisk-7.1.0-39.tar
-rw-r--r--.  1 stack stack 150204679 Oct  7 15:33 discovery-ramdisk.initramfs
-rwxr-xr-x.  1 stack stack   5027648 Oct  7 15:33 discovery-ramdisk.kernel
-rw-rw-r--.  1 stack stack 964567040 Oct  7 17:13 overcloud-full-7.1.0-39.tar
-rw-r--r--.  1 stack stack  36762407 Oct  7 15:45 overcloud-full.initrd
-rw-r--r--.  1 stack stack 922770432 Oct  7 15:48 overcloud-full.qcow2
-rwxr-xr-x.  1 stack stack   5027648 Oct  7 15:45 overcloud-full.vmlinuz

[mchappel-director.ostack.qa.int.phx1.redhat.com] [09:48:52 AM]
[stack@mchappel-director ~]$ openstack overcloud image upload --image-path /home/stack/images/ -vvvvv  > upload.log 2>&1



How reproducible:
100%

Steps to Reproduce:
1. openstack overcloud image upload --image-path /home/stack/images/ from /home/stack
2.note error: ERROR: openstack [Errno 2] No such file or directory: 'overcloud-full.vmlinuz'

3.

Actual results:


Expected results:


Additional info:

Workaround is to upload the images from the directory where they are located.

Comment 1 Jeremy 2015-10-26 14:16:35 UTC
Created attachment 1086525 [details]
log for upload attempt

Comment 3 Mike Burns 2016-04-07 20:54:03 UTC
This bug did not make the OSP 8.0 release.  It is being deferred to OSP 10.

Comment 5 Jason E. Rist 2016-10-14 22:54:58 UTC
*** Bug 1327414 has been marked as a duplicate of this bug. ***

Comment 6 Jason E. Rist 2016-10-14 22:56:18 UTC
Need to check if this is still an issue on 10

Comment 7 Jason E. Rist 2016-10-14 23:29:55 UTC
Since this has a workaround I'm moving this to z
Workaround is to upload the images from the directory where they are located.

Comment 8 Ana Krivokapic 2016-10-31 13:16:11 UTC
This is no longer an issue in Newton:

[stack@instack i]$ ls -l
total 0
[stack@instack i]$ ls -l /home/stack/ci_images/
total 3717864
-rw-rw-r--. 1 stack stack        436 Oct 19 15:56 images.txt
-rw-rw-r--. 1 stack stack  663027712 Oct 19 08:40 instack.qcow2
-rw-rw-r--. 1 stack stack         63 Oct 19 08:40 instack.qcow2.md5
-rw-rw-r--. 1 stack stack  316979200 Oct 19 07:59 ipa_images.tar
-rw-rw-r--. 1 stack stack         49 Oct 19 08:00 ipa_images.tar.md5
-rw-rw-r--. 1 stack stack  311813723 Oct 19 06:41 ironic-python-agent.initramfs
-rwxr-xr-x. 2 stack stack    5157936 Oct 19 06:41 ironic-python-agent.kernel
-rwxr-xr-x. 2 stack stack    5157936 Oct 19 06:41 ironic-python-agent.vmlinuz
-rw-rw-r--. 1 stack stack       1492 Oct 19 08:27 metadata.txt
-rw-r--r--. 1 stack stack   42169099 Oct 19 06:54 overcloud-full.initrd
-rw-r--r--. 1 stack stack 1205121024 Oct 19 06:57 overcloud-full.qcow2
-rw-rw-r--. 1 stack stack 1252454400 Oct 19 08:00 overcloud-full.tar
-rw-rw-r--. 1 stack stack         53 Oct 19 08:00 overcloud-full.tar.md5
-rwxr-xr-x. 1 stack stack    5157936 Oct 19 06:54 overcloud-full.vmlinuz
[stack@instack i]$ openstack overcloud image upload --image-path /home/stack/ci_images/
Image "overcloud-full-vmlinuz" was uploaded.
+--------------------------------------+------------------------+-------------+---------+--------+
|                  ID                  |          Name          | Disk Format |   Size  | Status |
+--------------------------------------+------------------------+-------------+---------+--------+
| 90af574d-a8d4-45da-bdb3-7cfb0a04f178 | overcloud-full-vmlinuz |     aki     | 5157936 | active |
+--------------------------------------+------------------------+-------------+---------+--------+
Image "overcloud-full-initrd" was uploaded.
+--------------------------------------+-----------------------+-------------+----------+--------+
|                  ID                  |          Name         | Disk Format |   Size   | Status |
+--------------------------------------+-----------------------+-------------+----------+--------+
| 6f21e01e-6442-49e8-89a4-3c265a4eb9c8 | overcloud-full-initrd |     ari     | 42169099 | active |
+--------------------------------------+-----------------------+-------------+----------+--------+
Image "overcloud-full" was uploaded.
+--------------------------------------+----------------+-------------+------------+--------+
|                  ID                  |      Name      | Disk Format |    Size    | Status |
+--------------------------------------+----------------+-------------+------------+--------+
| 4e41fe87-9676-4141-bd68-b71cecad691b | overcloud-full |    qcow2    | 1205121024 | active |
+--------------------------------------+----------------+-------------+------------+--------+
Image "bm-deploy-kernel" was uploaded.
+--------------------------------------+------------------+-------------+---------+--------+
|                  ID                  |       Name       | Disk Format |   Size  | Status |
+--------------------------------------+------------------+-------------+---------+--------+
| 4dc05742-e7ec-4428-a55e-3a8aca749b2b | bm-deploy-kernel |     aki     | 5157936 | active |
+--------------------------------------+------------------+-------------+---------+--------+
Image "bm-deploy-ramdisk" was uploaded.
+--------------------------------------+-------------------+-------------+-----------+--------+
|                  ID                  |        Name       | Disk Format |    Size   | Status |
+--------------------------------------+-------------------+-------------+-----------+--------+
| 7f81afef-ed0a-4ce2-bd69-a6ebe6858528 | bm-deploy-ramdisk |     ari     | 311813723 | active |
+--------------------------------------+-------------------+-------------+-----------+--------+
Image file "/httpboot/agent.kernel" is up-to-date, skipping.
Image file "/httpboot/agent.ramdisk" is up-to-date, skipping.
[stack@instack i]$

Comment 9 Leif Madsen 2016-11-07 19:05:09 UTC
I am able to reproduce this still on RDO Newton:

cat /etc/yum.repos.d/delorean-newton.repo 
[delorean]
name=delorean-puppet-tomcat-8d96971ca1c58219f856ba8c5cc1af1de95c27a6
baseurl=https://trunk.rdoproject.org/centos7-newton/8d/96/8d96971ca1c58219f856ba8c5cc1af1de95c27a6_000796fa
enabled=1
gpgcheck=0


[stack@newton ~]$ pwd
/home/stack
[stack@newton ~]$ ls images/
dib-agent-ramdisk.log   ironic-python-agent.d          ironic-python-agent.kernel   overcloud-full.d       overcloud-full.qcow2
dib-overcloud-full.log  ironic-python-agent.initramfs  ironic-python-agent.vmlinuz  overcloud-full.initrd  overcloud-full.vmlinuz

$ openstack overcloud image upload --image-path ./images/
WARNING: openstackclient.common.utils is deprecated and will be removed after Jun 2017. Please use osc_lib.utils
The given file overcloud-full.vmlinuz is not a regular file

Comment 10 David Juran 2017-02-24 09:20:56 UTC
Re-opening and changing version, I can still reproduce this issue with python-tripleoclient-5.4.1-1.el7ost.noarch on OSP10:

[stack@sadblabospd1prov ~(LAB_undercloud)]$ openstack overcloud image upload --update-existing --image-path ~/images/.
The given file overcloud-full.vmlinuz is not a regular file

Comment 11 Ken Holden 2017-07-20 18:20:28 UTC
This is still happening in OSP10z3

[stack@director10 images]$ openstack overcloud image upload --image-path ~/images/ --update-existing
Image "overcloud-full-vmlinuz" is up-to-date, skipping.
Image "overcloud-full-initrd" is up-to-date, skipping.
Image "overcloud-full" was uploaded.
+--------------------------------------+----------------+-------------+------------+--------+
|                  ID                  |      Name      | Disk Format |    Size    | Status |
+--------------------------------------+----------------+-------------+------------+--------+
| e548a709-4026-4965-bdf4-3aeb880d27e8 | overcloud-full |    qcow2    | 1308426240 | active |
+--------------------------------------+----------------+-------------+------------+--------+
Image "bm-deploy-kernel" is up-to-date, skipping.
Image "bm-deploy-ramdisk" is up-to-date, skipping.
Image file "/httpboot/agent.kernel" is up-to-date, skipping.
Image file "/httpboot/agent.ramdisk" is up-to-date, skipping.
[stack@director10 images]$ cd
[stack@director10 ~]$ openstack overcloud image upload --image-path ~/images/ --update-existing
The given file overcloud-full.vmlinuz is not a regular file
[stack@director10 ~]$

Comment 12 Morgan Weetman 2017-09-05 12:29:27 UTC
Created attachment 1322189 [details]
Proposed patch

Comment 13 Morgan Weetman 2017-09-06 06:14:43 UTC
Created attachment 1322493 [details]
Proposed patch - updated

Comment 14 Morgan Weetman 2017-09-06 06:15:52 UTC
Apologies.. just noticed I went a bit gung ho with the os.path.joins, I've removed 2 extraneous ones

thanks

Comment 16 Jose Luis Franco 2018-08-23 09:03:40 UTC
The fix was submitted in rhos-11.0 but it was not cherry-picked to rhos-10, so it was still occurring. It has been cherry-picked in:

https://code.engineering.redhat.com/gerrit/#/c/147841/

Comment 18 Bob Fournier 2019-11-27 13:29:56 UTC
This patch was waiting in the review queue for OSP-10 for over a year, it has just merged.  OSP-10 is in ELS and this is medium priority, it isn't a blocker or CVE, as such it won't be considered for inclusion in a future OSP-10 release.  I will close this unless there are objections.

Comment 20 Bob Fournier 2019-11-29 15:09:59 UTC
Thanks Jose. Closing this out due to ELS support for OSP-10.


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