[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Drain HTCondor worker by setting instance metadata value



On 9/3/2017 12:36 PM, Sveinung Rundhovde wrote:
Hi,

I am setting up a system with a HTCondor pool running on OpenStack. I am trying to create a mechanism that enables draining workers by setting a value in their metadata to true (data made available to the VM via a URL). It should also be possible to make them start accepting jobs again by resetting this value.

So far I have come up with a couple of solutions that work, but not as well as I would like.

The first is to use job hooks....
[snip]
Is there a better way to do this?


Instead of twiddling with START expressions, you may find it easier to have a script simply invoke the condor_drain command-line tool, aka
   condor_drain <machine-name>
to start a node draining, and then to cancel the draining activity and start accepting jobs again, do
   condor_drain -cancel <machine-name>

See
  http://research.cs.wisc.edu/htcondor/manual/current/condor_drain.html

Your script to invoke condor_drain could be centralized (i.e. run on the central manager), or distributed.

Also the same functionality is available via the HTCondor Python APIs, specifically methods drainJobs() and cancelDrainJobs() in the Startd class.

regards,
Todd