title: Jenkins Resource Locks: Get lock for multiple Node specific resources
body: <p>I'd like to create multiple Resources for a certain node, or use a reusable type for several nodes.</p>
  
  <p>In this case it is "RAM requirement", so the resource name e.g. would be 1GBRAM. alternatively <code>1GBRAM_Nodexy</code> if I need to specify this on a per node basis.</p>
  
  <p>In the end I'd like to limit the amount of concurrent Jobs based on the peak amount of memory a Job uses up on this node, to avoid hangs because of low memory on the server. And I can set the amount of RAM which is available for executors.</p>
  
  <p>Different Nodes will have different amounts of RAM, and individual Jobs have different RAM requirements.</p>
  
  <p>So I would like to configure each Job with its RAM requirements</p>
  
  <pre><code>lock(resource: '1GBRAM_Nodexy', quantity: 8)
  </code></pre>
  
  <p>Is this achievable with Pipelines and lockable resources?</p>
  
  <p>Is there an alternative, better way to achieve this? Ideally, the locks can be checked before the slave is selected, and the best suited node is picked.</p>
  
  <p>Read about resource locks and labels. I Did not find any Node specific section, also no possibility to acquire multiple items of the same resource.</p>
  
  <pre><code>lock(resource: '1GBRAM_Nodexy', quantity: 8)
  </code></pre>
  
  <p>I expect that each run of the Job locks the equivalent amount of RAM on the used slave node. If not enough "RAM" units are used up, a Job is not run on such a node.</p>