# How to use Dynamic Resource in OpenPBS

**URL:** <https://community.openpbs.org/t/how-to-use-dynamic-resource-in-openpbs/3890>\
**Category:** Users/Site Administrators\
**Created:** [May 23, 2024, 6:06am UTC](https://community.openpbs.org/t/how-to-use-dynamic-resource-in-openpbs/3890 "2024-05-23T06:06:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maheshd](https://avatars.discourse-cdn.com/v4/letter/m/bc79bd/32.png) [@Maheshd](https://community.openpbs.org/u/Maheshd)\
**Post date:** [May 23, 2024, 6:06am UTC](https://community.openpbs.org/t/how-to-use-dynamic-resource-in-openpbs/3890/1 "2024-05-23T06:06:59Z")

</div>

Hi,

We are using HPC on AWS cloud and OpenPBS version is 20.0.1.

Actually we are facing a problem where if cores are not available, then user can not submit a job and hence user need to retry after sometime.

So I have created a shell script that will check how many cores are available and I want to use this script as dynamic resource say vcpu\_free. That means when user submit a job, the ncpu will be allocated to vcpu\_free and which will check if those many requested cores are available and if not, it will keep that job in Pend status.

So can you please guide me as to what all steps that I need to follow. I am not much expert on PBS so it will be great if someone can share the guidelines to accomplish above task.

Regards  
Mahesh

---

<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:** [May 23, 2024, 4:40pm UTC](https://community.openpbs.org/t/how-to-use-dynamic-resource-in-openpbs/3890/2 "2024-05-23T16:40:13Z")

</div>

Hi Mahesh,

Please refer this link and you can replicate the same for your customisation.

> [@How to manage Flexnet Licensing in PBS Pro?](https://community.openpbs.org/t/how-to-manage-flexnet-licensing-in-pbs-pro/1025/2):
>
> qmgr -c “create resource hwu\_lic type=long” create a script in /usr/loca/bin/hwu\_lic.sh that queries the license server and outputs available number of tokens only (integer) Add it to the resources: line in the sched\_config resources: “ncpus, aoe, …,hwu\_lic” Add the server\_dyn\_res line server\_dyn\_res: “hwu\_lic !/usr/local/bin/hwu\_lic.sh” kill -HUP \< PID OF THE PBS SCHEDULAR \> Submit jobs qsub -l select=1:ncpus=1 -l hwu\_lic=100 – /bin/sleep 100 Please request the specific…

Thank you
