• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

DHCP problems on storage nodes

Scheduled Pinned Locked Moved Solved
FOG Problems
4
62
15.4k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G
    Greg Plamondon Testers @george1421
    last edited by Jan 17, 2018, 2:17 PM

    @george1421
    I ran the command you requested on the TEST client PC.
    alt text

    I didn’t get any out from the command I rand…
    I was able to ping the fogserver.

    There are parts of the web interface that take a VERY long time to load and those are the “Storage” and “Fog Configuration” pages. The fogserver dashboard is very responsive.

    G 2 Replies Last reply Jan 17, 2018, 2:25 PM Reply Quote 0
    • G
      george1421 Moderator @Greg Plamondon
      last edited by Jan 17, 2018, 2:25 PM

      @greg-plamondon This vm is at one of the remote locations?

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      G 1 Reply Last reply Jan 17, 2018, 2:28 PM Reply Quote 0
      • G
        Greg Plamondon Testers @Wayne Workman
        last edited by Jan 17, 2018, 2:26 PM

        @wayne-workman

        Yes as far as I can tell.

        1 Reply Last reply Reply Quote 0
        • G
          george1421 Moderator @Greg Plamondon
          last edited by george1421 Jan 17, 2018, 8:28 AM Jan 17, 2018, 2:27 PM

          @greg-plamondon As for the output of the curl command we probably want to remove the “fso /dev/null” from the command so it prints out the results on the screen. The script uses the error level generated by curl to know success or fail.

          Make the command now curl -Ik http://192.168.10.238/fog/index.php --connect-timeout 5

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          G 1 Reply Last reply Jan 17, 2018, 2:30 PM Reply Quote 0
          • G
            Greg Plamondon Testers @george1421
            last edited by Jan 17, 2018, 2:28 PM

            @george1421

            yes,

            alt text

            1 Reply Last reply Reply Quote 0
            • G
              Greg Plamondon Testers @george1421
              last edited by Jan 17, 2018, 2:30 PM

              @george1421
              alt text

              G 1 Reply Last reply Jan 17, 2018, 2:31 PM Reply Quote 0
              • G
                george1421 Moderator @Greg Plamondon
                last edited by george1421 Jan 17, 2018, 8:31 AM Jan 17, 2018, 2:31 PM

                @greg-plamondon you want to change the option switches as in the command I posted. That error threw me for a second.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                G 1 Reply Last reply Jan 17, 2018, 2:32 PM Reply Quote 0
                • G
                  Greg Plamondon Testers @george1421
                  last edited by Jan 17, 2018, 2:32 PM

                  @george1421
                  alt text

                  G 2 Replies Last reply Jan 17, 2018, 2:38 PM Reply Quote 0
                  • G
                    george1421 Moderator @Greg Plamondon
                    last edited by Jan 17, 2018, 2:38 PM

                    @greg-plamondon OK, that isn’t exactly what I expected. I expected a 200 code, not 302 returned (may show my ignorance). The 302 code means success but redirect which is what is happening in FOG.

                    I just tried this on my fog server running 1.4.4 and I got the same 302 return code. So yours is normal. That doesn’t explain why the target computer can’t access the fog server during startup.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                    1 Reply Last reply Reply Quote 0
                    • G
                      george1421 Moderator @Greg Plamondon
                      last edited by george1421 Jan 17, 2018, 8:45 AM Jan 17, 2018, 2:43 PM

                      @greg-plamondon Well I think we need to get better debugging information into the inits to see exactly what is going wrong.

                      There is a wiki page that explains how to unpack the inits. Copy the init.xz (virtual hard drive) from /var/www/html/fog/service/ipxe to /tmp on your fog server then follow the instructions in the wiki: https://wiki.fogproject.org/wiki/index.php?title=Modifying_the_Init_Image

                      cp /var/www/html/fog/service/ipxe/init.xz /tmp
                      cd /tmp
                      xz -d init.xz
                      mkdir initmountdir
                      mount -o loop init initmountdir
                      

                      Then change into /tmp/initmountdir/etc/init.d

                      I’m going to work on updating S40Network to add more info so we know what its doing (wrong).

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                      1 Reply Last reply Reply Quote 0
                      • G
                        george1421 Moderator
                        last edited by george1421 Jan 17, 2018, 11:32 AM Jan 17, 2018, 3:03 PM

                        This is the updated S40network file.

                        #!/bin/bash
                        #
                        # Start the network....
                        #
                        if [[ -n $has_usb_nic ]]; then
                            echo "Please unplug your device and replug it into the usb port"
                            echo -n "Please press enter key to connect [Enter]"
                            read -p "$*"
                            echo "Sleeping for 5 seconds to allow USB to sync back with system"
                            sleep 5
                        fi
                        # Enable loopback interface
                        echo -e "auto lo\niface lo inet loopback\n\n" > /etc/network/interfaces
                        /sbin/ip addr add 127.0.0.1/8 dev lo
                        /sbin/ip link set lo up
                        
                        sleep 10
                        
                        # Generated a sorted list with primary interfaces first
                        read p_ifaces <<< $(/sbin/ip -0 -o addr show | awk -F'[: ]+' 'tolower($0) ~ /link[/]?ether/ && tolower($0) ~ /'$mac'/ {print $2}' | tr '\n' ' ')
                        read o_ifaces <<< $(/sbin/ip -0 -o addr show | awk -F'[: ]+' 'tolower($0) ~ /link[/]?ether/ && tolower($0) !~ /'$mac'/ {print $2}' | tr '\n' ' ')
                        ifaces="$p_ifaces $o_ifaces"
                        for iface in $ifaces; do
                            echo "Starting $iface interface and waiting for the link to come up"
                            echo -e "auto $iface\niface $iface inet dhcp\n\n" >> /etc/network/interfaces
                            /sbin/ip link set $iface up
                        
                            # Wait till the interface is fully up and ready (spanning tree)
                            timeout=0
                            linkstate=0
                            until [[ $linkstate -eq 1 || $timeout -ge 35 ]]; do
                                let timeout+=1
                                linkstate=$(/bin/cat /sys/class/net/$iface/carrier)
                                [[ $linkstate -eq 0 ]] && sleep 1 || break
                            done
                            [[ $linkstate -eq 0 ]] && echo "No link detected on $iface for $timeout seconds, skipping it." && continue
                            for retry in $(seq 3); do
                        		echo "## Bringing up interface $iface ##"
                        		/sbin/udhcpc -i $iface --now
                                ustat="$?"
                        		echo "## Calling the fog server ${web}/index.php ##"
                                curl -Ikfso /dev/null "${web}"/index.php --connect-timeout 5
                                cstat="$?"
                                # If the udhcp is okay AND we can curl our web
                                # we know we have link so no need to continue on.
                                # NOTE: the link to web is kind of important, just
                                # exiting on dhcp request is not sufficient.
                        		
                        		if [[ $ustat -eq 0 && $cstat -eq 0 ]]; then
                        			echo "## We have an IP address on $iface and the Master FOG server responded to our query ##"
                        		fi 
                                [[ $ustat -eq 0 && $cstat -eq 0 ]] && exit 0
                        
                        		if [[ $ustat -eq 1 ]]; then
                        			echo "## DHCP failed on $iface ##"
                        		fi
                        		if [[ $cstat -eq 1 ]]; then
                        			echo "## The Master FOG server failed responded to our query ##"
                        		fi
                        		echo "Either DHCP failed or we were unable to access ${web}/index.php for connection testing."
                                sleep 1
                            done
                            echo "No DHCP response on interface $iface, skipping it."
                        done
                        
                        # If we end up here something went wrong as we do exit the script as soon as we get an IP!
                        if [[ -z $ifaces ]]; then
                            echo "No network interfaces found, your kernel is most probably missing the correct driver!"
                        else
                            echo "Failed to get an IP via DHCP! Tried on interfaces(s): $ifaces"
                        fi
                        echo "Please check your network setup and try again!"
                        [[ -z $isdebug ]] && sleep 60 && reboot
                        echo "Press enter to continue"
                        read
                        exit 1
                        

                        My comments have a double pound on both sides. Once you update the S40network file then you need to repack the inits and then move to your storage node at this test location. Understand this is only a test init so that we can find out what is going on. You will want to keep your untouched init file after the debugging is over.


                        My intuition is still telling me this could be a spanning tree issue, even though you said you checked that. Your debug FOS system has access so that doesn’t specifically have the same conditions as a physical system. I guess you could always try to image a virtual machine at the remote location and see if it works (even before tweaking the inits). In the case of a VM it will not drop the link on the physical switch because the VM is connected to a vswitch.

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                        G 2 Replies Last reply Jan 17, 2018, 3:33 PM Reply Quote 0
                        • G
                          Greg Plamondon Testers @george1421
                          last edited by Jan 17, 2018, 3:33 PM

                          @george1421

                          ok, I have the S40network modiefied and the init repacked. do I need to run the same command for testing?

                          1 Reply Last reply Reply Quote 0
                          • G
                            Greg Plamondon Testers @george1421
                            last edited by Jan 17, 2018, 3:50 PM

                            @george1421

                            I am getting an error in the S40network file.
                            alt text

                            G 1 Reply Last reply Jan 17, 2018, 4:06 PM Reply Quote 0
                            • G
                              george1421 Moderator @Greg Plamondon
                              last edited by george1421 Jan 17, 2018, 10:17 AM Jan 17, 2018, 4:06 PM

                              @greg-plamondon Whelp, that’s why I’m not a programmer 😉

                              Here is what needs to be fixed, sorry.

                              This is the bad line

                              if [ $ustat -eq 0 && $cstat -eq 0 ]; then
                              

                              This is what it should have been

                              if [[ $ustat -eq 0 && $cstat -eq 0 ]]; then
                              

                              Awe, crud and then the next errors you will find are a few lines down.

                              		if [ $ustat -eq 1 ]; then
                              			echo "## DHCP failed on $iface ##"
                              		fi
                              		if [ $cstat -eq 1 ]; then
                              			echo "## The Master FOG server failed responded to our query ##"
                              		fi
                              

                              need to have the brackets too

                              		if [[ $ustat -eq 1 ]]; then
                              			echo "## DHCP failed on $iface ##"
                              		fi
                              		if [[ $cstat -eq 1 ]]; then
                              			echo "## The Master FOG server failed responded to our query ##"
                              		fi
                              

                              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                              G 3 Replies Last reply Jan 17, 2018, 4:37 PM Reply Quote 1
                              • G
                                Greg Plamondon Testers @george1421
                                last edited by Greg Plamondon Jan 17, 2018, 10:40 AM Jan 17, 2018, 4:37 PM

                                @george1421

                                alt text

                                alt text

                                alt text

                                1 Reply Last reply Reply Quote 0
                                • G
                                  Greg Plamondon Testers @george1421
                                  last edited by Jan 17, 2018, 4:48 PM

                                  @george1421

                                  My question is if the connection is good “## We have an IP address on eth0 and the Master FOG server responded to our query ##” Why does it then disconnect the eth0 interface and attempt to obtain an IP when it already has one that is working?

                                  1 Reply Last reply Reply Quote 0
                                  • G
                                    Greg Plamondon Testers @george1421
                                    last edited by Jan 17, 2018, 4:51 PM

                                    @george1421

                                    now if I issue a: /etc/init.d/S40network restart
                                    I get this:
                                    alt text

                                    G 1 Reply Last reply Jan 17, 2018, 4:57 PM Reply Quote 0
                                    • G
                                      george1421 Moderator @Greg Plamondon
                                      last edited by george1421 Jan 17, 2018, 10:58 AM Jan 17, 2018, 4:57 PM

                                      @greg-plamondon That looks perfect. If you now key in fog you can single step through deployment. Or just cancel the task on the fog server and then pxe boot this again, the vm should image. At least from a networking point everything is golden.

                                      Is there any chance to do this on one of the broken systems?

                                      You will see if there is an error, it will loop through this code 3 times then give up. IN this case it only when through once because it worked.

                                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                      G 2 Replies Last reply Jan 17, 2018, 5:12 PM Reply Quote 0
                                      • G
                                        Greg Plamondon Testers @george1421
                                        last edited by Jan 17, 2018, 5:12 PM

                                        @george1421

                                        hmmm
                                        alt text

                                        1 Reply Last reply Reply Quote 0
                                        • G
                                          Greg Plamondon Testers @george1421
                                          last edited by Greg Plamondon Jan 17, 2018, 11:39 AM Jan 17, 2018, 5:39 PM

                                          @george1421
                                          here is a video:
                                          Youtube FOG

                                          G 1 Reply Last reply Jan 17, 2018, 5:40 PM Reply Quote 0
                                          • 1
                                          • 2
                                          • 3
                                          • 4
                                          • 2 / 4
                                          2 / 4
                                          • First post
                                            38/62
                                            Last post

                                          188

                                          Online

                                          12.0k

                                          Users

                                          17.3k

                                          Topics

                                          155.2k

                                          Posts
                                          Copyright © 2012-2024 FOG Project