Bug 1427467 - Foreign Menu - incorrect REST endpoint used to load the storagedomains
Summary: Foreign Menu - incorrect REST endpoint used to load the storagedomains
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-viewer
Version: 7.2
Hardware: Unspecified
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Eduardo Lima (Etrunko)
QA Contact: SPICE QE bug list
URL:
Whiteboard:
: 1664536 (view as bug list)
Depends On:
Blocks: 1428402
TreeView+ depends on / blocked
 
Reported: 2017-02-28 09:49 UTC by Shira Maximov
Modified: 2019-10-24 06:43 UTC (History)
13 users (show)

Fixed In Version: virt-viewer-5.0-15.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 13:07:26 UTC
Target Upstream Version:
mshira: needinfo-


Attachments (Terms of Use)
screenshot. Cannot create second ISO (57.37 KB, image/png)
2017-04-04 13:24 UTC, Andrei Stepanov
no flags Details
cannot add second ISO domain. (57.83 KB, image/png)
2017-04-04 13:35 UTC, Andrei Stepanov
no flags Details
screenshot for result 3.2 (611.49 KB, image/png)
2019-05-10 06:36 UTC, zhoujunqin
no flags Details
remote-viewer.log (83.61 KB, text/plain)
2019-05-27 08:55 UTC, zhoujunqin
no flags Details
Log of remote-viewer from p2v virtual machine (97.16 KB, text/plain)
2019-05-27 23:50 UTC, Eduardo Lima (Etrunko)
no flags Details
Log of remote-viewer from rhvh virtual machine (98.30 KB, text/plain)
2019-05-27 23:51 UTC, Eduardo Lima (Etrunko)
no flags Details
remote-viewer-p2v.log (109.61 KB, text/plain)
2019-05-30 04:56 UTC, zhoujunqin
no flags Details
remote-viewer-rhvh.log (115.79 KB, text/plain)
2019-05-30 04:57 UTC, zhoujunqin
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1310553 'medium' 'CLOSED' '''change cd'' (Forgein Menu) works only in SPICE and not in VNC console and not at all from REST' 2019-11-13 06:07:04 UTC
Red Hat Knowledge Base (Solution) 3799921 None None None 2019-01-11 04:25:58 UTC
Red Hat Product Errata RHSA-2019:2229 None None None 2019-08-06 13:07:49 UTC

Internal Links: 1310553 1444191

Description Shira Maximov 2017-02-28 09:49:58 UTC
Description of problem:
The remote viewer try to find an active storage domain, it calls the /api/storagedomains and looks for the one which is up. 

This is incorrect, because the same storage domain can have different status in different datacenters. So, the api/storagedomains REST endpoint does not return the <status> field (with the exception of the unattached, which is cross DC, but no other).
The correct approach would be to check what DC the VM is in and than get the storagedomains from /api/datacenters/<dc id>/storagedomains which will return also the status.


Version-Release number of selected component (if applicable):
Red Hat Virtualization Manager Version: 4.1.1.2-0.1.el7
virt-viewer-3.0-2.fc24.x86_64


How reproducible:


Steps to Reproduce:
1. have 2 iso domains -1 unattached and one is active
2. connect to admin portal (with fqdn)
3. edit vm and set vm console to VNC 
4. open console- the 'change CD' is not there.. 

Actual results:
the Remote viewer doesn't pick a storage domain 


Expected results:


Additional info:

Comment 2 Christophe Fergeau 2017-02-28 10:06:49 UTC
Yes, that's a known shortcoming of that code, I think I discussed this in a bug, but I can find it now. This is dependent on this upstream bug https://bugzilla.gnome.org/show_bug.cgi?id=765297

Comment 3 Christophe Fergeau 2017-03-02 15:18:47 UTC
(In reply to Shira Maximov from comment #0)
> This is incorrect, because the same storage domain can have different status
> in different datacenters. So, the api/storagedomains REST endpoint does not
> return the <status> field 

"does not return", or "no longer returns"? I think this used to have a 'status' field in past RHEV versions?

Comment 4 Shira Maximov 2017-03-02 15:45:48 UTC
(In reply to Christophe Fergeau from comment #3)
> (In reply to Shira Maximov from comment #0)
> > This is incorrect, because the same storage domain can have different status
> > in different datacenters. So, the api/storagedomains REST endpoint does not
> > return the <status> field 
> 
> "does not return", or "no longer returns"? I think this used to have a
> 'status' field in past RHEV versions?

I believe no longer returns, maybe something changed from this bug? 
https://bugzilla.redhat.com/show_bug.cgi?id=1328102

Comment 5 Christophe Fergeau 2017-03-02 15:52:46 UTC
(In reply to Christophe Fergeau from comment #2)
> Yes, that's a known shortcoming of that code, I think I discussed this in a
> bug,

Discussion was in https://bugzilla.redhat.com/show_bug.cgi?id=1328102#c2

Comment 6 Christophe Fergeau 2017-03-02 15:56:56 UTC
(In reply to Shira Maximov from comment #4)
> (In reply to Christophe Fergeau from comment #3)
> > (In reply to Shira Maximov from comment #0)
> > > This is incorrect, because the same storage domain can have different status
> > > in different datacenters. So, the api/storagedomains REST endpoint does not
> > > return the <status> field 
> > 
> > "does not return", or "no longer returns"? I think this used to have a
> > 'status' field in past RHEV versions?
> 
> I believe no longer returns, maybe something changed from this bug? 
> https://bugzilla.redhat.com/show_bug.cgi?id=1328102

Well, this is what I'm wondering, if something changed on the server side in what is returned by the REST API :) This would cause bug #1428401

Comment 7 Eduardo Lima (Etrunko) 2017-04-04 12:38:07 UTC
(In reply to Shira Maximov from comment #0)
> 
> Steps to Reproduce:
> 1. have 2 iso domains -1 unattached and one is active

Can  you confirm it is possible to have 2 ISO domains? I was talking about this bug with SPICE QE and they told that as in RHV 4.1 it can not be done.

Comment 8 Shira Maximov 2017-04-04 13:13:35 UTC
It is possible, 
you need to add an ISO domain and put it to maintenance and then deactivating it.
then you will able to add another ISO domain.

Comment 9 Andrei Stepanov 2017-04-04 13:24:59 UTC
Created attachment 1268653 [details]
screenshot. Cannot create second ISO

Comment 10 Andrei Stepanov 2017-04-04 13:28:13 UTC
Shira Maximov please look at https://bugzilla.redhat.com/attachment.cgi?id=1268653

As you can see on the screenshot ISO domain is on Maintenance/Inactive.
And there is no ability to add second ISO.

Could you please provide more info (in steps 1,2,3..) how to add second ISO domain?

Comment 11 Andrei Stepanov 2017-04-04 13:35:15 UTC
Created attachment 1268660 [details]
cannot add second ISO domain.

rhv41 4.1.1.7-0.1.el7 / BUILD VERSION: 4.1.1-8

Comment 12 Andrei Stepanov 2017-04-05 11:15:19 UTC
I am able to reproduce this bug.
It is necessary to:

1. deactivate ISO domain
2. detach it completely from DataCenter.

And, this bug is closely related to:

https://bugzilla.redhat.com/show_bug.cgi?id=1428401
https://bugzilla.redhat.com/show_bug.cgi?id=1428402

Comment 14 Xiaodai Wang 2017-10-20 10:49:43 UTC
I am not very clearly understand what's the problem is in this bug.

scenario 1) there are two iso_domain in one datacenter, one is detached, another is Up status. 
   The original problem is virt-viewer cannot detect the second active iso_domain, then display ISOs correctly, right?
   I cannot reproduce the problem of scenario 1 by virt-viewer-5.0-7.el7.

scenario 2) There are two iso_domain in two datacenters. One is detached, another one which belongs to another iso_domain is active.
   In this scenario, remote-viewer displays the ISOs in iso_domain which belongs to another datacenter. It seems virt-viewer doesn't fix the problem. 
   In this scenario, remote-viewer should not enable "change cd" menu, right? because there are not any Up iso_domains in the datacenter which the vm is in.

Or am i using any incorrect packages?

my packages:
virt-viewer-5.0-8.el7.x86_64
libgovirt-0.3.3-6.el7.x86_64
RHEVM Version 4.1.7.3-0.1.el7

Comment 15 Eduardo Lima (Etrunko) 2017-10-30 08:26:53 UTC
(In reply to xiaodwan from comment #14)
> I am not very clearly understand what's the problem is in this bug.
> 
> scenario 1) there are two iso_domain in one datacenter, one is detached,
> another is Up status. 
>    The original problem is virt-viewer cannot detect the second active
> iso_domain, then display ISOs correctly, right?
>    I cannot reproduce the problem of scenario 1 by virt-viewer-5.0-7.el7.
> 

Actually, the thing is that remote-viewer will show the ISO from both the active and dettached domains, while it should only show images from the active domain.

> scenario 2) There are two iso_domain in two datacenters. One is detached,
> another one which belongs to another iso_domain is active.
>    In this scenario, remote-viewer displays the ISOs in iso_domain which
> belongs to another datacenter. It seems virt-viewer doesn't fix the problem. 
>    In this scenario, remote-viewer should not enable "change cd" menu,
> right? because there are not any Up iso_domains in the datacenter which the
> vm is in.


This second scenario is somewhat what we are trying to fix here. I have not really tested with two datacenters, but for sure it should not be possible to show ISO images from a storage domain which is not available for the datacenter the VM is part of.

Comment 25 Christophe Fergeau 2019-01-09 09:24:11 UTC
*** Bug 1664536 has been marked as a duplicate of this bug. ***

Comment 26 Germano Veit Michel 2019-01-11 06:45:51 UTC
Also note ISO Domain is deprecated in RHV, ISO's can live on normal Data Domains since 4.2.
You will need to find the available images in the Data Domains of the DC of the VM.

Comment 28 zhoujunqin 2019-05-10 06:31:03 UTC
Try to verify this bug with new build:
virt-viewer-5.0-13.el7.x86_64
libgovirt-0.3.4-2.el7.x86_64
libvirt-4.5.0-16.el7.x86_64
qemu-kvm-rhev-2.12.0-27.el7.x86_64
spice-gtk3-0.35-4.el7.x86_64
gtk-vnc2-0.7.0-3.el7.x86_64

RHV: Software Version:4.3.0.1-0.1.el7

Steps:
1. Make sure there are two Data Centers which are Up status in RHVM server.
2. Make sure each Data Centers has a ISO_DOMAIN which is in UP status.

|DC_name|status|iso_domin_disk_name|vm_name|
|p2v|UP|RHEL-7.6-20181010.0-Server-x86_64-boot.iso|esx6.7-rhel6.10-x86_64-vmware-tools|
|rhvh|UP|RHEL-6.10-20180525.0-Server-x86_64-boot.iso|rhvh|

3.Open the VM in RHV and check the "Change CD" sub-menu in File menu of remote-viewer.
Result:
3.1 For vm 'esx6.7-rhel6.10-x86_64-vmware-tools' in DC 'p2v', iso file "RHEL-7.6-20181010.0-Server-x86_64-boot.iso" load successfully, please see screenshot-1
3.2 For vm 'rhvh' in DC 'rhvh', when check "Change CD", it displays  iso file "RHEL-7.6-20181010.0-Server-x86_64-boot.iso" either, and it shows 'Bad Request' when I try to select ISO.

4. Remove DC 'p2v', then open the VM 'rhvh' in RHV and check the "Change CD" submenu in File menu of remote-viewer.
Result: For vm 'rhvh' in DC 'rhvh', iso file "RHEL-6.10-20180525.0-Server-x86_64-boot.iso" load successfully now.

Summary:
1) Two iso_domain in one Data Centers is not supported in rhv4.3
2) Detach the iso_domain from the DC is not supported ether, I have to set DC into maintenance, then all vms, domains, hosts on this DC are inactive.
So I do step-1 to step-4 checking based on unsupported issue, "Change CD" sub-menu is available when there is a iso_domain, and please help me have a look of my results, for 3.2 it should displays "RHEL-6.10-20180525.0-Server-x86_64-boot.iso" to vm on DC 'rhvh', getting same result with step-4. thanks.

Comment 29 zhoujunqin 2019-05-10 06:36:55 UTC
Created attachment 1566540 [details]
screenshot for result 3.2

Comment 32 zhoujunqin 2019-05-27 08:54:52 UTC
Test with package:
virt-viewer-5.0-14.el7.x86_64
libgovirt-0.3.4-3.el7.x86_64(latest one)
libvirt-4.5.0-18.el7.x86_64
qemu-kvm-rhev-2.12.0-29.el7.x86_64
spice-gtk3-0.35-4.el7.x86_64
gtk-vnc-0.7.0-3.el7.x86_64

Steps:

RHV: Software Version:4.3.0.1-0.1.el7

Steps:
1. Make sure there are two Data Centers which are Up status in RHVM server.
2. Make sure each Data Centers has a ISO_DOMAIN which is in UP status.

|DC_name|status|iso_domin_disk_name|vm_name|
|p2v|UP|RHEL-8.0.0-20190404.2-BaseOS-x86_64-boot.iso|p2v|
|rhvh|UP|RHEL-7.6-20181010.0-Server-x86_64-boot.iso|rhvh|

3.Open the VM in RHV and check the "Change CD" sub-menu in File menu of remote-viewer.
Result:
3.1 For vm 'p2v' in DC 'p2v', iso file "RHEL-8.0.0-20190404.2-BaseOS-x86_64-boot.iso" load successfully.
3.2 For vm 'rhvh' in DC 'rhvh', when check "Change CD", it displays  iso file "RHEL-8.0.0-20190404.2-BaseOS-x86_64-boot.iso" either, and it shows 'Bad Request' when I try to select ISO.

$ G_MESSAGES_DEBUG=all REST_DEBUG=proxy remote-viewer console.vv |& tee>remote-viewer.log

Result: rhv supplies wrong ISO to vm 'rhvh' in DC 'rhvh', detail please see remote-viewer.log, thanks.

Comment 33 zhoujunqin 2019-05-27 08:55:43 UTC
Created attachment 1573863 [details]
remote-viewer.log

Comment 34 Eduardo Lima (Etrunko) 2019-05-27 23:49:09 UTC
(In reply to zhoujunqin from comment #33)
> Created attachment 1573863 [details]
> remote-viewer.log

Hi Juzhou,

Please make sure you are using the correct version of virt-viewer. I ran remote-viewer with both p2v and rhvh virtual machines and got different results than what is on the log file one you provided.

The steps I did for both machines were the following:

1) Run remote-viewer
2) Clicked change CD
3) Select ISO to attach CD
4) Close dialog
5) Clicked change CD again
6) CD still shows attached, click on it to detach

On p2v virtual machine, only RHEL-8 image is shown, while on rhvh machine, only RHEL-7 image is shown.

Comment 35 Eduardo Lima (Etrunko) 2019-05-27 23:50:46 UTC
Created attachment 1574144 [details]
Log of remote-viewer from p2v virtual machine

Comment 36 Eduardo Lima (Etrunko) 2019-05-27 23:51:13 UTC
Created attachment 1574145 [details]
Log of remote-viewer from rhvh virtual machine

Comment 43 zhoujunqin 2019-05-30 04:56:57 UTC
Created attachment 1575073 [details]
remote-viewer-p2v.log

Comment 44 zhoujunqin 2019-05-30 04:57:42 UTC
Created attachment 1575074 [details]
remote-viewer-rhvh.log

Comment 51 David Blechter 2019-06-03 19:06:59 UTC
restoring needinfo from mshira@redhat.com

Comment 53 zhoujunqin 2019-06-04 03:35:57 UTC
Test with package:
virt-viewer-5.0-15.el7.x86_64
libgovirt-0.3.4-3.el7.x86_64
libvirt-4.5.0-18.el7.x86_64
qemu-kvm-rhev-2.12.0-30.el7.x86_64
spice-gtk3-0.35-4.el7.x86_64
gtk-vnc2-0.7.0-3.el7.x86_64

Steps:

RHV: Software Version:4.3.0.1-0.1.el7

Steps:
1. Make sure there are two Data Centers which are Up status in RHVM server.
2. Make sure each Data Centers has a ISO_DOMAIN which is in UP status.

|DC_name|status|iso_domin_disk_name|vm_name|
|p2v|UP|RHEL-8.0.0-20190404.2-BaseOS-x86_64-boot.iso|p2v|
|rhvh|UP|RHEL-7.6-20181010.0-Server-x86_64-boot.iso|rhvh|

3.Open the VM in RHV and check the "Change CD" sub-menu in File menu of remote-viewer.

3.1 For vm 'p2v' in DC 'p2v', iso file "RHEL-8.0.0-20190404.2-BaseOS-x86_64-boot.iso" loads successfully.
3.2 For vm 'rhvh' in DC 'rhvh', iso file "RHEL-7.6-20181010.0-Server-x86_64-boot.iso" loads successfully.
3.3 Click "Change CD" again, CD still shows attached, click on it to detach. The ISO file detaches from vm successfully, and "Refresh" Button of "Change CD" dialog works well.

I move this bug from ON_QA to VERIFIED based on above testing, thanks.

Comment 55 errata-xmlrpc 2019-08-06 13:07: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/RHSA-2019:2229


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