Test procedure for the partman-iscsi changes
============================================

Based on the previous comment setup.


iSCSI initiator:
---------------

...

Note there's no 'iscsi_auto' in the kernel cmdline:


    iPXE> ifopen net0
    iPXE> kernel http://192.168.122.1:8000/vmlinuz initrd=initrd.gz --- 
console=ttyS0
    iPXE> initrd http://192.168.122.1:8000/initrd.gz
    iPXE> boot 

Back to serial console.
Proceed with the installer.

In 'Users and passwords' dialogs, select 'Go back', and 'Execute a
shell', and 'Continue'.



Bring up the iSCSI devices with iBFT 
(manually or with patched disk-detect udeb)

    ~ # modprobe iscsi_ibft

    ~ # iscsistart -N
    Setting up software interface ens4

~ # iscsistart -b
iscsistart: Logging into iqn.2019-03.com.example:target1 10.0.0.1:3260,1
iscsistart: version 2.0-874
iscsistart: Connection1:0 to [target: iqn.2019-03.com.example:target1, portal: 
10.0.0.1,3260] through [iface: default] is operational now


~ # dmesg | grep -e iBFT -e sd
[    0.007308] iBFT found at 0x9e520.
[   94.949058] iBFT detected.
[  105.158333] sd 2:0:0:1: Attached scsi generic sg2 type 0
[  105.158800] sd 2:0:0:1: Power-on or device reset occurred
[  105.161642] sd 2:0:0:1: [sda] 16777216 512-byte logical blocks: (8.59 
GB/8.00 GiB)
[  105.161646] sd 2:0:0:1: [sda] 4096-byte physical blocks
[  105.161970] sd 2:0:0:1: [sda] Write Protect is off
[  105.161974] sd 2:0:0:1: [sda] Mode Sense: 69 00 10 08
[  105.162645] sd 2:0:0:1: [sda] Write cache: enabled, read cache: enabled, 
supports DPO and FUA
[  105.174899] sd 2:0:0:1: [sda] Attached SCSI disk


See interface 1 (ens3) is default interface in 192.168.122.0/24 range,
and interface 2 (ens4) is a iSCSI interface in 10.0.0.0/24 range.

~ # ip addr list
...
2: ens3: ...
    link/ether 52:54:00:00:00:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.162/24 brd 192.168.122.255 scope global ens3
...
3: ens4: ...
    link/ether 52:54:00:00:00:02 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.2/24 brd 10.0.0.255 scope global ens4
...


Return with 'exit' and proceed with the installer until the 'Partition disks' 
dialog.


Test #0) Original partman-iscsi
----

In 'Partition disks' dialogs, select 'Go back', and 'Change debconf
priority', and 'Continue', and 'low'.

Return to the 'Partition disks' dialog.
Select 'Guided partitioning', 
and 'Guided - use entire disk',
and 'SCSI3 (0,0,1) (sda) - 8.6 GB IET VIRTUAL-DISK,
and 'All files in one partition (recommended for new users)',
and 'Finish partitioning and write changes to disk',
and 'No' in 'No partitions for use as swap space',
and 'Yes' in 'Write the changes to disks?',
and 'Continue' and 'Continue' for swap file questions.

This should partition and format the disk, and return to the menu, as
the debconf priority is 'low'.

Select 'Execute a shell', and 'Continue'.

See that the wrong network interface is used for the HWADDR field in 
iscsi.initramfs
(trailing :01 instead of :02).

~ # cat /target/etc/iscsi/iscsi.initramfs 
HWADDR="52:54:00:00:00:01"
ISCSI_TARGET_NAME="iqn.2019-03.com.example:target1"
ISCSI_TARGET_IP="10.0.0.1"
ISCSI_TARGET_PORT="3260"
ISCSI_TARGET_GROUP="1"


Test #1) Patched partman-iscsi, changes for patch 1/2  
----
(use the iSCSI interface for HWADDR and /etc/network/interfaces)

Install the patched udeb:

    ~ # wget 
http://ppa.launchpad.net/mfo/sf211547v2/ubuntu/pool/main/p/partman-iscsi/partman-iscsi_40ubuntu4.18.04.1_all.udeb
    ~ # udpkg --unpack partman-iscsi_40ubuntu4.18.04.1_all.udeb


