Bug 1862893 - RHV shows ip info even if guest's ip doesn't exist
Summary: RHV shows ip info even if guest's ip doesn't exist
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Virt
Version: 4.4.1.8
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ovirt-4.5.0
: 4.5.0
Assignee: Arik
QA Contact: Tamir
URL:
Whiteboard:
: 1867575 (view as bug list)
Depends On: 1867575
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-03 07:17 UTC by liuzi
Modified: 2022-04-20 06:32 UTC (History)
13 users (show)

Fixed In Version: ovirt-engine-4.5.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-04-12 10:18:21 UTC
oVirt Team: Virt
Embargoed:
pm-rhel: ovirt-4.5?


Attachments (Terms of Use)
Guest's ip info (340.14 KB, image/png)
2020-08-03 07:17 UTC, liuzi
no flags Details
RHV shows ip info (203.29 KB, image/png)
2020-08-03 07:19 UTC, liuzi
no flags Details
Firstboot log (408.91 KB, image/png)
2020-08-03 07:20 UTC, liuzi
no flags Details
vdsm log (1 bytes, text/plain)
2020-08-05 06:00 UTC, liuzi
no flags Details
engine log (760.85 KB, text/plain)
2020-08-05 06:00 UTC, liuzi
no flags Details
new vdsm.log (2.63 MB, text/plain)
2020-08-11 10:29 UTC, liuzi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 117685 0 master MERGED engine: Filter IPs of NICs that don't have profile id 2021-11-25 10:10:24 UTC

Description liuzi 2020-08-03 07:17:42 UTC
Created attachment 1703235 [details]
Guest's ip info

Description of problem:
Rhv shows ip info even if guest's ip doesn't exist

Version-Release number of selected component (if applicable):
rhv:4.4.1.8-0.7.el8ev
virt-v2v-1.40.2-24.module+el8.2.1+7154+47ffd890.x86_64
qemu-kvm-4.2.0-19.module+el8.3.0+6473+93e27135.x86_64
libvirt-6.0.0-25.module+el8.2.1+7154+47ffd890.x86_64
virtio-win-1.9.11-1.el8.noarch


How reproducible:
100%

Steps to Reproduce:
1. Prepare a windows guest which has static IP, gateway, subnet mask and DNS in ESXI6.7
static ip: 192.168.122.11
subnet mask:255.255.248.0
default gateway:192.168.1.1
DNS server: 196.168.11.1 

2. Convert the guest from VMware to rhv, set static IP address,gateway, subnet mask and DNS in --mac option
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib -io  vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA  -o rhv-upload -oo rhv-cafile=/tmp/ca.pem -oo rhv-direct -oc https://dell-per740-22.lab.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd --password-file /home/passwd esx6.7-win2019-static-ip -of raw -os nfs_data --mac 00:50:56:ac:90:79:ip:10.66.147.203,10.66.147.254,24 

3.Check the guest's network after finishing conversion,
3.1 Can find network's error info in firstboot log
3.2 The guest's ip doesn't exist,please see screenshot named:guest's ip info
3.3 But the rhv still shows guest's ip info,pls see screenshot named:rhv shows ip info

Actual results:
As above

Expected results:
RHV cannot show ip info if guest's ip doestn't exist.

Additional info:
1. Can reproduce the bug in rhv4.3
2. Cannot reproduce the bug when directly disable the guest network adapter in rhv

Comment 1 liuzi 2020-08-03 07:19:45 UTC
Created attachment 1703236 [details]
RHV shows ip info

Comment 2 liuzi 2020-08-03 07:20:21 UTC
Created attachment 1703237 [details]
Firstboot log

Comment 3 Arik 2020-08-03 11:14:00 UTC
Please provide engine and vdsm log as well

Comment 4 Tomáš Golembiovský 2020-08-04 08:45:59 UTC
I looked at the VM and it seems like a bug in qemu-ga. When I query the agent directly I get:

