<div dir="auto"><pre style="white-space:pre-wrap;word-wrap:break-word;font-family:sans-serif;margin-top:0px;font-size:medium">After a bit more testing I can answer my original question: I was just<br>too impatient. When the ResumeProgram comes back with an exit code != 0<br>SLURM doesn't taint the node, i.e., it tries to start it again after a<br>while. Exactly what I want! :-)<br><br>@Lachlan Musicman: My slurm.conf Node and Partition section looks like<br>this (if I want to have a maximum cluster size of 10 instances):<br><br><br>ResumeProgram=<myprog><br>NodeName=compute-[1-10] CPUs=<whatever> <...> State=CLOUD<br>PartitionName=compute Nodes=compute-[1-10] <...> State=UP<br><br><myprog> is called by SLURM when it wants to spin up one of the<br>instances. In this script I create an instance from an instance<br>template, which is pre-configured to mount the SLURM installation from<br>the master node, which contains also the slurm.conf file, i.e., the<br>slurm.conf file the new node sees is the one from the master. This way<br>all instances are consistent. Although, I could probably set the<br>hostname of the new node to the NodeName (compute-<x>) and create a DNS<br>record for the subnet to which the new node is deployed, such that the<br>hostname gets correctly resolved, I use the following simpler approach:<br><br>When the instance starts up, it gets an arbitrary name from DHCP. It's<br>easy to get this name in <myprog>. Once I have this, I only need to map<br>it to the NodeName with the following command (also in <myprog>):<br><br>scontrol update NodeName=compute-<x> NodeHostName=<hostname><br>NodeAddr=<hostname><br><br>where <hostname> is the hostname assigned by DHCP. This way, the node<br>registers itself correctly. I assign a tag to the instance which<br>contains the NodeName, such that I can find it easily when SLURM calls<br>the SuspendProgram to terminate the node. </pre></div><br><div class="gmail_quote"><div dir="ltr">Lachlan Musicman <<a href="mailto:datakid@gmail.com">datakid@gmail.com</a>> schrieb am So., 29. Juli 2018, 04:02:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">On 29 July 2018 at 04:32, Felix Wolfheimer <span dir="ltr"><<a href="mailto:f.wolfheimer@googlemail.com" target="_blank" rel="noreferrer">f.wolfheimer@googlemail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'm experimenting with <span id="m_-7328594213273846236m_-7306597689671615005:ul.1">SLURM</span> Elastic Compute on a cloud platform. I'm facing the following situation: Let's say, <span id="m_-7328594213273846236m_-7306597689671615005:ul.3">SLURM</span> requests that a compute instance is started. The <span id="m_-7328594213273846236m_-7306597689671615005:ul.4">ResumeProgram</span> tries to create the instance, but doesn't succeed because the cloud provider can't provide the instance type at this point in time (happens for example if a <span id="m_-7328594213273846236m_-7306597689671615005:ul.6">GPU</span> instance is requested, but the <span id="m_-7328594213273846236m_-7306597689671615005:ul.7">datacenter</span> simply doesn't have the capacity to provide this instance). <div><span id="m_-7328594213273846236m_-7306597689671615005:ul.8">SLURM</span> will mark the instance as "DOWN" and will not try again to request it. For this scenario this behavior is not optimal. Instead of marking the node DOWN and not trying to request it again after some time, I'd like that <span id="m_-7328594213273846236m_-7306597689671615005:ul.9">slurmctld</span> just forgets about the failure and tries again to start the node. Is there any knob which can be used to achieve this behavior? Optimally, the behavior might be triggered by the return code of the ResumeProgram, e.g., </div><div><br></div><div>return code=0 - Node is starting up</div><div>return code=1 - A permanent error has occurred, don't try again</div><div>return code=2 - A temporary failure has occurred. Try again later.</div><div><br></div></div>
</blockquote><div><br></div><div><br></div><div>I don't have an answer to your question - but I would like to know how you manage injecting the hostname and/or IP address into slurm.conf and then distribute it in this situation? <br></div><div><br></div><div>I have read the documentation, but it doesn't indicate a best practice in this scenario iirc.<br></div><div><br></div><div>Is it as simple as doing those steps - wait for boot, grab hostname, inject into slurm.conf, distribute slurm.conf to nodes, restart slurm?</div><div><br></div><div>Cheers</div><div>L.<br></div></div></div></div>
</blockquote></div>