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

    Script control of fog

    Scheduled Pinned Locked Moved
    General
    3
    5
    1.8k
    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.
    • A
      Alex B
      last edited by

      Hello I am sorry if this has been answered before I could not find an answer.

      I am currently working with Fog version .32 on ubuntu 13.10
      I would like to know if it is possible to control what image is associated to a computer by a script.
      Ideal situation would be run a script that sets a registered computer to selected OS and selected image then create a task to deploy the image to that computer.

      I am looking to do it this way because I am being asked for a solution that would allow us to image a computer with multiple operating systems both windows and linux. I know it is possible to do this in the Gui however I would like to be able to do these changes with a script so I can have one script that installs windows 7 to the machine with one click and another that would install Fedora 19 on that same machine and so on.

      1 Reply Last reply Reply Quote 0
      • Tom ElliottT
        Tom Elliott
        last edited by

        Maybe QUICK_REG_AUTOPOPP might work better for you?

        You’d have to remove the registered hosts you want this perform the trick on, then perform quick registration. You set the OSID on the same place you enable QUICK_REG_AUTOPOP. Then the hosts will be registred per your AUTOREGSYSNAME and Image ID, and then will reimage accordingly.

        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

        1 Reply Last reply Reply Quote 0
        • A
          Alex B
          last edited by

          Hello Tom,

          Thank you for your quick response.

          From what I understand the quick registration will image the computer with a chosen image and register it. Then if I wanted to change the image I would need to unregister the computer and change the image associated with the quick registration or do it from the web interface. From what I can tell this would not help in my situation.

          I will explain my situation in full. We will have a rack with 4 machines that we will use for testing. These four machines need to be able to run windows xp and up. They will also need to be able to run several versions of linux. Raw images are acceptable if needed.
          This test rack will also have an optical switch connected to pci cards and managed power strip. I hope to be able to have it setup at some point where I could run a script that would turn on a machine and install a selected operating system and then also set the optical switch to connect a pci card to that computer. The script would then install selected software onto the machine and then run the software.

          I know Fog does not support snap-ins for linux we can work on are own solution to remotely install the software.

          The part with fog is being able to tell fog what computer needs to be imaged and what image to use. using some sort of command and not the web interface. I am not at the point where I need to start testing this capability however my manager would like to know if this is possible and if it might need some extra work in order to make it work for us.

          1 Reply Last reply Reply Quote 0
          • C
            chad-bisd Moderator
            last edited by

            You just need to fake it. Run a mysql script that updates the hostOS and hostImage values, create the pxe file for the host and create the task record in the database. Then call the wol.php file from the command line with the mac address of the host you want to wake up.

            To get you started, associate the host with one image and OS, create a deploy task with the machine off/unplugged. Then inspect the /tftpboot/01-[mac-address] file for the options. Then query mysql tasks table for the values you’ll need there.


            If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

            1 Reply Last reply Reply Quote 0
            • A
              Alex B
              last edited by

              Thank you chad.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post

              183

              Online

              12.1k

              Users

              17.3k

              Topics

              155.3k

              Posts
              Copyright © 2012-2024 FOG Project