Previously, users could not remotely upload an ISO file from local storage to a local ISO domain via SSH. This happened because engine-iso-uploader was unable to get the hostname for hosts with a local storage domain when starting from the storage domain name. This worked only if executed on the same host. With this fix, engine-iso-uploader can get a remote host's host address for a local ISO domain via the REST API. As a result, engine-iso-uploader can upload an ISO image to a local ISO storage domain, as well as from another host via SSH.
Description of problem:
Whe ISO domain is on Local storage, and I'm trying to engine-iso-uploader to upload _remotely_ (yeah!) an iso file via ssh (as local ISO domain is not NFS), it does not work as code has hardcoded 'localhost' for ssh host.
engine-iso-uploader --conf-file=/tmp/isouploader.conf -v upload /usr/share/rhev-guest-tools-iso/RHEV-toolsSetup_3.4_4.el6ev.iso
DEBUG: API Vendor(Red Hat) API Version(3.4.0)
DEBUG: id=9ac7ede3-cb56-44de-95b0-2297033f9be4 address=localhost path=/mnt/iso
^^^^^^^^^ - localhost?
Uploading, please wait...
INFO: Start uploading /usr/share/rhev-guest-tools-iso/RHEV-toolsSetup_3.4_4.el6ev.iso
DEBUG: file (/usr/share/rhev-guest-tools-iso/RHEV-toolsSetup_3.4_4.el6ev.iso)
DEBUG: /usr/bin/ssh -p 22 root@localhost "/usr/bin/test -e /mnt/iso/9ac7ede3-cb56-44de-95b0-2297033f9be4/images/11111111-1111-1111-1111-111111111111/RHEV-toolsSetup_3.4_4.el6ev.iso"
^^^^^^^^^ - localhost?
DEBUG: /usr/bin/ssh -p 22 root@localhost "/usr/bin/test -e /mnt/iso/9ac7ede3-cb56-44de-95b0-2297033f9be4/images/11111111-1111-1111-1111-111111111111/RHEV-toolsSetup_3.4_4.el6ev.iso"
DEBUG: _cmds(['/usr/bin/ssh', '-p', '22', 'root@localhost', '/usr/bin/test -e /mnt/iso/9ac7ede3-cb56-44de-95b0-2297033f9be4/images/11111111-1111-1111-1111-111111111111/RHEV-toolsSetup_3.4_4.el6ev.iso'])
# egrep -v '^#|^[[:blank:]]*$' /tmp/isouploader.conf
[ISOUploader]
user=admin@internal
passwd=******
engine=vm-161-144.scl.lab.tlv.redhat.com:443
cert-file=/tmp/ca.crt
iso-domain=iso-local
ssh-user=root
ssh-port=22
# sed -n '629,634p;' `which engine-iso-uploader`
if storage is not None:
domain_type = storage.get_type()
address = 'localhost'
if domain_type not in ('localfs', ):
address = storage.get_address()
path = storage.get_path()
So if storage type is localfs, address is always localhost. This is wrong. Admins want to upload their iso files from their clients.
Version-Release number of selected component (if applicable):
rhevm-iso-uploader-3.4.0-3.el6ev.noarch
How reproducible:
100%
Steps to Reproduce:
1. on remote client: rhevm-iso-uploader
2. local dc/cluster/host with iso domain (you must have RHEL now)
3. from remote client try to use above config (as template) and try iso upload
Actual results:
ssh is connecting always to localhost as code has hardcoded value
Expected results:
be clever, get host of storage even if it is localfs
Additional info:
Please consider cloning this to engine-image-uploader even if right now Export domain seems not be possible to create on Local storage. (I would see good usage for Export domain on Local storage - live snapshot with memory -> export -> backup solution.)
- This has been introduced fixing bug #1065726.
- This is not a regression since localfs doesn't provide a host to be connected to.
- Workaround exists: just use scp / sftp instead of iso uploader.
Reducing severity to medium and targeting to 3.4.1.
Host may be probably found by checking the host with attached that local storage.
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://rhn.redhat.com/errata/RHEA-2016-0391.html
Description of problem: Whe ISO domain is on Local storage, and I'm trying to engine-iso-uploader to upload _remotely_ (yeah!) an iso file via ssh (as local ISO domain is not NFS), it does not work as code has hardcoded 'localhost' for ssh host. engine-iso-uploader --conf-file=/tmp/isouploader.conf -v upload /usr/share/rhev-guest-tools-iso/RHEV-toolsSetup_3.4_4.el6ev.iso DEBUG: API Vendor(Red Hat) API Version(3.4.0) DEBUG: id=9ac7ede3-cb56-44de-95b0-2297033f9be4 address=localhost path=/mnt/iso ^^^^^^^^^ - localhost? Uploading, please wait... INFO: Start uploading /usr/share/rhev-guest-tools-iso/RHEV-toolsSetup_3.4_4.el6ev.iso DEBUG: file (/usr/share/rhev-guest-tools-iso/RHEV-toolsSetup_3.4_4.el6ev.iso) DEBUG: /usr/bin/ssh -p 22 root@localhost "/usr/bin/test -e /mnt/iso/9ac7ede3-cb56-44de-95b0-2297033f9be4/images/11111111-1111-1111-1111-111111111111/RHEV-toolsSetup_3.4_4.el6ev.iso" ^^^^^^^^^ - localhost? DEBUG: /usr/bin/ssh -p 22 root@localhost "/usr/bin/test -e /mnt/iso/9ac7ede3-cb56-44de-95b0-2297033f9be4/images/11111111-1111-1111-1111-111111111111/RHEV-toolsSetup_3.4_4.el6ev.iso" DEBUG: _cmds(['/usr/bin/ssh', '-p', '22', 'root@localhost', '/usr/bin/test -e /mnt/iso/9ac7ede3-cb56-44de-95b0-2297033f9be4/images/11111111-1111-1111-1111-111111111111/RHEV-toolsSetup_3.4_4.el6ev.iso']) # egrep -v '^#|^[[:blank:]]*$' /tmp/isouploader.conf [ISOUploader] user=admin@internal passwd=****** engine=vm-161-144.scl.lab.tlv.redhat.com:443 cert-file=/tmp/ca.crt iso-domain=iso-local ssh-user=root ssh-port=22 # sed -n '629,634p;' `which engine-iso-uploader` if storage is not None: domain_type = storage.get_type() address = 'localhost' if domain_type not in ('localfs', ): address = storage.get_address() path = storage.get_path() So if storage type is localfs, address is always localhost. This is wrong. Admins want to upload their iso files from their clients. Version-Release number of selected component (if applicable): rhevm-iso-uploader-3.4.0-3.el6ev.noarch How reproducible: 100% Steps to Reproduce: 1. on remote client: rhevm-iso-uploader 2. local dc/cluster/host with iso domain (you must have RHEL now) 3. from remote client try to use above config (as template) and try iso upload Actual results: ssh is connecting always to localhost as code has hardcoded value Expected results: be clever, get host of storage even if it is localfs Additional info: