zhhuabj

Untitled

Sep 30th, 2026
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.74 KB | None | 0 0
  1. Resolute verification steps for LP: #2147499
  2.  
  3. Run the following commands from the local workstation unless stated otherwise.
  4.  
  5. 1. Set the test variables
  6. =========================
  7.  
  8. cd /bak/work/open-iscsi
  9.  
  10. ROOT=/mnt/lp2147499-resolute-sru
  11. LV=/dev/cinder-volumes/lp2147499-resolute-sru
  12. SNAP=/dev/cinder-volumes/lp2147499-resolute-run
  13. TARGET=iqn.2026-09.local.lp2147499:resolute
  14. INITIATOR=iqn.2026-09.local.lp2147499:resolute-vm
  15. ROOT_UUID=cf947291-fdbd-41f7-ad22-6661a5a7786d
  16.  
  17. 2. Copy the proposed package to the virtualization host
  18. =======================================================
  19.  
  20. sha256sum \
  21. .tmp/lp2147499-proposed/debs/open-iscsi_2.1.11-3ubuntu3.1_amd64.deb
  22.  
  23. scp \
  24. .tmp/lp2147499-proposed/debs/open-iscsi_2.1.11-3ubuntu3.1_amd64.deb \
  25. "$HOST":/tmp/
  26.  
  27. Expected SHA-256:
  28.  
  29. d9292497ccabe0f98e08e3e57da038f651c89f7ee14ace29e6ba829b33c95d95
  30.  
  31. 3. Download and verify the native Resolute root filesystem
  32. ==========================================================
  33.  
  34. ssh "$HOST" 'set -eu
  35. cd /tmp
  36. curl -fL --retry 3 \
  37. -o resolute-server-cloudimg-amd64-root.tar.xz \
  38. https://cloud-images.ubuntu.com/resolute/current/resolute-server-cloudimg-amd64-root.tar.xz
  39. curl -fsS -o resolute-SHA256SUMS \
  40. https://cloud-images.ubuntu.com/resolute/current/SHA256SUMS
  41. curl -fsS -o resolute-SHA256SUMS.gpg \
  42. https://cloud-images.ubuntu.com/resolute/current/SHA256SUMS.gpg
  43. gpgv --keyring /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg \
  44. resolute-SHA256SUMS.gpg resolute-SHA256SUMS
  45. grep "resolute-server-cloudimg-amd64-root.tar.xz" resolute-SHA256SUMS
  46. sha256sum resolute-server-cloudimg-amd64-root.tar.xz
  47. '
  48.  
  49. Expected image SHA-256:
  50.  
  51. e0fa2e24c7d393986be102257a83df5a0aab839732c16c6cc71f5f3d4630e679
  52.  
  53. 4. Create and populate an isolated 30 GiB root LV
  54. =================================================
  55.  
  56. ssh "$HOST" 'set -eu
  57. ROOT=/mnt/lp2147499-resolute-sru
  58. LV=/dev/cinder-volumes/lp2147499-resolute-sru
  59.  
  60. sudo lvcreate -L 30G -n lp2147499-resolute-sru cinder-volumes
  61. sudo mkfs.ext4 -L resolute-sru "$LV"
  62. sudo mkdir -p "$ROOT"
  63. sudo mount "$LV" "$ROOT"
  64. sudo tar --numeric-owner --xattrs --xattrs-include="*" \
  65. -xJpf /tmp/resolute-server-cloudimg-amd64-root.tar.xz \
  66. -C "$ROOT"
  67. printf "%s\n" lp2147499-resolute-sru \
  68. | sudo tee "$ROOT/etc/hostname" >/dev/null
  69. UUID=$(sudo blkid -s UUID -o value "$LV")
  70. printf "UUID=%s / ext4 defaults 0 1\n" "$UUID" \
  71. | sudo tee "$ROOT/etc/fstab" >/dev/null
  72. sudo grep -E "^(PRETTY_NAME|VERSION_ID|VERSION_CODENAME)=" \
  73. "$ROOT/etc/os-release"
  74. sudo blkid "$LV"
  75. '
  76.  
  77. The UUID used during this test was:
  78.  
  79. cf947291-fdbd-41f7-ad22-6661a5a7786d
  80.  
  81. 5. Enable resolute-proposed
  82. ===========================
  83.  
  84. cat > /tmp/resolute-proposed.sources <<'EOF'
  85. Types: deb
  86. URIs: http://archive.ubuntu.com/ubuntu/
  87. Suites: resolute-proposed
  88. Components: main
  89. Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
  90. EOF
  91.  
  92. scp /tmp/resolute-proposed.sources "$HOST":/tmp/
  93.  
  94. 6. Install the complete proposed package and build a native initramfs-tools initrd
  95. =================================================================================
  96.  
  97. ssh "$HOST" 'sudo bash -s' <<'EOF'
  98. set -euo pipefail
  99. ROOT=/mnt/lp2147499-resolute-sru
  100.  
  101. cleanup() {
  102. rm -f "$ROOT/usr/sbin/policy-rc.d"
  103. for path in run dev proc sys; do
  104. if mountpoint -q "$ROOT/$path"; then
  105. mount --make-rslave "$ROOT/$path" 2>/dev/null || true
  106. umount -R -l "$ROOT/$path" || true
  107. fi
  108. done
  109. }
  110. trap cleanup EXIT
  111.  
  112. install -m 0644 /tmp/resolute-proposed.sources \
  113. "$ROOT/etc/apt/sources.list.d/resolute-proposed.sources"
  114. install -m 0644 /tmp/open-iscsi_2.1.11-3ubuntu3.1_amd64.deb \
  115. "$ROOT/tmp/"
  116.  
  117. printf '#!/bin/sh\nexit 101\n' > "$ROOT/usr/sbin/policy-rc.d"
  118. chmod 0755 "$ROOT/usr/sbin/policy-rc.d"
  119.  
  120. mount --rbind /dev "$ROOT/dev"
  121. mount --make-rslave "$ROOT/dev"
  122. mount -t proc proc "$ROOT/proc"
  123. mount -t sysfs sys "$ROOT/sys"
  124. mount --rbind /run "$ROOT/run"
  125. mount --make-rslave "$ROOT/run"
  126.  
  127. chroot "$ROOT" apt-get update
  128. chroot "$ROOT" sh -c \
  129. 'cd /tmp && apt-get download libopeniscsiusr=2.1.11-3ubuntu3.1'
  130.  
  131. DEBIAN_FRONTEND=noninteractive chroot "$ROOT" apt-get install -y \
  132. linux-generic \
  133. /tmp/libopeniscsiusr_2.1.11-3ubuntu3.1_amd64.deb \
  134. /tmp/open-iscsi_2.1.11-3ubuntu3.1_amd64.deb
  135.  
  136. DEBIAN_FRONTEND=noninteractive chroot "$ROOT" \
  137. apt-get install -y initramfs-tools
  138.  
  139. rm -f "$ROOT/boot/initrd.img-7.0.0-34-generic"
  140. chroot "$ROOT" update-initramfs -c -k 7.0.0-34-generic
  141.  
  142. chroot "$ROOT" dpkg-query -W \
  143. -f='${db:Status-Abbrev} ${Package} ${Version} ${Architecture}\n' \
  144. initramfs-tools libopeniscsiusr linux-generic open-iscsi
  145.  
  146. if [ -n "$(chroot "$ROOT" dpkg --audit)" ]; then
  147. echo DPKG_AUDIT=FAIL
  148. exit 1
  149. fi
  150. echo DPKG_AUDIT=PASS
  151. EOF
  152.  
  153. Expected package state:
  154.  
  155. ii initramfs-tools 0.151ubuntu1 all
  156. ii libopeniscsiusr 2.1.11-3ubuntu3.1 amd64
  157. ii linux-generic 7.0.0-34.34 amd64
  158. ii open-iscsi 2.1.11-3ubuntu3.1 amd64
  159. DPKG_AUDIT=PASS
  160.  
  161. 7. Verify the script embedded in the initrd
  162. ===========================================
  163.  
  164. ssh "$HOST" 'set -eu
  165. ROOT=/mnt/lp2147499-resolute-sru
  166. sudo rm -rf /tmp/lp2147499-resolute-initrd
  167. sudo mkdir /tmp/lp2147499-resolute-initrd
  168. sudo unmkinitramfs \
  169. "$ROOT/boot/initrd.img-7.0.0-34-generic" \
  170. /tmp/lp2147499-resolute-initrd
  171. SCRIPT=$(sudo find /tmp/lp2147499-resolute-initrd \
  172. -path "*/scripts/local-top/iscsi" -print -quit)
  173. test -n "$SCRIPT"
  174. sudo sha256sum \
  175. "$ROOT/usr/share/initramfs-tools/scripts/local-top/iscsi" \
  176. "$SCRIPT"
  177. sudo cmp -s \
  178. "$ROOT/usr/share/initramfs-tools/scripts/local-top/iscsi" \
  179. "$SCRIPT"
  180. echo SCRIPT_MATCH=yes
  181. sudo grep -n -A5 -B2 "STATIC)" "$SCRIPT" | head -n 14
  182. '
  183.  
  184. Expected script SHA-256:
  185.  
  186. 3e994c622da34f405b468c07c92185e6f6f112a04c19ba88958fc14a99d9ae90
  187.  
  188. Expected mapping:
  189.  
  190. STATIC)
  191. PROTO="none"
  192. IPV4PROTO="static"
  193.  
  194. 8. Create the iPXE script and stage the kernel and initrd
  195. ========================================================
  196.  
  197. cat > /tmp/resolute-native.ipxe <<'EOF'
  198. #!ipxe
  199. kernel http://172.16.1.1:8083/resolute-native-vmlinuz ip=none iscsi_auto root=UUID=cf947291-fdbd-41f7-ad22-6661a5a7786d ro rootwait rootdelay=20 console=ttyS0,115200n8 break=init cloud-init=disabled
  200. initrd http://172.16.1.1:8083/resolute-native-initrd.img
  201. boot
  202. EOF
  203.  
  204. scp /tmp/resolute-native.ipxe "$HOST":/tmp/
  205.  
  206. ssh "$HOST" 'set -eu
  207. ROOT=/mnt/lp2147499-resolute-sru
  208. SERVE=/tmp/lp2147499-resolute-http
  209. mkdir -p "$SERVE"
  210. sudo cp "$ROOT/boot/vmlinuz-7.0.0-34-generic" \
  211. "$SERVE/resolute-native-vmlinuz"
  212. sudo cp "$ROOT/boot/initrd.img-7.0.0-34-generic" \
  213. "$SERVE/resolute-native-initrd.img"
  214. cp /tmp/resolute-native.ipxe "$SERVE/resolute-native.ipxe"
  215. sudo chown hua:hua "$SERVE"/*
  216. sudo umount "$ROOT"
  217. '
  218.  
  219. 9. Create the writable snapshot and isolated LIO target
  220. =======================================================
  221.  
  222. ssh "$HOST" 'set -eu
  223. SRC=/dev/cinder-volumes/lp2147499-resolute-sru
  224. SNAP=/dev/cinder-volumes/lp2147499-resolute-run
  225. TARGET=iqn.2026-09.local.lp2147499:resolute
  226. INITIATOR=iqn.2026-09.local.lp2147499:resolute-vm
  227.  
  228. sudo lvcreate --snapshot --size 4G \
  229. --name lp2147499-resolute-run "$SRC"
  230. sudo e2fsck -f -y "$SNAP"
  231.  
  232. sudo targetcli /backstores/block create \
  233. name=lp2147499-resolute-run dev="$SNAP"
  234. sudo targetcli /iscsi create wwn="$TARGET"
  235. sudo targetcli /iscsi/$TARGET/tpg1/luns create \
  236. /backstores/block/lp2147499-resolute-run
  237. sudo targetcli /iscsi/$TARGET/tpg1/acls create wwn="$INITIATOR"
  238. sudo targetcli saveconfig
  239. sudo targetcli /iscsi/$TARGET ls
  240. '
  241.  
  242. 10. Start the HTTP server
  243. =========================
  244.  
  245. Run this command in a separate terminal and leave it running:
  246.  
  247. ssh -tt "$HOST" \
  248. 'cd /tmp/lp2147499-resolute-http && \
  249. exec python3 -m http.server 8083 --bind 172.16.1.1'
  250.  
  251. 11. Define the disposable diskless VM
  252. =====================================
  253.  
  254. ssh "$HOST" 'set -eu
  255. virt-install \
  256. --connect qemu:///system \
  257. --name lp2147499-resolute-sru \
  258. --memory 4096 \
  259. --vcpus 2 \
  260. --osinfo detect=off,name=ubuntu24.04 \
  261. --import \
  262. --disk none \
  263. --boot kernel=/usr/lib/ipxe/ipxe.lkrn,kernel_args="ifclose net0 && ifclose net1 && set initiator-iqn iqn.2026-09.local.lp2147499:resolute-vm && set net1/ip 172.16.1.203 && set net1/netmask 255.255.255.0 && set net1/gateway 172.16.1.1 && ifopen net1 && sanhook iscsi:172.16.1.1:::0:iqn.2026-09.local.lp2147499:resolute && chain http://172.16.1.1:8083/resolute-native.ipxe || shell" \
  264. --network bridge=vsw0,model=virtio,mac=52:54:00:21:48:01 \
  265. --network bridge=vsw1,model=virtio,mac=52:54:00:21:48:02 \
  266. --network bridge=vsw2,model=virtio,mac=52:54:00:21:48:03 \
  267. --network bridge=vsw3,model=virtio,mac=52:54:00:21:48:04 \
  268. --graphics none \
  269. --console pty,target_type=serial \
  270. --noautoconsole \
  271. --print-xml \
  272. | sudo virsh define /dev/stdin
  273. '
  274.  
  275. 12. Boot to the initramfs shell
  276. ==============================
  277.  
  278. ssh -tt "$HOST" \
  279. 'sudo virsh start lp2147499-resolute-sru --console'
  280.  
  281. 13. Commands and actual output in initramfs
  282. ===========================================
  283.  
  284. (initramfs) echo __RESOLUTE_NATIVE_BEGIN__; uname -r; cat /proc/cmdline; iscsistart -f > /tmp/ibft.txt; grep -E 'bootproto|ipaddress|subnet_mask|gateway|net_ifacename|targetname' /tmp/ibft.txt
  285. __RESOLUTE_NATIVE_BEGIN__
  286. 7.0.0-34-generic
  287. ip=none iscsi_auto root=UUID=cf947291-fdbd-41f7-ad22-6661a5a7786d ro rootwait rootdelay=20 console=ttyS0,115200n8 break=init cloud-init=disabled
  288. iface.bootproto = STATIC
  289. iface.ipaddress = 172.16.1.203
  290. iface.subnet_mask = 255.255.255.0
  291. iface.gateway = 172.16.1.1
  292. iface.net_ifacename = enp2s0
  293.  
  294. (initramfs) mkdir -p /run/initramfs /run/netplan; /scripts/local-top/iscsi >/tmp/script.log 2>&1; echo script_rc=$?; cat /run/net-enp2s0.conf
  295. script_rc=0
  296. DEVICE='enp2s0'
  297. PROTO='none'
  298. IPV4PROTO='static'
  299. IPV4ADDR='172.16.1.203'
  300. IPV4BROADCAST=''
  301. IPV4NETMASK='255.255.255.0'
  302. IPV4GATEWAY='172.16.1.1'
  303. IPV4DNS0=''
  304. IPV4DNS1=''
  305. HOSTNAME=''
  306. DNSDOMAIN=''
  307. NISDOMAIN=''
  308. ROOTSERVER=''
  309. ROOTPATH=''
  310. UPTIME='0'
  311. DHCPLEASETIME='0'
  312. DOMAINSEARCH=''
  313.  
  314. (initramfs) . /scripts/functions; netinfo_to_netplan /run/netplan /run/net-enp2s0.conf; echo netplan_rc=$?; cat /run/netplan/enp2s0.yaml
  315. netplan_rc=0
  316. network:
  317. version: 2
  318. ethernets:
  319. enp2s0:
  320. addresses:
  321. - "172.16.1.203/24"
  322. routes:
  323. - to: default
  324. via: "172.16.1.1"
  325.  
  326. (initramfs) grep -q "^PROTO='none'$" /run/net-enp2s0.conf && grep -q "^IPV4PROTO='static'$" /run/net-enp2s0.conf && grep -q '172.16.1.203/24' /run/netplan/enp2s0.yaml && echo RESULT=PASS || echo RESULT=FAIL
  327. RESULT=PASS
  328.  
  329. (initramfs) chroot /root dpkg-query -W -f='${Package} ${Version} ${Architecture}\n' open-iscsi libopeniscsiusr initramfs-tools linux-generic
  330. initramfs-tools 0.151ubuntu1 all
  331. libopeniscsiusr 2.1.11-3ubuntu3.1 amd64
  332. linux-generic 7.0.0-34.34 amd64
  333. open-iscsi 2.1.11-3ubuntu3.1 amd64
  334.  
Advertisement
Add Comment
Please, Sign In to add comment