Bug 2026371

Summary: [RHEL9][Hyper-V]The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9
Product: Red Hat Enterprise Linux 9 Reporter: xxiong
Component: hyperv-daemonsAssignee: Mohammed Gamal <mmorsy>
Status: CLOSED ERRATA QA Contact: xxiong
Severity: high Docs Contact:
Priority: medium    
Version: 9.0CC: cavery, fge, huzhao, litian, mmorsy, mrezanin, till, vkuznets, xuli, xxiong, yacao, yuxisun
Target Milestone: rcKeywords: Triaged
Target Release: 9.0Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: hyperv-daemons-0-0.39.20190303git.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2056566 (view as bug list) Environment:
Last Closed: 2022-05-17 13:07:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2056566    

Description xxiong 2021-11-24 13:48:32 UTC
Description of problem:

The /usr/libexec/hypervkvpd/hv_set_ifconfig need update for RHEL9 since the ifdown/ifup was not supported on RHEL9


Version-Release number of selected component (if applicable):

Host: 
Hyper-V 2019

Guest: 
RHEL-9.0.0-20211121.7

Kernel:
5.14.0-17.el9.x86_64

hypervkvpd:
hypervkvpd-0-0.37.20190303git.el9.x86_64

How reproducible:
100%

Steps to Reproduce:

1. Create an new VM
2. Login and check the /usr/libexec/hypervkvpd/hv_set_ifconfig


Actual results:
1. The ifdown/ifup command used in hv_set_ifconfig
/sbin/ifdown $interface 2>/dev/null
/sbin/ifup $interface 2>/dev/null

2. The ifdown/ifup command doesn't support on RHEL9:
[rhel@vm-197-195 ~]$ ifdown eth1
bash: ifdown: command not found...
^C
[rhel@vm-197-195 ~]$ ifup eth1
bash: ifup: command not found...
^C
[rhel@vm-197-195 ~]$ ^C
[rhel@vm-197-195 ~]$ /sbin/ifdown eth0
-bash: /sbin/ifdown: No such file or directory
[rhel@vm-197-195 ~]$ /sbin/ifup eth1
-bash: /sbin/ifup: No such file or directory
[rhel@vm-197-195 ~]$

3. This will cause IP inject from hyper-v host function not work 

Expected results:
1. Should add new command supported by RHEL9


Additional information:
https://github.com/torvalds/linux/blob/master/tools/hv/hv_set_ifconfig.sh

Comment 10 xxiong 2021-12-15 12:41:38 UTC
Checked with hyperv-daemons-0-0.39.20190303git.el9

now the ifdown/ifup lines changed, and run the auto case of IPInjection:Passed

[root@bootp-73-199-94 ~]# cat /usr/libexec/hypervkvpd/hv_set_ifconfig
filename="${1##*/}"
nmcli connection load "/etc/sysconfig/network-scripts/${filename}"
nmcli connection up filename "/etc/sysconfig/network-scripts/${filename}"

[root@bootp-73-199-94 ~]# rpm -qa | grep hyperv
hyperv-tools-0-0.38.20190303git.el9.noarch
hyperv-daemons-license-0-0.39.20190303git.el9.noarch
hypervfcopyd-0-0.39.20190303git.el9.x86_64
hypervkvpd-0-0.39.20190303git.el9.x86_64
hypervvssd-0-0.39.20190303git.el9.x86_64
hyperv-daemons-0-0.39.20190303git.el9.x86_64

Comment 13 xxiong 2021-12-17 08:13:20 UTC
Checked with RHEL-9.0.0-20211216.2 (5.14.0-31.el9.x86_64 and hyperv-daemons-0-0.39.20190303git.el9.x86_64 ), now the IP inject auto script  is pass


echo "ONBOOT=yes" >> $1


cp $1 /etc/sysconfig/network-scripts/

filename="${1##*/}"
nmcli connection load "/etc/sysconfig/network-scripts/${filename}"
nmcli connection up filename "/etc/sysconfig/network-scripts/${filename}"
[root@vm-198-114 ~]# uname -r
5.14.0-31.el9.x86_64
[root@vm-198-114 ~]# rpm -qa | grep hyperv
hyperv-daemons-0-0.39.20190303git.el9.x86_64

Comment 16 errata-xmlrpc 2022-05-17 13:07:17 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 (new packages: hyperv-daemons), 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/RHBA-2022:2459