Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #The full self-test steps
- Test env - use existing test env described in lp bug
- n1 system-id: 6bhqr3
- n1 net1: 172.16.1.201/24
- n1 net1 MAC: 52:54:00:87:02:a4
- x99/vsw1: 172.16.1.1
- MAAS/enp7s0: 172.16.1.253
- iSCSI portal: 172.16.1.1:3260
- iSCSI target: iqn.2017-02.com.quqi:storage
- Initiator: iqn.2017-02.com.quqi:lv-vm1
- 1, Run on my working machine with fix, prepare the before-fix and after-fix
- cd /bak/work/open-iscsi
- rm -rf /tmp/lp2147499-test
- mkdir -p /tmp/lp2147499-test
- hua@y9000p:/bak/work/open-iscsi$ git log --oneline -3
- 06a3d32 (HEAD -> jammy-devel, zhhuabj/jammy-devel) changelog for static bootproto normalization
- 5dd7736 normalize static bootproto for initramfs netplan conversion
- 288b3bc (tag: import/2.1.5-1ubuntu1.1, origin/ubuntu/jammy-updates, jammy-updates) 2.1.5-1ubuntu1.1 (patches unapplied)
- TIP_COMMIT=$(git rev-parse HEAD)
- FIX_COMMIT=$(git rev-parse HEAD^)
- BASE_COMMIT=$(git rev-parse HEAD^^)
- git show "${BASE_COMMIT}:debian/extra/initramfs.local-top" > /tmp/lp2147499-test/iscsi.before
- git show "${TIP_COMMIT}:debian/extra/initramfs.local-top" > /tmp/lp2147499-test/iscsi.after
- chmod 0755 /tmp/lp2147499-test/iscsi.before /tmp/lp2147499-test/iscsi.after
- #verify the fix
- hua@y9000p:/bak/work/open-iscsi$ echo '=== BEFORE ===' && grep -nE 'STATIC\)|IPV4PROTO|PROTO="static"|PROTO="none"' /tmp/lp2147499-test/iscsi.before
- === BEFORE ===
- 110: PROTO="none"
- 172: STATIC) PROTO="static" ;;
- hua@y9000p:/bak/work/open-iscsi$ echo '=== AFTER ==='
- grep -nE 'STATIC\)|IPV4PROTO|PROTO="static"|PROTO="none"' /tmp/lp2147499-test/iscsi.after
- === AFTER ===
- 110: PROTO="none"
- 111: IPV4PROTO=""
- 127: echo "IPV4PROTO='${IPV4PROTO}'"
- 175: IPV4PROTO="dhcp"
- 177: STATIC)
- 179: # Keep IPV4PROTO=static for consumers that parse /run/network/dynamic-interfaces.
- 180: PROTO="none"
- 181: IPV4PROTO="static"
- 185: IPV4PROTO="${v}"
- 2, Test env is on the machine x99, so copy fixes into x99
- scp -r /tmp/lp2147499-test hua@x99:/tmp/
- 3, on machine x99
- cd /tmp/lp2147499-test
- nohup python3 -m http.server 8081 --bind 172.16.1.1 >/tmp/lp2147499-http.log 2>&1 &
- #verify
- curl -f http://172.16.1.1:8081/iscsi.before | grep 'PROTO="static"'
- curl -f http://172.16.1.1:8081/iscsi.after |grep 'IPV4PROTO="static"'
- 4, verify maas pxe url
- hua@x99:/tmp/lp2147499-test$ curl -f http://172.16.1.253:5248/ipxe.cfg-52:54:00:87:02:a4
- #!ipxe
- # Boot the locally attached hard drives. On failure try the next locally
- # attached hard drive. Fail on the last hard drive, if booting fails.
- sanboot --no-describe --drive 0x80 ||
- sanboot --no-describe --drive 0x81 ||
- sanboot --no-describe --drive 0x82 ||
- sanboot --no-describe --drive 0x83
- 5, configure libvirt iBFT boot
- hua@x99:/tmp/lp2147499-test$ sudo virsh dumpxml n1 > /tmp/n1.before-lp2147499.xml
- sha256sum /tmp/n1.before-lp2147499.xml
- acc97255513df510a75dc567364500eba7d7e9045dffaa32d2356c098aafd632 /tmp/n1.before-lp2147499.xml
- sudo virt-xml n1 --edit --boot kernel=/usr/lib/ipxe/ipxe.lkrn,\
- kernel_args="ifclose net0 && ifclose net1 && set initiator-iqn iqn.2017-02.com.quqi:lv-vm1 && set net1/ip 172.16.1.201 && set net1/netmask 255.255.255.0 && set net1/gateway 172.16.1.1 && ifopen net1 && sanhook iscsi:172.16.1.1:::0:iqn.2017-02.com.quqi:storage && chain http://172.16.1.253:5248/ipxe.cfg-\${net1/mac} || shell"
- sudo virsh dumpxml n1 |sed -n '/<os>/,/<\/os>/p'
- hua@x99:~$ curl -f http://172.16.1.253:5248/ipxe.cfg-52:54:00:87:02:a4
- #!ipxe
- kernel http://172.16.1.253:5248/images/ce7011b/ubuntu/amd64/ga-22.04/jammy/stable/boot-kernel
- imgargs boot-kernel nomodeset root=squash:http://172.16.1.253:5248/images/e5d9ed4/ubuntu/amd64/ga-22.04/jammy/stable/squashfs ip=::::n1:BOOTIF ip6=off cc:{'datasource_list': ['MAAS']}end_cc cloud-config-url=http://172.16.1.253:5248/MAAS/metadata/latest/by-id/6bhqr3/?op=get_preseed ro overlayroot=tmpfs overlayroot_cfgdisk=disabled log_host=172.16.1.253 log_port=5247 --- console=ttyS0,115200n8 iscsi_auto break=init BOOTIF=01-${mac}
- initrd http://172.16.1.253:5248/images/02e6022/ubuntu/amd64/ga-22.04/jammy/stable/boot-initrd
- boot
- 6, run on maas vm
- maas admin maas get-config name=kernel_opts |tee /tmp/lp2147499-kernel-opts.before
- maas admin maas set-config name=kernel_opts value="console=ttyS0,115200n8 iscsi_auto break=init"
- maas admin maas get-config name=kernel_opts
- #verify
- ubuntu@maas:~$ maas admin maas get-config name=kernel_opts
- Success.
- Machine-readable output follows:
- "console=ttyS0,115200n8 iscsi_auto break=init"
- 7, do commission for n1
- maas admin machine release 6bhqr3
- maas admin machine read 6bhqr3 |jq '{hostname,status_name,power_state}'
- maas admin machine commission 6bhqr3
- #verify
- ubuntu@maas:~$ maas admin machine read 6bhqr3 |jq '{hostname,status_name,power_state}'
- {
- "hostname": "n1",
- "status_name": "Commissioning",
- "power_state": "on"
- }
- 8, connect n1 via console
- sudo virsh console n1 |tee /tmp/lp2147499-console.log
- hua@x99:~$ sudo virsh console n1 |tee /tmp/lp2147499-console.log
- Connected to domain 'n1'
- Escape character is ^] (Ctrl + ])
- (initramfs) cat /proc/cmdline
- nomodeset root=squash:http://172.16.1.253:5248/images/e5d9ed4/ubuntu/amd64/ga-22.04/jammy/stable/squashfs ip=::::n1:BOOTIF ip6=off cc:{'datasource_list': ['MAAS']}end_cc cloud-config-url=http://172.16.1.253:5248/MAAS/metadata/latest/by-id/6bhqr3/?op=get_preseed ro overlayroot=tmpfs overlayroot_cfgdisk=disabled log_host=172.16.1.253 log_port=5247 --- console=ttyS0,115200n8 iscsi_auto break=init BOOTIF=01-52:54:00:87:02:a4
- (initramfs) ls /sys/firmware/ibft
- acpi_header target0 initiator ethernet0
- (initramfs) modprobe iscsi_ibft
- (initramfs) iscsistart -f | grep -E 'iface.bootproto|iface.ipaddress|iface.subne
- t_mask|iface.gateway|iface.net_ifacename|node.name'
- iface.bootproto = STATIC
- iface.ipaddress = 172.16.1.201
- iface.subnet_mask = 255.255.255.0
- iface.gateway = 172.16.1.1
- iface.net_ifacename = enp2s0
- node.name = iqn.2017-02.com.quqi:storage
- #download fixes
- wget -O /tmp/iscsi.before http://172.16.1.1:8081/iscsi.before
- wget -O /tmp/iscsi.after http://172.16.1.1:8081/iscsi.after
- chmod 0755 /tmp/iscsi.before /tmp/iscsi.after
- (initramfs) wget -O /tmp/iscsi.before http://172.16.1.1:8081/iscsi.before
- Connecting to 172.16.1.1:8081 (172.16.1.1:8081)
- iscsi.before 100% |********************************| 10297 0:00:00 ETA
- (initramfs) wget -O /tmp/iscsi.after http://172.16.1.1:8081/iscsi.after
- Connecting to 172.16.1.1:8081 (172.16.1.1:8081)
- iscsi.after 100% |********************************| 10631 0:00:00 ETA
- (initramfs) chmod 0755 /tmp/iscsi.before /tmp/iscsi.after
- 9, reproduce the problem by using iscsi.before
- mkdir -p /run/initramfs /run/network /run/netplan
- cp /tmp/iscsi.before /scripts/local-top/iscsi
- chmod 0755 /scripts/local-top/iscsi
- rm -f /run/net-*.conf /run/net6-*.conf
- rm -f /run/initramfs/open-iscsi.interface
- rm -f /run/network/dynamic-interfaces
- rm -f /run/netplan/*.yaml
- /scripts/local-top/iscsi
- cat /run/net-enp2s0.conf
- (initramfs) mkdir -p /run/initramfs /run/network /run/netplan
- (initramfs) cp /tmp/iscsi.before /scripts/local-top/iscsi
- (initramfs) chmod 0755 /scripts/local-top/iscsi
- (initramfs) rm -f /run/net-*.conf /run/net6-*.conf
- (initramfs) rm -f /run/initramfs/open-iscsi.interface
- (initramfs) rm -f /run/network/dynamic-interfaces
- (initramfs) rm -f /run/netplan/*.yaml
- (initramfs) /scripts/local-top/iscsi
- Setting up software interface enp2s0
- ip: RTNETLINK answers: File exists
- Begin: Waiting up to 180 secs for enp2s0 to become available ... done.
- no search or nameservers found in /run/net-enp2s0.conf /run/net-enp2s0.conf /run/net6-*.conf
- iscsistart: version 2.1.5
- iscsistart: Logging into iqn.2017-02.com.quqi:storage 172.16.1.1:3260,1
- iscsistart: initiator reported error (15 - session exists)
- (initramfs) cat /run/net-enp2s0.conf
- DEVICE='enp2s0'
- PROTO='static'
- IPV4ADDR='172.16.1.201'
- IPV4BROADCAST=''
- IPV4NETMASK='255.255.255.0'
- IPV4GATEWAY='172.16.1.1'
- IPV4DNS0=''
- IPV4DNS1=''
- HOSTNAME=''
- DNSDOMAIN=''
- NISDOMAIN=''
- ROOTSERVER=''
- ROOTPATH=''
- UPTIME='0'
- DHCPLEASETIME='0'
- DOMAINSEARCH=''
- /scripts/init-bottom/cloud-initramfs-dyn-netconf
- mkdir -p /run/netplan
- . /scripts/functions
- netinfo_to_netplan /run/netplan /run/net-*.conf /run/net6-*.conf
- cat /run/netplan/enp2s0.yaml
- #successfully reproduce the problem
- (initramfs) /scripts/init-bottom/cloud-initramfs-dyn-netconf
- (initramfs) mkdir -p /run/netplan
- (initramfs) . /scripts/functions
- (initramfs) netinfo_to_netplan /run/netplan /run/net-*.conf /run/net6-*.conf
- (initramfs) cat /run/netplan/enp2s0.yaml
- network:
- version: 2
- ethernets:
- enp2s0:
- 10, fix the problem by using iscsi.after
- cp /tmp/iscsi.after /scripts/local-top/iscsi
- chmod 0755 /scripts/local-top/iscsi
- rm -f /run/net-*.conf /run/net6-*.conf
- rm -f /run/network/dynamic-interfaces
- rm -f /run/netplan/*.yaml
- /scripts/local-top/iscsi
- cat /run/net-enp2s0.conf
- (initramfs) cp /tmp/iscsi.after /scripts/local-top/iscsi
- (initramfs) chmod 0755 /scripts/local-top/iscsi
- (initramfs) rm -f /run/net-*.conf /run/net6-*.conf
- (initramfs) rm -f /run/network/dynamic-interfaces
- (initramfs) rm -f /run/netplan/*.yaml
- (initramfs) /scripts/local-top/iscsi
- Setting up software interface enp2s0
- ip: RTNETLINK answers: File exists
- Begin: Waiting up to 180 secs for enp2s0 to become available ... done.
- no search or nameservers found in /run/net-enp2s0.conf /run/net-enp2s0.conf /run/net6-*.conf
- iscsistart: version 2.1.5
- iscsistart: Logging into iqn.2017-02.com.quqi:storage 172.16.1.1:3260,1
- iscsistart: initiator reported error (15 - session exists)
- (initramfs) cat /run/net-enp2s0.conf
- DEVICE='enp2s0'
- PROTO='none'
- IPV4PROTO='static'
- IPV4ADDR='172.16.1.201'
- IPV4BROADCAST=''
- IPV4NETMASK='255.255.255.0'
- IPV4GATEWAY='172.16.1.1'
- IPV4DNS0=''
- IPV4DNS1=''
- HOSTNAME=''
- DNSDOMAIN=''
- NISDOMAIN=''
- ROOTSERVER=''
- ROOTPATH=''
- UPTIME='0'
- DHCPLEASETIME='0'
- DOMAINSEARCH=''
- /scripts/init-bottom/cloud-initramfs-dyn-netconf
- mkdir -p /run/netplan
- . /scripts/functions
- netinfo_to_netplan /run/netplan /run/net-*.conf /run/net6-*.conf
- cat /run/netplan/enp2s0.yaml
- (initramfs) /scripts/init-bottom/cloud-initramfs-dyn-netconf
- (initramfs) mkdir -p /run/netplan
- (initramfs) . /scripts/functions
- (initramfs) netinfo_to_netplan /run/netplan /run/net-*.conf /run/net6-*.conf
- (initramfs) cat /run/netplan/enp2s0.yaml
- network:
- version: 2
- ethernets:
- enp2s0:
- addresses:
- - "172.16.1.201/24"
- gateway4: "172.16.1.1"
Advertisement
Add Comment
Please, Sign In to add comment