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

New PXE menu entry: Deploy Image & Shutdown

Scheduled Pinned Locked Moved
Feature Request
5
27
9.0k
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.
  • T
    Tom Elliott
    last edited by May 18, 2017, 2:27 AM

    Mind trying this?

    wget -O /var/www/fog/lib/fog/bootmenu.class.php https://raw.githubusercontent.com/FOGProject/fogproject/working/packages/web/lib/fog/bootmenu.class.php
    

    TLDR; I’m an idiot though it was meant with good intentions, please try above and let me know if it’s better.


    Apparently when I was adding the API, I was trying to ensure the API was stateless and was making adjustments to elements using $_SESSION variables. The boot menu script (what I’m asking you to copy) had a few of them for something I implemented a while ago to address this very problem. Not thinking about it when making adjustments, I removed all the relevant bits and didn’t replace them. My initial thoughts were that there wasn’t anything in the boot menu requiring those SESSION elements. I’ve readded these bits and maintained the “stateless” element of the script. While I did re-add these things, my tests are currently limited to simple browser checks calling out to a rather direct url. As such, a test going into deployimage would be extremely useful from a “full” run.

    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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

    Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

    Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

    A 2 Replies Last reply May 18, 2017, 3:00 AM Reply Quote 0
    • A
      Avaryan @Tom Elliott
      last edited by Avaryan May 17, 2017, 9:12 PM May 18, 2017, 3:00 AM

      @Tom-Elliott I’ll test in the morning (8 hours from now) when I get back to my office. Although I could probably connect to VPN and deploy image into a VM.

      edit: I ran the script and updated the file on my test server. Can’t access a computer on the correct vlan to deploy an image to. Will continue in the morning.

      1 Reply Last reply Reply Quote 0
      • A
        Avaryan @Tom Elliott
        last edited by May 18, 2017, 11:05 AM

        @Tom-Elliott said in New PXE menu entry: Deploy Image & Shutdown:

        https://raw.githubusercontent.com/FOGProject/fogproject/working/packages/web/lib/fog/bootmenu.class.php

        Ok. I’ve done the following.

        root@hs-fog:~# wget -O /var/www/fog/lib/fog/bootmenu.class.php https://raw.githu                                                                                        busercontent.com/FOGProject/fogproject/working/packages/web/lib/fog/bootmenu.cla                                                                                        ss.php
        --2017-05-17 23:03:43--  https://raw.githubusercontent.com/FOGProject/fogproject                                                                                        /working/packages/web/lib/fog/bootmenu.class.php
        Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.124.1                                                                                        33
        Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.124.                                                                                        133|:443... connected.
        HTTP request sent, awaiting response... 200 OK
        Length: 62089 (61K) [text/plain]
        Saving to: ‘/var/www/fog/lib/fog/bootmenu.class.php’
        
        /var/www/fog/lib/fo 100%[===================>]  60.63K  --.-KB/s    in 0.03s
        
        2017-05-17 23:03:44 (1.97 MB/s) - ‘/var/www/fog/lib/fog/bootmenu.class.php’ save                                                                                        d [62089/62089]
        
        root@hs-fog:~# reboot
        

        After reboot I booted to pxe menu with a registered host and deployed an image to it with the modified “Deploy Image” option.

        I then went to this address.
        http://10.20.21.136/fog/service/ipxe/boot.php?mac=<hostmac>

        And got the following results:

        #!ipxe
        set fog-ip 10.20.21.136
        set fog-webroot fog
        set boot-url http://${fog-ip}/${fog-webroot}
        kernel bzImage32 loglevel=4 initrd=init_32.xz root=/dev/ram0 rw ramdisk_size=127000 web=10.20.21.136/fog/ consoleblank=0 rootfstype=ext4 storage=10.20.21.136:/images/ storageip=10.20.21.136 mac=<hostmac> ftp=10.20.21.136 storage=10.20.21.136:/images/ storageip=10.20.21.136 osid=9 irqpoll hostname=<hostname> chkdsk=0 img=Windows10 imgType=n imgPartitionType=all imgid=1 imgFormat=0 PIGZ_COMP=-9 hostearly=1 type=down
        imgfetch init_32.xz
        boot
        

        It’s deploying now. I don’t see the shutdown=1 option in there.

        1 Reply Last reply Reply Quote 0
        • A
          Avaryan
          last edited by May 19, 2017, 1:44 AM

          So, I never did get this to work. I got busy and was unable to reply back while I was at work.

          T 1 Reply Last reply May 19, 2017, 1:48 AM Reply Quote 0
          • T
            Tom Elliott @Avaryan
            last edited by May 19, 2017, 1:48 AM

            @Avaryan I suspect what’s wrong, though I don’t have a good fix coming for it right now :(.

            I have to think of a way to pass in extra args and it’s not always the simplest thing.

            I think an approach to help address this would be:
            Add a new field per each “menu option” that allows you to check “shutdown” or not. This way I can make it pass a variable, theoretically, from one window to the next for that menu item. Just my thoughts though. I don’t have a quick fix quite yet. Sorry 😞

            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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            P 1 Reply Last reply May 20, 2017, 3:20 AM Reply Quote 0
            • A
              Avaryan
              last edited by May 19, 2017, 1:54 AM

              Not a big deal for me. I’m not even the one who requested this, lol.

              1 Reply Last reply Reply Quote 0
              • P
                psyfer9983 @Tom Elliott
                last edited by May 20, 2017, 3:20 AM

                @Tom-Elliott Thank you for trying. That field per each menu option would be great. As for now, we are setting Fog kernel with shutdown=1 when we need to mass deploy machines before sending them out to the sites and then remove the shutdown setting. Its a little hassle, but hey, it works. I’ll keep an eye out on newer releases to see if you manage to get the shutdown field put in.

                1 Reply Last reply Reply Quote 0
                • 1
                • 2
                • 2 / 2
                2 / 2
                • First post
                  25/27
                  Last post

                162

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project