Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve interface filtering when iscsi session is detected #891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ibrokethecloud
Copy link
Contributor

@ibrokethecloud ibrokethecloud commented Dec 3, 2024

The PR improves nic filtering when iscsi sessions are detected.
With this change, in case a vlan interface is used for an iscsi session, then the parent interface is filtered from the list of interfaces and is no longer visible in the list of interfaces

If there is no iscsi session then the behaviour of the installer remains unchanged.

Problem:

v1.4.0 introduced support for external iscsi disks to be used as install disks. Changes were made in the installer to skip interfaces which were being used for the iscsi session. In environments where vlans are in use for accessing the iscsi disks, then dracut sets up a vlan interface which is subsequently used for iscsi login and subsequent sessions.

Our current logic did not pick this up and the parent interface being used for the vlan interface was still included in the installer drop down.

Solution:

Improve the interface filtering to identify if a vlan interface is in use for an iscsi session, and filter the corresponding parent interface

For example on a sample setup a vlan interface for vlan 2017 running of the base interface enp4s0f0 is being used for iscsi login.

rancher:~ # ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether bc:30:5b:f4:b3:c8 brd ff:ff:ff:ff:ff:ff
    altname enp1s0f0
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether bc:30:5b:f4:b3:c9 brd ff:ff:ff:ff:ff:ff
    altname enp1s0f1
4: enp4s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:24:4d:a4 brd ff:ff:ff:ff:ff:ff
5: eno3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether bc:30:5b:f4:b3:ca brd ff:ff:ff:ff:ff:ff
    altname enp1s0f2
6: enp4s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:24:4d:a6 brd ff:ff:ff:ff:ff:ff
7: eno4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether bc:30:5b:f4:b3:cb brd ff:ff:ff:ff:ff:ff
    altname enp1s0f3
8: enp4s0f0.2017@enp4s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether a0:36:9f:24:4d:a4 brd ff:ff:ff:ff:ff:ff
rancher:~ # ip add show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether bc:30:5b:f4:b3:c8 brd ff:ff:ff:ff:ff:ff
    altname enp1s0f0
3: eno2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether bc:30:5b:f4:b3:c9 brd ff:ff:ff:ff:ff:ff
    altname enp1s0f1
4: enp4s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether a0:36:9f:24:4d:a4 brd ff:ff:ff:ff:ff:ff
5: eno3: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether bc:30:5b:f4:b3:ca brd ff:ff:ff:ff:ff:ff
    altname enp1s0f2
6: enp4s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether a0:36:9f:24:4d:a6 brd ff:ff:ff:ff:ff:ff
7: eno4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether bc:30:5b:f4:b3:cb brd ff:ff:ff:ff:ff:ff
    altname enp1s0f3
8: enp4s0f0.2017@enp4s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether a0:36:9f:24:4d:a4 brd ff:ff:ff:ff:ff:ff
    inet 10.115.48.10/21 brd 10.115.55.255 scope global enp4s0f0.2017
       valid_lft forever preferred_lft forever
rancher:~ # iscsiadm -m session -P 2 -S
Target: iqn.2007-02.com.example:san.harvester (non-flash)
	Current Portal: 10.115.48.5:3260,1
	Persistent Portal: 10.115.48.5:3260,1
		**********
		Interface:
		**********
		Iface Name: default
		Iface Transport: tcp
		Iface Initiatorname: iqn.10-115-254-171.san.dell
		Iface IPaddress: 10.115.48.10
		Iface HWaddress: default
		Iface Netdev: default
		SID: 1
		iSCSI Connection State: LOGGED IN
		iSCSI Session State: LOGGED_IN
		Internal iscsid Session State: NO CHANGE
		*********
		Timeouts:
		*********
		Recovery Timeout: 120
		Target Reset Timeout: 30
		LUN Reset Timeout: 30
		Abort Timeout: 15
		*****
		CHAP:
		*****
		username: <empty>
		password: <empty>
		username_in: <empty>
		password: <empty>
		************************
		Negotiated iSCSI params:
		************************
		HeaderDigest: None
		DataDigest: None
		MaxRecvDataSegmentLength: 262144
		MaxXmitDataSegmentLength: 8192
		FirstBurstLength: 65536
		MaxBurstLength: 262144
		ImmediateData: Yes
		InitialR2T: Yes
		MaxOutstandingR2T: 1

With the improved filtering, interface enp4s0f0 is no longer shown in the harvester installer network options

image

Related Issue:
harvester/harvester#6964

Test plan:

With this change, in case a vlan interface is used for an iscsi session,
then the parent interface is filtered from the list of interfaces and
is no longer visible in the list of interfaces

If there is no iscsi session then the behaviour of the installer remains
unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants