Bug 1275326 - openstack overcloud image upload --image-path <path> ignores image-path option
openstack overcloud image upload --image-path <path> ignores image-path option
Status: NEW
Product: Red Hat OpenStack
Classification: Red Hat
Component: rhosp-director (Show other bugs)
10.0 (Newton)
Unspecified Unspecified
medium Severity medium
: ---
: 10.0 (Newton)
Assigned To: Jason E. Rist
Ola Pavlenko
: Reopened, Triaged, ZStream
: 1327414 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-26 10:15 EDT by Jeremy
Modified: 2017-10-15 22:07 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-10-31 09:16:11 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Jeremy 2015-10-26 10:15:53 EDT
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 10:16 EDT
Created attachment 1086525 [details]
log for upload attempt
Comment 3 Mike Burns 2016-04-07 16:54:03 EDT
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 18:54:58 EDT
*** Bug 1327414 has been marked as a duplicate of this bug. ***
Comment 6 Jason E. Rist 2016-10-14 18:56:18 EDT
Need to check if this is still an issue on 10
Comment 7 Jason E. Rist 2016-10-14 19:29:55 EDT
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 09:16:11 EDT
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 14:05:09 EST
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 04:20:56 EST
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 14:20:28 EDT
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 08:29 EDT
Created attachment 1322189 [details]
Proposed patch
Comment 13 Morgan Weetman 2017-09-06 02:14 EDT
Created attachment 1322493 [details]
Proposed patch - updated
Comment 14 Morgan Weetman 2017-09-06 02:15:52 EDT
Apologies.. just noticed I went a bit gung ho with the os.path.joins, I've removed 2 extraneous ones

thanks

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