Verify the new option is not yet enabled.

    ~ # debconf-get partman-iscsi/iscsi_auto
    false

Unmount the swap so 'Partition disks' can work again.

~ # swapoff /target/swapfile

Return with 'exit' and repeat the 'Partition disks'/'Execute a shell'
procedure from Test #0.

See that the iSCSI network interface is now used in HWADDR:

~ # cat /target/etc/iscsi/iscsi.initramfs 
HWADDR="52:54:00:00:00:02"
ISCSI_TARGET_NAME="iqn.2019-03.com.example:target1"
ISCSI_TARGET_IP="10.0.0.1"
ISCSI_TARGET_PORT="3260"
ISCSI_TARGET_GROUP="1"


Test #2) Patched partman-iscsi, changes for patch 2/2  
----
(use ISCSI_AUTO=true in /etc/iscsi/iscsi.initramfs)

Now enable the 'partman-iscsi/iscsi_auto' option,
and start a new debconf/menu to detect its value:

Install the patched udeb again, so the option re-appears:

    ~ # debconf-get partman-iscsi/iscsi_auto
    ~ #

    ~ # udpkg --unpack partman-iscsi_40ubuntu4.19.04.1_all.udeb

    ~ # debconf-get partman-iscsi/iscsi_auto
    false
    ~ # debconf-set partman-iscsi/iscsi_auto true
    ~ # debconf-get partman-iscsi/iscsi_auto
    true


~ # swapoff /target/swapfile

    ~ # debconf -o d-i /usr/bin/main-menu

Repeat the 'Partition disks'/'Execute a shell' procedure from Test #0.

See that 'ISCSI_AUTO=true' is not configured in 'iscsi.initramfs'.

    ~ # cat /target/etc/iscsi/iscsi.initramfs
    ISCSI_AUTO=true

Return with 'exit', then 'Change debconf priority' to 'high' again, and
proceed/finish the installation.

System reboots.

Back to VNC console, go again to iPXE shell:

    $ vncviewer <address>:1
    iPXE <...>
    <wait for NIC address detection>

    Press Ctrl-B for iPXE command line.
    ^B

    iPXE>

Configure iSCSI NIC:

    iPXE> ifopen net1
    iPXE> set net1/ip 10.0.0.2
    iPXE> set net1/netmask 255.255.255.0

Boot from iSCSI (iSCSI portal 10.0.0.1, LUN 1 on target
iqn.<...>:target1)

    iPXE> sanboot iscsi:10.0.0.1:::1:iqn.2019-03.com.example:target1
    Registered SAN device 0x80
    Booting from SAN device 0x80

Back to serial console.
Watch the system boot with ISCSI_AUTO=true (no iscsi_auto kernel cmdline 
option):


        ...

        Setting up software interface ens4
        no search or nameservers found in /run/net-ens4.conf /run/net-ens4.conf 
/run/net6-*.conf
        iscsistart: Logging into iqn.2019-03.com.example:target1 10.0.0.1:3260,1
        iscsistart: version 2.0-874
        iscsistart: Connection1:0 to [target: iqn.2019-03.com.example:target1, 
portal: 10.0.0.1,3260] through [iface: default] is operational now
        /dev/sda1: recovering journal
        /dev/sda1: clean, 60269/524288 files, 479003/2096640 blocks

        ...

        ubuntu login: ubuntu
        Password: 

        ubuntu@ubuntu:~$ mount | grep -w /
        /dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)

        ubuntu@ubuntu:~$ ls -ld /sys/block/sda
        lrwxrwxrwx 1 root root 0 Mar 22 20:15 /sys/block/sda -> 
../devices/platform/host3/session1/target3:0:0/3:0:0:1/block/sda

        ubuntu@ubuntu:~$ cat 
/sys/devices/platform/host3/session1/iscsi_session/session1/targetname
        iqn.2019-03.com.example:target1

        ubuntu@ubuntu:~$ sudo cat /etc/iscsi/iscsi.initramfs 
        ISCSI_AUTO=true

        ubuntu@ubuntu:~$ ip addr list
        ...
        2: ens3: ...
            link/ether 52:54:00:00:00:01 brd ff:ff:ff:ff:ff:ff
            inet 192.168.122.163/24 brd 192.168.122.255 scope global dynamic 