virsh # qemu-agent-command esx6.7-win2019-static-ip '{"execute":"guest-network-get-interfaces"}'
{"return":[{"name":"Ethernet","ip-addresses":[{"ip-address-type":"ipv6","ip-address":"fe80::3429:9746:f288:9279%8","prefix":64},{"ip-address-type":"ipv4","ip-address":"169.254.146.121","prefix":16}],"statistics":{"tx-packets":0,"tx-errs":0,"rx-bytes":0,"rx-dropped":0,"rx-packets":0,"rx-errs":0,"tx-bytes":0,"tx-dropped":0},"hardware-address":"00:50:56:ac:90:79"},{"name":"Loopback Pseudo-Interface 1","ip-addresses":[{"ip-address-type":"ipv6","ip-address":"::1","prefix":128},{"ip-address-type":"ipv4","ip-address":"127.0.0.1","prefix":8}],"statistics":{"tx-packets":0,"tx-errs":0,"rx-bytes":0,"rx-dropped":0,"rx-packets":0,"rx-errs":0,"tx-bytes":0,"tx-dropped":0}}]}

This matches what we see in engine. I wonder where does the agent get the information from.

Comment 5 liuzi 2020-08-05 06:00:07 UTC
Created attachment 1710467 [details]
vdsm log

Comment 6 liuzi 2020-08-05 06:00:56 UTC
Created attachment 1710468 [details]
engine log

Comment 7 Tomáš Golembiovský 2020-08-10 11:35:00 UTC
The vdsm.log is empty. Can you please check?

Comment 8 liuzi 2020-08-11 10:29:25 UTC
Created attachment 1711062 [details]
new vdsm.log

Comment 10 Arik 2020-10-29 10:09:04 UTC
In light of https://bugzilla.redhat.com/show_bug.cgi?id=1867575#c15, do I understand this correctly that the story goes like this:
1. We have a VM in VMware that is set with static IP
2. We ask virt-v2v to change the static IP of that NIC (00:50:56:ac:90:79) to 10.66.147.203
3. After the conversion, the NIC is not set with requested static IP 10.66.147.203
4. Instead, the NIC gets to the following state:
4.1 The "Internet Protocol Version 4 (TCP/IPv4) Properties" dialog shows that the NIC is set to use an empty static IP - something that is typically blocked by Windows UI
4.2 The NIC is displayed as 'Media disconnected' in the output of 'ipconfig' within the guest
4.3 The NIC is assigned with a private IP 169.254.146.121, as if it can't access a DHCP server
5. RHV exposes the private IP 169.254.146.121 that the NIC is assigned with

While we can argue on whether that private IP should be displayed in RHV or not in this case (and if not, which component should filter it out), I wonder how interesting that is.
Isn't the real issue here that the requested static IP (10.66.147.203) is not properly set (#3) and instead we end up with some invalid state (#4)?

Comment 11 Yvugenfi@redhat.com 2020-10-29 10:15:43 UTC
In my perspective the questions is why link is disconnected ("Media disconnected")? Does management layer set's the link to down state?
On other hand the value of IP is actually "valid" (according to MS documentation): https://docs.microsoft.com/en-us/windows-server/troubleshoot/how-to-use-automatic-tcpip-addressing-without-a-dh

