Retain multicast sessions?
-
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.
-
@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.- 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.
- 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.
-
@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.
-
@jj-fullmer Thank you for providing your skills to this thread.
-
@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 aGet-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.
-
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.