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

    Retain multicast sessions?

    Scheduled Pinned Locked Moved
    General
    3
    6
    328
    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.
    • R
      Rivybeast
      last edited by

      Is it possible to create a multicast session that remains and is always available?

      As it is, the session goes away once complete and I need to create a new one on the server in order to image a new batch of computers. It would be amazing if once the session completes successfully it would simply reset and become available again for a fresh batch of computers without touching the server again.

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @Rivybeast
        last edited by

        @rivybeast There is no way currently to do this with FOG. I can see a few reasons why it might be a difficult feature to add.

        The way the multicaster works is that on the fog server the sending service needs to know when to go. There is two ways the sending service does this.

        1. Timeout. When this timeout happens what ever clients that have connected to the sender will receive the image. If a client is late for the party then it missed the train.
        2. Client count. The sender service will wait until X number of clients connect to the sender then it will go.

        The next obstacle is that the multicast session name needs to be changed between each imaging download.

        Now it may be possible to reschedule a multicast job via an API @JJ-Fullmer Do you know off the top of your head if you can schedule a multicast session via the API?

        The idea here is to have a web page or powershell call to the fog server setup the next multicast session.

        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!

        JJ FullmerJ 1 Reply Last reply Reply Quote 0
        • JJ FullmerJ
          JJ Fullmer Testers @george1421
          last edited by

          @george1421 I don’t know off the top of my head sadly. I don’t do much with multicast. But multicastsession is one of the apiobjects. So @Rivybeast you can give my powershell module a try. Once you’ve got it setup (i.e. Install-Module FogApi; Set-FogServerSettings;)

          You could mess with the multicastsession coreobject.
          A quick test I go this

           $test = New-FogObject -type object -coreObject multicastsession
          VERBOSE: Building uri and api call
          VERBOSE: Pulling settings from settings file
          VERBOSE: Pulling settings from settings file
          VERBOSE: Building Headers...
          VERBOSE: Building api call URI...
          VERBOSE: removing body from call as it is null
          VERBOSE: POSTing  to/from http://fog-server/fog/multicastsession/create
          VERBOSE: POST http://fog-server/fog/multicastsession/create with 0-byte payload
          VERBOSE: received -1-byte response of content type application/json
          VERBOSE: finished api call
          C:\Users\jfullmer\git\admin_scripts [master ≡ +1 ~3 -0 !]> $test
          
          
          id             : 4
          name           :
          port           : 0
          logpath        :
          image          : @{imageTypeID=; imagePartitionTypeID=; id=; name=; description=; path=; createdTime=; createdBy=;
                           building=; size=; osID=; deployed=; format=; magnet=; protected=; compress=; isEnabled=;
                           toReplicate=; srvsize=; os=; imagepartitiontype=; imagetype=}
          clients        : 0
          sessclients    : 0
          interface      :
          starttime      : 0000-00-00 00:00:00
          percent        : 0
          stateID        : 0
          completetime   : 0000-00-00 00:00:00
          isDD           : 0
          storagegroupID : 0
          anon3          :
          anon4          :
          anon5          :
          state          : @{id=; name=; description=; order=; icon=}
          imageID        :
          

          Which may give you some more ideas. The output at the end may be some of what you might be able to specify in the json data of a post call (New-FogObject). @Tom-Elliott May be able to help more as far as what data is needed to create a multicast session in the api.

          Based on these quick tests though I’d say there’s some high hopes.

          Have you tried the FogApi powershell module? It's pretty cool IMHO
          https://github.com/darksidemilk/FogApi
          https://fogapi.readthedocs.io/en/latest/
          https://www.powershellgallery.com/packages/FogApi
          https://forums.fogproject.org/topic/12026/powershell-api-module

          george1421G 1 Reply Last reply Reply Quote 1
          • george1421G
            george1421 Moderator @JJ Fullmer
            last edited by

            @jj-fullmer Thank you for providing your skills to this thread.

            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!

            JJ FullmerJ 1 Reply Last reply Reply Quote 0
            • JJ FullmerJ
              JJ Fullmer Testers @george1421
              last edited by

              @george1421 @Rivybeast
              Just some guesses (can’t really test any of this cause I’m working from home today)
              but I would think you can make a session with that command I shared plus some json data. Probably need a name and an imageid in the jsondata (maybe you also need interface?), so something like

              $mcSessionData = @{
                  name = "sessionName";
                  imageId = '27'
              }
              $data = $mcSessionData | ConvertTo-Json;
              $mcSession = New-FogObject -type object -coreObject multicastsession -jsonData $data;
              #now you have the details of the multicast session in an object/variable and you can add hosts to it via multicastsessionassociation
              

              I would suggest creating a session the way you normally do, and do a Get-FogObject -type object -coreObject multicastSession to see what fields are filled and how in the one you make yourself. And then once you have hosts assigned to the session do a Get-FogObject -type object -coreObject multicastSessionAssociation to see what the association object looks like.

              If you do that and post the output here I can help a lot more with creating everything. There may also be need to use the -type objectTaskType multicastsession api path. I just don’t use multicast sessions often so I don’t know the structure off the top of my head.

              But typically the way things work in fog is you have an object like multicastsession and then the multicastsessionassociation object has the id of the session and the id of a linked object like a host. But it might be a linked object of a multicast task. Once all that is known (and somebody in this forum probably already knows it) then I can help you make a script for creating sessions and adding hosts to it (maybe I’ll make some helper functions and add them to the module). You could theoretically make a script that runs on a schedule or trigger that checks if the multicast session ended and makes a new one.

              Have you tried the FogApi powershell module? It's pretty cool IMHO
              https://github.com/darksidemilk/FogApi
              https://fogapi.readthedocs.io/en/latest/
              https://www.powershellgallery.com/packages/FogApi
              https://forums.fogproject.org/topic/12026/powershell-api-module

              1 Reply Last reply Reply Quote 0
              • R
                Rivybeast
                last edited by

                It’s been a few days and I just wanted to thank everyone for the replies. I am giving the scripting a whack and will report back if I make some progress with it.

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

                229

                Online

                12.0k

                Users

                17.3k

                Topics

                155.2k

                Posts
                Copyright © 2012-2024 FOG Project