# Reserve resources for a user for particular Job within queue when using Node binding

**URL:** <https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657>\
**Category:** Users/Site Administrators\
**Created:** [June 17, 2019, 5:00am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657 "2019-06-17T05:00:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [June 17, 2019, 5:00am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/1 "2019-06-17T05:00:45Z")

</div>

Hi,  
I am bit new to PBS, Need some help in this.  
I require to reserve some resources within a normal queue by a user to run priority job at some scheduled time. Also we have node binding configuration in pbs, can some one help how to do it, i mean what changes (in job submission/configuration ) required step by step.  
PBS documents says, Advance / standing reservation can be done if nodes are not binded with queues, i.e nodes should not be assigned to any queue.

Thanks  
Varun

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [June 17, 2019, 5:45am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/2 "2019-06-17T05:45:30Z")

</div>

Node to queue mapping is not recommended and is not efficient in terms of resource usage by the end users. It is recommended to configure Qlists instead.

- qlists ( refer : 4.9.2.2.i Procedure to Associate Vnodes with Multiple  
queues [https://www.pbsworks.com/pdfs/PBS18.2\_BigBook.pdf](https://www.pbsworks.com/pdfs/PBS18.2_BigBook.pdf))

You can use reservations ( Advance or Standing) here with Qlist configuration without any issues.

---

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [June 17, 2019, 9:34am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/3 "2019-06-17T09:34:21Z")

</div>

Thanks for the reply.

yes, vnodes have been configured with qlist configuration, also we have some vnodes associated with multiple queues.  
snippet of one of the vnode :

Node node\_970\_0  
Mom = nid00077,nid00845,nid01553,nid01229,nid01997,nid00461,nid00781  
Port = 15002  
pbs\_version = PBSPro\_13.0.409.180551  
ntype = PBS  
state = job-exclusive  
pcpus = 36  
resources\_available.arch = XT  
resources\_available.host = node\_970  
resources\_available.mem = 67108864kb  
resources\_available.ncpus = 36  
resources\_available.nppus = 18  
resources\_available.PBShost = node  
resources\_available.PBSnid = 970  
resources\_available.PBSorder = 920  
resources\_available.PBSseg = 0  
resources\_available.Qlist = queue1,queue2  
resources\_available.vnode = node\_970\_0  
resources\_available.vntype = compute  
resources\_available.vps\_per\_ppu = 2  
resources\_assigned.accelerator\_memory = 0kb  
resources\_assigned.hbmem = 0kb  
resources\_assigned.mem = 0kb  
resources\_assigned.naccelerators = 0  
resources\_assigned.ncpus = 36  
resources\_assigned.netwins = 0  
resources\_assigned.nppus = 0  
resources\_assigned.vmem = 0kb  
resv\_enable = True  
sharing = force\_exclhost  
in\_multivnode\_host = 1  
license = l

Now, How can we use reservations with Qlist ?  
I want to reserve vnodes only from queue1 to assign a job at some specific time.

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [June 17, 2019, 9:52am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/4 "2019-06-17T09:52:13Z")

</div>

Thank you . Please share the output of this command qmgr -c “print queue queue1”

---

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [June 17, 2019, 10:02am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/5 "2019-06-17T10:02:24Z")

</div>

Here is the output:

# Create queues and set their attributes.

# 

# 

# Create and define queue queue1

# 

create queue queue1   
set queue queue1 queue\_type = Execution  
set queue queue1 max\_queued = [o:PBS\_ALL=200]  
set queue queue1 acl\_user\_enable = TRUE  
set queue queue1 acl\_users = varun  
set queue queue1 acl\_users += test\_usr  
set queue queue1 resources\_max.ncpus = 21600  
set queue queue1 resources\_max.nodect = 600  
set queue queue1 resources\_max.walltime = 8:00:00  
set queue queue1 resources\_default.vntype = compute  
set queue queue1 resources\_default.walltime = 8:00:00  
set queue queue1 acl\_group\_enable = TRUE  
set queue queue1 acl\_groups = staff  
set queue queue1 default\_chunk.Qlist = queue1  
set queue queue1 default\_chunk.vntype = compute  
set queue queue1 max\_run\_res.ncpus = [o:PBS\_ALL=21600]  
set queue queue1 enabled = TRUE  
set queue queue1 started = TRUE

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [June 17, 2019, 10:08am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/6 "2019-06-17T10:08:25Z")

</div>

Thank you , please run the below line for advance reservation:

`pbs_rsub -R 201907211520 -E 201908211800 -N PBSRESERVATION -U root,pbsdata,pbsworksuser -l select=2:ncpus=36:Qlist=queue1:vntype=compute -l place=scatter:excl`

---

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [June 18, 2019, 8:42am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/7 "2019-06-18T08:42:25Z")

</div>

Thanks for the reply.

I have tried the above procedure, which successfully created a new reservation queue reserving nodes from queue “queue1”.

Now the thing is, Advance reservation creates a new name queue (ex: R12345) which should be mentioned in job script (PBS -q R12345) while submitting the job.

Moving further…

1. Can we customize “reservation queue-name” (like R12345 --\> My\_Resv\_Q) ?

2. Is there any option to use reserved nodes from reservation queue(R12345) as normal, when no priority job is running.

3. Suppose a job is running in Reserved Time slot in reserved queue, let say JobA running in R12345. If we require to submit a more priority JobB in R12345, what will happen ? how can we acheive JObB to run immediately,if we can afford JObA to hold.

Please suggest the possibilities.

\*\*\*\* Just enjoying playing with PBS & exploring the new possibilities \*\*\*\*

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [June 18, 2019, 10:43am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/8 "2019-06-18T10:43:20Z")

</div>

> [@varun](#):
>
> Can we customize “reservation queue-name” (like R12345 → My\_Resv\_Q) ?

No, the queue name is created dynamically based on reservation confirmation

> [@varun](#):
>
> Is there any option to use reserved nodes from reservation queue(R12345) as normal, when no priority job is running.

Short answer is NO, when the reservation is ACTIVE.

If you see when the reservation is confirmed, the nodes are kind of mapped to the Reservation queue.  
You can check that by running pbsnodes -av | grep -i resv , you will see something like below  
resv = R11257.servername , these are the nodes that belong to respective reservation queue.

The reservation is created to run priority jobs with a walltime . The reservation is created to expect resource available by the workload you would have at that time.

Any jobs can be submitted or queue moved to RESERVATION queue. The reservation nodes are available to all the queues before the RESERVATION start-time. Please note walltime plays a crucial role when using reservation and submitting jobs to other queues before the reservation start time.

> [@varun](#):
>
> Suppose a job is running in Reserved Time slot in reserved queue, let say JobA running in R12345. If we require to submit a more priority JobB in R12345, what will happen ? how can we acheive JObB to run immediately,if we can afford JObA to hold.

The basics of reservation is to reserve compute resources for a specified amount of time (guarantied) for a specific priority workload ( jobs ) .

There might be many ways:

- job\_sort\_formula - with special priority ( this special priority can be bumped up using qalter )
- suspend JobA
- if JobA is queued, you can qhld jobA
- delete JobA

Please check 4.9.21.12 Examples of Using Resource Permissions in Job Sorting  
Formula in the PBS Professional 19.2 Administrator’s Guide. Page: AG-155

Thank you

---

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [June 18, 2019, 11:58am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/9 "2019-06-18T11:58:37Z")

</div>

Many Thanks to you Adarsh, This was really helpful.

Will explore more options from the Admin guide.

Thankyou  
varun

---

<div class="post-metadata">

**Author:** ![dtalcott](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/dtalcott/32/410_2.png) [@dtalcott](https://community.openpbs.org/u/dtalcott)\
**Post date:** [July 11, 2019, 10:40pm UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/10 "2019-07-11T22:40:52Z")

</div>

> [@varun](#):
>
> - Can we customize “reservation queue-name” (like R12345 → My\_Resv\_Q) ?

If you build from source, look at the code bracketed by comments with “localmod 075”. This is a NAS localmod that allows you to assign names to reservations that can then be used when submitting jobs.

Ex.

```
15:33 pbspl1 ~.$ pbs_rsub -N my_name -D 100 -l select=1:model=san -R 010101

R6799955.pbspl1.nas.nasa.gov UNCONFIRMED
15:34 pbspl1 ~.$ pbs_rstat | grep -e Resv -e my_name 
Resv ID Queue User State Start / Duration / End
my_name R6799955 dtalcott CO Thu Aug 01 01:01 / 100 / Thu Aug 01 01:02 
15:35 pbspl1 ~.$ echo sleep 10 | qsub -q my_name -l select=1:model=san:aoe=sles12 -o foo.out -joe
6799995.pbspl1.nas.nasa.gov
15:35 pbspl1 ~.$ qstat -u dtalcott
                                           Req'd Elap Rem
SeqNo User Queue Jobname CPUs Nds wallt Ss wallt Eff wallt
------- -------- -------- ------- ---- --- ----- -- ----- --- -----
6799995 dtalcott R6799955 STDIN 1 1 00:02 Q 00:00 -- 00:02

```

There is a limitation to this code: multiple reservations can have the same name. It is unspecified which reservation will be picked. In practice here, this has not been a problem and is sometimes a feature.

---

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [July 30, 2019, 9:41am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/11 "2019-07-30T09:41:19Z")

</div>

Hi,  
I have tried what you shared, and below is the output while creating reservation:

## varun@elogin04:~\> pbs\_rsub -R 1500 -E 1505 -N my\_res -l select=2:ncpus=36:Qlist=queue1:vntype=compute -l place=scatter:excl R4536261.sdb UNCONFIRMED varun@elogin04:~\> pbs\_rstat Resv ID Queue User State Start / Duration / End

R4536261.s R4536261 varun@el CO Today 15:00 / 300 / Today 15:05

Expected “Resv ID” is not created with name “my\_res”

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [July 30, 2019, 4:46pm UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/12 "2019-07-30T16:46:57Z")

</div>

Please share the output of pbs\_rstat -f

---

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [July 31, 2019, 9:46am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/13 "2019-07-31T09:46:59Z")

</div>

**varun@elogin04:~\> pbs\_rsub -R 1510 -E 1515 -N my\_res -l select=2:ncpus=36:Qlist=queue1:vntype=compute -l place=scatter:excl**  
**R4550559.sdb UNCONFIRMED**  
**varun@elogin04:~\>**  
**varun@elogin04:~\> pbs\_rstat**  
**Resv ID Queue User State Start / Duration / End**  
**---------------------------------------------------------------------**  
**R4550559.s R4550559 varun@el UN Today 15:10 / 300 / Today 15:15**

**varun@elogin04:~\> pbs\_rstat -f**  
**Resv ID: R4550559.sdb**  
**Reserve\_Name = my\_res**  
**Reserve\_Owner = varun@elogin04**  
**reserve\_state = RESV\_CONFIRMED**  
**reserve\_substate = 2**  
**reserve\_start = Wed Jul 31 15:10:00 2019**  
**reserve\_end = Wed Jul 31 15:15:00 2019**  
**reserve\_duration = 300**  
**queue = R4550559**  
**Resource\_List.ncpus = 72**  
**Resource\_List.nodect = 2**  
**Resource\_List.select = 2:ncpus=36:Qlist=queue1:vntype=compute**  
**Resource\_List.place = scatter:excl**  
**Resource\_List.walltime = 00:05:00**  
**resv\_nodes = (node\_6\_0:ncpus=36)+(node\_6\_1)+(node\_8\_0:ncpus=36)+(node\_8\_1)**  
**Authorized\_Users = varun@elogin04**  
**server = sdb**  
**ctime = Wed Jul 31 15:07:47 2019**  
**mtime = Wed Jul 31 15:07:47 2019**  
**Variable\_List = PBS\_O\_LOGNAME=varun,PBS\_O\_HOST=elogin04,PBS\_O\_MAIL=/var/mail/varun**

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [July 31, 2019, 10:27am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/14 "2019-07-31T10:27:17Z")

</div>

> [@varun](#):
>
> Reserve\_Name = my\_res

Your reservation name is my\_res, this is created.  
Reservation ID is not customisable, it is generated by the system upon requesting a reservation.

---

<div class="post-metadata">

**Author:** ![varun](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/varun/32/229_2.png) [@varun](https://community.openpbs.org/u/varun)\
**Post date:** [July 31, 2019, 11:05am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/15 "2019-07-31T11:05:12Z")

</div>

yeh, i have found the same,  
But It was a reply to Dale’s suggested Example above.  
There Resv ID can be assigned with names that can then be used when submitting jobs.

---

<div class="post-metadata">

**Author:** ![dtalcott](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/dtalcott/32/410_2.png) [@dtalcott](https://community.openpbs.org/u/dtalcott)\
**Post date:** [August 3, 2019, 2:20am UTC](https://community.openpbs.org/t/reserve-resources-for-a-user-for-particular-job-within-queue-when-using-node-binding/1657/16 "2019-08-03T02:20:02Z")

</div>

Sorry to be so slow to respond. The pbs\_rstat -f output shows that the name got recorded. So, the problem is somewhere in the pbs\_rstat code that displays things. I recall making some changes in our part of that code for pbspro 19. You can find these changes (and others) via:

```
git clone https://github.com/drtoss/pbspro.git drtoss19
cd drtoss19
git checkout nas_mods

```

Then compare that pbs\_rstat.c to yours.