ens3
        ...
        3: ens4: ...
            link/ether 52:54:00:00:00:02 brd ff:ff:ff:ff:ff:ff
            inet 10.0.0.2/24 brd 10.0.0.255 scope global ens4
        ...

        ubuntu@ubuntu:~$ sudo cat /etc/netplan/01-netcfg.yaml 
        # This file describes the network interfaces available on your system
        # For more information, see netplan(5).
        network:
          version: 2
          renderer: networkd
          ethernets:
            ens3:
              dhcp4: yes

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1817321

Title:
  installer does not support iSCSI iBFT

Status in debian-installer package in Ubuntu:
  Confirmed
Status in hw-detect package in Ubuntu:
  Confirmed
Status in linux package in Ubuntu:
  Fix Released
Status in partman-iscsi package in Ubuntu:
  Confirmed
Status in debian-installer source package in Bionic:
  Confirmed
Status in hw-detect source package in Bionic:
  Confirmed
Status in linux source package in Bionic:
  Fix Released
Status in partman-iscsi source package in Bionic:
  Confirmed
Status in debian-installer source package in Cosmic:
  Confirmed
Status in hw-detect source package in Cosmic:
  Confirmed
Status in linux source package in Cosmic:
  Fix Released
Status in partman-iscsi source package in Cosmic:
  Confirmed
Status in debian-installer source package in Disco:
  Confirmed
Status in hw-detect source package in Disco:
  Confirmed
Status in linux source package in Disco:
  Fix Released
Status in partman-iscsi source package in Disco:
  Confirmed
Status in debian-installer source package in Eoan:
  Confirmed
Status in hw-detect source package in Eoan:
  Confirmed
Status in linux source package in Eoan:
  Fix Released
Status in partman-iscsi source package in Eoan:
  Confirmed

Bug description:
  [Impact]

   * It's not possible to access iBFT (iSCSI Boot Firmware Table) information
     (settings for network interface, initiator, and target) in the installer
     because the 'iscsi_ibft' module is not present in udeb packages.

   * Even if it was, the installer does not handle iBFT information at all,
     thus any settings are ignored, and iSCSI-related configuration has to
     be done manually or with workarounds.

   * This impacts user-experience and automatic installation on systems and
     deployments which actually do provide the iBFT feature and information,
     but cannot use it practically.

   * With proper iBFT support in the installer (kernel module in udeb package
     and automatic iSCSI-related configuration) users will be able to rely on
     iBFT to install/deploy Ubuntu on their servers and datacenters.

   * These fixes add the 'iscsi_ibft' kernel module in the scsi-modules udeb,
     and configure network/iSCSI according to iBFT information in disk-detect.

     This is done in disk-detect so that the iSCSI LUNs are detected as disks
     (useful in case of no other disks in the system so the installer doesn't
     complain nor wait too long) and that any partman-related preseed options
     are not required and may be still available for the user.

  [Test Case]

   * linux package / kernel module in udeb:

     $ dpkg-deb -c scsi-modules_*.udeb | grep iscsi_ibft.ko

     Check the module loads in the installer environment.
     See comment with example for disco.

   * d-i/hw-detect/partman-iscsi package:
     See comments 11, 12, 13.

  [Regression Potential]

   * linux package: low, the kernel module is not loaded by default,
     and only checks whether iBFT information is present in firmware,
     then exposes that in sysfs in read-only mode.

   * d-i/hw-detect/partman-iscsi:
     - d-i: kernel version update to include iscsi_ibft module,
            based on kernel released to -updates plus one week
            monitoring bug reports -- it should be OK.
            Tested on amd64/i386/arm64/ppc64el on QEMU, plus amd64
            on baremetal -- see comment 11.
     - hw-detect: low, the changes are enabled by a preseed option.
                  see comment 12.
     - partman-iscsi: low, simple changes, plus one fix that has
                      been tested in detail, and falls back to
                      previous behavior if it fails.
                      see comment 13.

  [Other Info]

   * This has been verified both by the developer with a simple iSCSI
     iBFT environment (2 VMs: iSCSI target & initiator with UEFI+iPXE)
     and by an user with system/firmware that supports iBFT for iSCSI.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/debian-installer/+bug/1817321/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to