How can I read in hook aoe parameter value provided by user during the submitting job to pbs queue

Hi @ll,

I would like to validate by hook “aoe” parameter when user is trying to submitt a job to pbs queue. To do this I need to read this parameter from queued job.

For example user executed command:
qsub -I -l select=2:ncpus=272:aoe=centos-7.3 -l walltime=01:00:00

So I think that the way to read this “centos-7.3” value I need to use following code into hook script:
aoe = pbs.event().job.Resource_List[“aoe”]

but, as I can see always “None” value is returned.

Someone can help me to find a way to read this parameter by hook?

Hook info:
"Qmgr: list hook ValidateAOEparameter"
Hook ValidateAOEparameter
type = site
enabled = true
event = queuejob
user = pbsadmin
alarm = 30
order = 1
debug = false
fail_action = none

Hello Witold. I am also working on a provisioning hook, so it would be
great to keep in touch.
this works for me in a hook:

e = pbs.event() # this is out PBS event object
vnode = e.vnode # this is the nodename as PBS sees it
aoe = e.aoe # this is the name if the image (or software) as PBS sees
it

I don’t think you read the aoe from the job’s resource list - it is a
property of the pbs event

Oh, and this one is straight from the manual. Make sure your hook type is
set to ‘provisioning’

qmgr -c “set hook my_provision_hook event = provision”

The aoe attribute is part of the select statement, so you will need to examine the pbs.event().job.Resource_List[“select”]

You can find an example of this in the PBS Professional 14.2.1 Administrator Guide, Section 6.10.1.1 Preventing Provisioning

1 Like

Witold, I apologise. You have a site hook here, to check if the user is
asking for an aoe.

No issue John, thank you for your engagement. I appologize for long response time, but I was on a short holidays.

Many thanks Scott ! This is exactely what I was looking for.