Comment 12 Tomáš Golembiovský 2020-10-29 15:59:49 UTC
(In reply to Arik from comment #10)
> While we can argue on whether that private IP should be displayed in RHV or
> not in this case (and if not, which component should filter it out), I
> wonder how interesting that is.

That depends. The fact that we report IPs that are unreachable makes it difficult for other tools to connect to the guest. If the NIC is unpluged in oVirt configuration then oVirt knows that it should not report the IP. But if the interface is down for other reasons... ?

But as it stands now it is definitely very low priority. I am still puzzled how often can such situation happen apart from the guest being miss-configured.

> Isn't the real issue here that the requested static IP (10.66.147.203) is
> not properly set (#3) and instead we end up with some invalid state (#4)?

Yes and yes.



(In reply to Yan Vugenfirer from comment #11)
> In my perspective the questions is why link is disconnected ("Media
> disconnected")? Does management layer set's the link to down state?
> On other hand the value of IP is actually "valid" (according to MS
> documentation):
> https://docs.microsoft.com/en-us/windows-server/troubleshoot/how-to-use-
> automatic-tcpip-addressing-without-a-dh

My initial assumption was that the interface was disabled by Windows because it was miss-configured, but if that's not the case then this is a good question.

Comment 13 Tomáš Golembiovský 2020-10-29 16:22:51 UTC
(In reply to Tomáš Golembiovský from comment #12)
> (In reply to Arik from comment #10)
> > While we can argue on whether that private IP should be displayed in RHV or
> > not in this case (and if not, which component should filter it out), I
> > wonder how interesting that is.
> 
> That depends. The fact that we report IPs that are unreachable makes it
> difficult for other tools to connect to the guest. If the NIC is unpluged in
> oVirt configuration then oVirt knows that it should not report the IP.

Ok, it seems it's not like that. If I unplug the NIC in oVirt it is disabled by NetworkManager and that's why it is not reported (even by qemu-ga). But when I bring it up manually it shows in oVirt UI even though the link is still down. In oVirt API we seem to report some cached IP address even if the address is no longer reported by guest.


> But if the interface is down for other reasons... ?

Comment 14 Arik 2020-10-29 17:50:07 UTC
(In reply to Tomáš Golembiovský from comment #13)
> (In reply to Tomáš Golembiovský from comment #12)
> > (In reply to Arik from comment #10)
> > > While we can argue on whether that private IP should be displayed in RHV or
> > > not in this case (and if not, which component should filter it out), I
> > > wonder how interesting that is.
> > 
> > That depends. The fact that we report IPs that are unreachable makes it
> > difficult for other tools to connect to the guest. If the NIC is unpluged in
> > oVirt configuration then oVirt knows that it should not report the IP.
> 
> Ok, it seems it's not like that. If I unplug the NIC in oVirt it is disabled
> by NetworkManager and that's why it is not reported (even by qemu-ga). But
> when I bring it up manually it shows in oVirt UI even though the link is
> still down. In oVirt API we seem to report some cached IP address even if
> the address is no longer reported by guest.

You brought up the NIC with the same MAC address, right?
Take into account that it takes some time for the change to propagate to the engine -
once you unplug the NIC, it takes time until the information gets from gqa to vdsm and until engine polls vdsm for the information
It may even take more than a minute - and only then the data is removed.
So if you brought up the NIC before the data was removed and the NIC was set with the same MAC address then it will be correlated with the "old" data.

In order to check if the qga data exists you can query the database:
engine=# select * from vm_guest_agent_interfaces where vm_id in (select vm_guid from vm_static where vm_name='vm-name');
                vm_id                 | interface_name |    mac_address    | ipv4_addresses |                       ipv6_addresses                       
--------------------------------------+----------------+-------------------+----------------+------------------------------------------------------------
 dcbaa892-af6c-46bf-b69a-ab88f3c92059 | eth0           | 00:1a:4a:16:10:39 | 10.35.30.57    | 2620:52:0:231e:21a:4aff:fe16:1039,fe80::21a:4aff:fe16:1039

Comment 15 Arik 2020-10-29 18:06:32 UTC
(In reply to Tomáš Golembiovský from comment #12)
> (In reply to Yan Vugenfirer from comment #11)
> > In my perspective the questions is why link is disconnected ("Media
> > disconnected")? Does management layer set's the link to down state?
> > On other hand the value of IP is actually "valid" (according to MS
> > documentation):
> > https://docs.microsoft.com/en-us/windows-server/troubleshoot/how-to-use-
> > automatic-tcpip-addressing-without-a-dh
> 
> My initial assumption was that the interface was disabled by Windows because
> it was miss-configured, but if that's not the case then this is a good
> question.

+1
Zi, is it solved by changing the NIC's settings to "Obtain an IP address automatically" in that dialog that is shown at https://bugzilla.redhat.com/attachment.cgi?id=1703235?

Comment 16 liuzi 2020-11-02 06:52:11 UTC
Hi,Arik

(In reply to Arik from comment #10)
> While we can argue on whether that private IP should be displayed in RHV or
> not in this case (and if not, which component should filter it out), I
> wonder how interesting that is.

RHV should show the guest's ip when the guest running qemu-ga server normally.in this bug,the guest has installed qemu-ga.
So I think the real issue is that:why the guest doesn't have ip, rhv still can show the ip info?


(In reply to Arik from comment #15)
> Zi, is it solved by changing the NIC's settings to "Obtain an IP address
> automatically" in that dialog that is shown at
> https://bugzilla.redhat.com/attachment.cgi?id=1703235?

The original guest has static ip,but after conversion,the guest's NIC changed to "Obtain an IP address automatically".This state is not set by manual.
Additional,if virt-v2v change ip successfully,the new guest's will still have static ip.

you can refer to https://bugzilla.redhat.com/show_bug.cgi?id=1867575#c5 to check the guest.

Comment 17 Arik 2020-11-02 09:40:06 UTC
(In reply to liuzi from comment #16)
> Hi,Arik
> 
> (In reply to Arik from comment #10)
> > While we can argue on whether that private IP should be displayed in RHV or
> > not in this case (and if not, which component should filter it out), I
> > wonder how interesting that is.
> 
> RHV should show the guest's ip when the guest running qemu-ga server
> normally.in this bug,the guest has installed qemu-ga.
> So I think the real issue is that:why the guest doesn't have ip, rhv still
> can show the ip info?

Right so we already have the answer for this part -
the guest actually *has* an IP - the NIC is assigned with a private IP, the one that is presented in RHV, even though it appears as disconnected in the output of 'ipconfig' within the guest.

Dominik, this is easily reproducible:
1. Add a NIC with empty profile to a VM installed with Windows and qemu-guest-agent
2. Start the VM
=> The NIC appears as disconnected from within the guest (which makes sense, it's not set with any network) and qemu-guest-agent reports the private IP that Windows assigns to this NIC and we display it in RHV.

This is a low-priority issue (it shouldn't normally happen), yet -
would it make sense to always filter the reported IPs from qemu-guest-agent in this case (of a NIC with empty profile)?
Is it something that was discussed/considered before?
I think the MAC address should not be filtered

 
> 
> (In reply to Arik from comment #15)
> > Zi, is it solved by changing the NIC's settings to "Obtain an IP address
> > automatically" in that dialog that is shown at
> > https://bugzilla.redhat.com/attachment.cgi?id=1703235?
> 
> The original guest has static ip,but after conversion,the guest's NIC
> changed to "Obtain an IP address automatically".This state is not set by
> manual.
> Additional,if virt-v2v change ip successfully,the new guest's will still
> have static ip.
> 
> you can refer to https://bugzilla.redhat.com/show_bug.cgi?id=1867575#c5 to
> check the guest.

Thanks, having access to the VM helped me understand what happened there.
Zi, do we have a bug on virt-v2v to see why the requested static IP wasn't set? I believe that's what leads to the NIC being set with the empty profile

Comment 18 liuzi 2020-11-02 14:15:50 UTC
(In reply to Arik from comment #17)

> Thanks, having access to the VM helped me understand what happened there.
> Zi, do we have a bug on virt-v2v to see why the requested static IP wasn't
> set? I believe that's what leads to the NIC being set with the empty profile

Hi,Arik
It's not a bug.Because the virt-v2v command is incomplete in this bug.After add the parameter "-b ",virt-v2v can set the static ip successfully.

Comment 19 Dominik Holler 2020-11-02 17:32:28 UTC
(In reply to Arik from comment #17)
> (In reply to liuzi from comment #16)
> > Hi,Arik
> > 
> > (In reply to Arik from comment #10)
> > > While we can argue on whether that private IP should be displayed in RHV or
> > > not in this case (and if not, which component should filter it out), I
> > > wonder how interesting that is.
> > 
> > RHV should show the guest's ip when the guest running qemu-ga server
> > normally.in this bug,the guest has installed qemu-ga.
> > So I think the real issue is that:why the guest doesn't have ip, rhv still
> > can show the ip info?
> 
> Right so we already have the answer for this part -
> the guest actually *has* an IP - the NIC is assigned with a private IP, the
> one that is presented in RHV, even though it appears as disconnected in the
> output of 'ipconfig' within the guest.
> 
> Dominik, this is easily reproducible:
> 1. Add a NIC with empty profile to a VM installed with Windows and
> qemu-guest-agent
> 2. Start the VM
> => The NIC appears as disconnected from within the guest (which makes sense,
> it's not set with any network) and qemu-guest-agent reports the private IP
> that Windows assigns to this NIC and we display it in RHV.
> 


This behavior sounds good to me. 

> This is a low-priority issue (it shouldn't normally happen), yet -
> would it make sense to always filter the reported IPs from qemu-guest-agent
> in this case (of a NIC with empty profile)?

Why we should?
The guest OS configured this IP address for the interface, and oVirt/RHV reports it correctly.

> Is it something that was discussed/considered before?

I am not aware of this.

Zi, what is the behavior you would expect here?

In comment 0 you wrote:
> RHV cannot show ip info if guest's ip doestn't exist.

But it turns out that this IP address is configured, so RHV pointed you in the correct direction.
Do you have an idea how RHV could show you in a better way, what happens inside the guest?

Comment 20 Arik 2020-11-03 08:09:41 UTC
(In reply to Dominik Holler from comment #19)
> (In reply to Arik from comment #17)
> > This is a low-priority issue (it shouldn't normally happen), yet -
> > would it make sense to always filter the reported IPs from qemu-guest-agent
> > in this case (of a NIC with empty profile)?
> 
> Why we should?
> The guest OS configured this IP address for the interface, and oVirt/RHV
> reports it correctly.

That's right but I think there's a matter of usability here.
We can:
1. Project the configuration as it appears from within the guest; or
2. Filter out what is unlikely to be useful for the user

The qemu-guest-agent does its part - it reports what it sees within the guest.
RHV already filters out some of what qemu-guest-agent reports - by default the loopback interface is filtered out and optionally other interfaces that the user configured RHV to filter out (using 'GuestNicNamesBlacklist' in vdc_options).

But I'm not sure if that should be applied also for the IP of NICs without a network profile.
On the one hand, such a NIC is defined in RHV without a network and as it appears in this case, I guess the assigned IP would typically not be accessible - so what's the point in showing it?
On the other hand, maybe with different configuration within the guest that NIC would be assigned with an IP that is accessible and usable from outside and then it makes sense to present it.

Maybe what I'm missing here is what's the reason for setting a NIC without network profile on the first place?

Comment 21 Dominik Holler 2020-11-03 15:04:51 UTC
(In reply to Arik from comment #20)
> (In reply to Dominik Holler from comment #19)
> > (In reply to Arik from comment #17)
> > > This is a low-priority issue (it shouldn't normally happen), yet -
> > > would it make sense to always filter the reported IPs from qemu-guest-agent
> > > in this case (of a NIC with empty profile)?
> > 
> > Why we should?
> > The guest OS configured this IP address for the interface, and oVirt/RHV
> > reports it correctly.
> 
> That's right but I think there's a matter of usability here.
> We can:
> 1. Project the configuration as it appears from within the guest; or
> 2. Filter out what is unlikely to be useful for the user
> 
> The qemu-guest-agent does its part - it reports what it sees within the
> guest.
> RHV already filters out some of what qemu-guest-agent reports - by default
> the loopback interface is filtered out and optionally other interfaces that
> the user configured RHV to filter out (using 'GuestNicNamesBlacklist' in
> vdc_options).
> 
> But I'm not sure if that should be applied also for the IP of NICs without a
> network profile.
> On the one hand, such a NIC is defined in RHV without a network and as it
> appears in this case, I guess the assigned IP would typically not be
> accessible - so what's the point in showing it?

It might help to detect such a situation as described in comment 0 ;-)

> On the other hand, maybe with different configuration within the guest that
> NIC would be assigned with an IP that is accessible and usable from outside
> and then it makes sense to present it.
> 

Yes, if the guest would enable routing, but I would ignore such cases.

> Maybe what I'm missing here is what's the reason for setting a NIC without
> network profile on the first place?

You could attach the network after boot, without hotplugging the vNIC.
One reason might be to keep the order or the PCI address of vNICs in the guest.

Comment 22 liuzi 2020-11-04 02:18:20 UTC
(In reply to Dominik Holler from comment #19)
 
> I am not aware of this.
> 
> Zi, what is the behavior you would expect here?
> 
> In comment 0 you wrote:
> > RHV cannot show ip info if guest's ip doestn't exist.
> 
> But it turns out that this IP address is configured, so RHV pointed you in
> the correct direction.
> Do you have an idea how RHV could show you in a better way, what happens
> inside the guest?

Hi,Arik
From my part,I think RHV shouldn't show ip info if a guest's NIC with empty profile.
First, it is useless information for user. And second, it will make someone who don't know much about Windows and qemu-ga confused.

Comment 23 Yvugenfi@redhat.com 2020-11-10 09:50:46 UTC
*** Bug 1867575 has been marked as a duplicate of this bug. ***

Comment 25 Arik 2021-08-31 12:24:13 UTC
OK, so let's filter out the reported IPs for NICs that are not set with a network profile in oVirt then

Comment 27 Arik 2022-04-12 10:18:21 UTC
Low priority issue that is not so interesting from the RHV point of view.
Feel free to reopen if this doesn't work for you.

Comment 28 Sandro Bonazzola 2022-04-20 06:32:24 UTC
This bugzilla is included in oVirt 4.5.0 release, published on April 20th 2022.

Since the problem described in this bug report should be resolved in oVirt 4.5.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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