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

    Can't create working api request for multicast sessions

    Scheduled Pinned Locked Moved
    FOG Problems
    2
    6
    353
    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.
    • M
      mn_19105
      last edited by

      Hello there,

      I’m currently working on a dashboard for quickly making multicast sessions.
      But i can’t figure out how it exactly works.
      Currently i’m using there parameters:

       {
                  "name": "test",
                  "port": "57364",
                  "clients": "-2",
                  "sessclients": "2",
                  "interface": "eth0",
                  "isDD": "1",
                  "state": "3",
                  "image": "3"
       }
      

      I’ve also tried including the starttime paramenter but without any luck.
      The session will open but the clients won’t start copying the data to the disk.
      Image 3 is a image that includes a working windows 10 install.
      Also tried a reboot of the whole server but without any luck.

      I’ve been fiddling around with this for the past couple of days but i still have not found a solution.
      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by Sebastian Roth

        @mn_19105 There are different ways of creating a musticast task in the web UI and so there is via the API as well. If you have all the hosts registered and a group defined

        curl --silent -k -H 'content-type: application/json' -H 'fog-user-token: ...' -H 'fog-api-token: ...' -X POST -d '{ "taskTypeID": 8, "name": "Group Multicast via API" }' http://x.x.x.x/fog/group/#/task
        

        Make sure you put in the correct server IP instead of x.x.x.x and the group ID for #.

        Well from what you wrote I imagine you want to create a named multicast session for unregistered clients. Worked for me using this call:

        ... -X POST -d '{ "name":"test", "port": 52600, "image": 3, "stateID": 0, "logpath": "name-of-your-image", "clients": -2, "sessclients": 15, "interface": "eth0", "isDD": 1, "storagegroupID": 1 }' http://x.x.x.x/fog/multicastsession/create
        

        If this is not working for you I can imagine old udp-sender processes to cause trouble. Cancel that task, reboot the server (or kill all udp-sender processes on the command line) and try again.

        In case you want to cancel such a task via API call use:

        ... -X GET http://x.x.x.x/fog/multicastsession/current
        ... -X DELETE http://x.x.x.x/fog/multicastsession/#/cancel
        

        While # is the session ID retrieved via the GET call.

        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
        • M
          mn_19105
          last edited by

          Thank you for the response i’ll try it on monday.

          After reading your json body i still have some small questions.
          Does the Logpath refer to the image location?:
          6e216ab3-c76a-46e2-a3d0-278129160912-image.png
          Or is it just a parameter where you can set a location for a log file?

          And why is clients “-2”
          Is that the parameter for the delay?

          And where does isDD refer to
          Just want to get a bit more used to some parameters since the API documentation is very basic at the moment

          Thanks in advanced.

          Maurice

          BTW if you or someone else is interested in the webpanel i’m happy to share it on github.com.
          Just lemme know

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @mn_19105 Answering your questions I will have to refer to the code mostly. I can’t simply explain why things are this way because most of that code is years old and was created before I started to help on FOG.

            Does the Logpath refer to the image location?

            Yes, it’s the name of the folder in the filesystem, e.g. “myimage” if it’s stored in /images/myimage. This name was choosen when someone came up with the first set of database tables a very long time ago. No one ever thought about changing it.

            And why is clients “-2”
            Is that the parameter for the delay?

            There are two types of multicast sessions. One is the so called un-named session created via a group definition - the number of clients is predefined and registered clients are tasked to join the session when PXE booted automatically. The other one is called a named session where you set a name and join clients via the PXE boot menu using that name. In the later case the clients parameter is being misused as a marker for this being a named session. When the MulticastSession object is created within the code it checks for -2 and sets it to 1 to make this a named session.

            And where does isDD refer to

            This parameter in a MulticastSession object was named isDD in the database structure a long time ago and was never changed since then. Within the FOG web UI it’s currently named “Image Type”. It’s important to send so that the MulticastManager can build the proper command line to start udp-sender processes (code ref).

            Just want to get a bit more used to some parameters since the API documentation is very basic at the moment

            Definitely a good point. Documentation in general is not complete. A lot of knowledge is spread across the old dated wiki, forum posts and so on. We would like to transfer all this to a proper documentation. It’s a good start but still not finished. If you have a little spare time you could look into documenting the API properly. What do you think?

            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
            • M
              mn_19105
              last edited by

              First of all thanks for the clarification

              @sebastian-roth said in Can't create working api request for multicast sessions:

              Definitely a good point. Documentation in general is not complete. A lot of knowledge is spread across the old dated wiki, forum posts and so on. We would like to transfer all this to a proper documentation. It’s a good start but still not finished. If you have a little spare time you could look into documenting the API properly. What do you think?

              At the moment i have a bit of spair time.
              Before starting with creating the panel in made all my requests in postman.

              2b619272-38ac-4ef1-b9a5-576b1becdfbd-image.png

              So if you want i can write a wiki with a bit of examples and clarification about the API.
              Please let me know where i can apply 😉

              1 Reply Last reply Reply Quote 0
              • S
                Sebastian Roth Moderator
                last edited by

                @mn_19105 said in Can't create working api request for multicast sessions:

                So if you want i can write a wiki with a bit of examples and clarification about the API.

                Great! The documentation is managed on github. Syntax is pretty simple. Please let me know your github username (e.g. via a private message here in the forums) so I can arrange access for you to push to that repo.

                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
                • 1 / 1
                • First post
                  Last post

                206

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project