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

Alpine 3.21 image possible context issue #6938

Open
3 tasks
FlorianHeigl opened this issue Feb 22, 2025 · 0 comments
Open
3 tasks

Alpine 3.21 image possible context issue #6938

FlorianHeigl opened this issue Feb 22, 2025 · 0 comments

Comments

@FlorianHeigl
Copy link
Contributor

FlorianHeigl commented Feb 22, 2025

Description
I think there's something wrong with the context scripts in the 3.21 Alpine image. I have it attached to a mac based vnet and after boot, I don't get a eth0 interface, it's just not enabled
The Image does have some calls to one-contextd which isn't installed (no rubies as far as I could see)

To Reproduce

launch the marketplace VM, and maybe attach to a mac net (have not tested other config). I think you would not get a working eth0 out of the box. Usually since you'll have no networking that also makes most other things fail.

Expected behavior

eth0 should call out and obtain an IP address

Details

Affected component Marketplace image (see below)

Additional context

I put something along these lines in my context script to automatically fix things on boot. it was an odd day and so I spent the time on a state machine to fix the image instead of just fixing it or rebuilding it or something. idk. at least it might help you pin down the issue.

reinstall_opennebula(){
    find /etc/one-context.d -type f -exec rm {} + 2>/dev/null
    # existiert nur in alten versionen
    find /etc/init.d/one-context* -type f -exec rm {} + 2>/dev/null
    apk del one-context
    apk add one-context  || return 102
    rc-update add vmcontext boot

    # need to reboot at that point
    sync; sleep 6; reboot
}

test_opennebula()
{
    #Test for bad things, 
    # 1. old versions were bad, this one is known good
    # 2. should only contain links
    # 3. should not hold the old scripts
    apk version one-context |  grep -q "one-context-0.9.0-r0"   || reinstall_opennebula
    [ "$( find /etc/one-context.d -type f | wc -l )" -eq 0 ]    || reinstall_opennebula
    [ "$( find /etc/init.d/one-context* -type f 2>/dev/null | wc -l )" -eq 0 ]  || reinstall_opennebula
    
    return 100
}

[....a few hours of stuff.....]
decide(){
    retry_count=2
    #mache den test
    ${1} "${2:-}" ; RC=$?
    case ${RC} in
      #wenn er 102 ist, brich ab
      102)
         echo "fatal error in ${1}"
         exit 1
      ;;
      #wenn er 101 ist, mach ihn wieder
      101) 
        while [ $retry_count -gt 0 ]; do
          retry_count=$(( retry_count - 1 ))
          # hier wurden die return codes nicht gelesen, reicht das so?
          ${1} "${2:-}" && break
        done
        # sollte das ein exit sein?
        return 1
        ;;
      #wenn er 100 ist, geh weiter
      100) 
        return 0;;
    esac
}


main(){
    decide test_network #  temporarliy brings up eth0
    decide test_pkgs udev #  matters for vmcontext
    decide test_pkgs sudo  # alpine specific, matters for me
    decide test_opennebula
}

main

the above should work even with some redactions I made. In case I'm right and anyone else runs into the problem.

image is this one

Attributes
--
DESCRIPTION | Alpine Linux 3.21 image for KVM, LXD and vCenter |  
IMPORT_ID | 9ea07f80-beb8-013d-a75b-7875a4a4f528 |  
LINK | https://marketplace.opennebula.io/appliance/9ea07f80-beb8-013d-a75b-7875a4a4f528 |  
PUBLISHER | OpenNebula Systems |  
TAGS | alpine |  
VERSION | 6.10.0-3-21250127

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants