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

fix: skip adding dummy route if a default one exists (backport #998) #1003

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Mar 5, 2025

Problem:

When installing Harvester with the install-binary-only mode, and the artifacts (including the ISO image, kernel, initrd, and rootfs) are provided through network, the installation fails in an early stage with an error message exit status 2 on the installer dashboard.

Solution:

Adding a dummy default route to an already well-configured node causes the issue. A default route cannot be added if one already exists. Adding a simple default route checker to fix the issue.

Related Issue:

harvester/harvester#7732

Test plan:

  1. Build a Harvester ISO image with this PR included (for QAs, please use the master-head image after the PR is merged)
  2. Set up a suitable environment (courtesy to @irishgordo for below steps, with some adaptation)
    • For devs, please put the built artifacts under the /tmp directory and then run the following script
    • For QAs, please run the following script directly
#! /usr/bin/bash

version=master

if ! test -f /tmp/harvester-${version}-amd64.iso; then
  echo "gonna snag the file amd64 and toss in temp /tmp/"
  wget https://releases.rancher.com/harvester/${version}/harvester-${version}-amd64.iso
fi

if ! test -f /tmp/harvester-${version}-vmlinuz-amd64; then
  echo "gonna also snag the kernel and toss in temp /tmp/"
  wget https://releases.rancher.com/harvester/${version}/harvester-${version}-vmlinuz-amd64
fi

if ! test -f /tmp/harvester-${version}-initrd-amd64; then 
  echo "gonna also snag the initrd and toss in temp /tmp/"
  wget https://releases.rancher.com/harvester/${version}/harvester-${version}-initrd-amd64
fi

if ! test -f /tmp/harvester-${version}-rootfs-amd64.squashfs; then
  echo "gonna also snag the squashfs and toss in temp /tmp/"
  wget https://releases.rancher.com/harvester/${version}/harvester-${version}-rootfs-amd64.squashfs
fi

if ! test -f /tmp/harvester-${version}.img; then
  echo "gonna hop over to tmp and build a qcow2 file"
  qemu-img create -f qcow2 /tmp/harvester-${version}.img 300G
fi

if ! test -f /tmp/other-harvester.img; then
  echo "also gonna build a secondary disk qcow2 file"
  qemu-img create -f qcow2 /tmp/other-harvester.img 20G
fi

read -p "Enter your localhost ip address: " localhostipaddr

read -p "Enter the desired temp python3 http server port: " py3tempsrvport

echo "gonna spin up python3 server remember to grep for http.server and kill this later"
cd /tmp && nohup python3 -m http.server $py3tempsrvport > server.log 2>&1 &

echo "gonna go ahead and do a virt-install with all params for repro"

virt-install \
  --name repro-7732 \
  --network default,mac=02:ca:fe:f0:0d:01,model=virtio \
  --network default,mac=02:00:00:e1:c5:a5,model=virtio \
  --network default,mac=02:00:00:8a:1e:0f,model=virtio \
  --network default,mac=02:00:00:7b:de:0a,model=virtio \
  --network default,mac=02:00:00:31:c2:93,model=e1000e \
  --network default,mac=02:00:00:01:fc:19,model=e1000e \
  --os-variant linux2022 \
  --cdrom /tmp/harvester-${version}-amd64.iso \
  --vcpus 8 \
  --ram 16548 \
  --disk /tmp/harvester-${version}.img \
  --disk /tmp/other-harvester.img \
  --boot kernel=/tmp/harvester-${version}-vmlinuz-amd64,initrd=/tmp/harvester-${version}-initrd-amd64,kernel_args="ip=dhcp net.ifnames=1 console=ttyS0 console=tty1 rd.cos.disable harvester.install.iso_url=http://${localhostipaddr}:${py3tempsrvport}/harvester-${version}-amd64.iso root=live:http://${localhostipaddr}:${py3tempsrvport}/harvester-${version}-rootfs-amd64.squashfs rd.noverifyssl harvester.install.automatic=false harvester.install.wipe_disks=true"
  1. Choose the "Install Harvester binaries only" mode, and then proceed with the remaining installation steps
  2. The installation should complete without errors
    This is an automatic backport of pull request fix: skip adding dummy route if a default one exists #998 done by Mergify.

Signed-off-by: Zespre Chang <[email protected]>
(cherry picked from commit 35b511c)
@mergify mergify bot merged commit 0ba6124 into v1.3 Mar 5, 2025
7 checks passed
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.

3 participants