rackn-test-allocate-machine¶
create a batch of test run based upon parameters
This task script is designed to allocate a machine from a specified machine pool using the drpcli
command-line tool. Here's a step-by-step breakdown of what it does:
-
Prelude Template: It includes a prelude template, which likely sets up the environment or includes common functions.
-
Cleanup Previous Workorder: If the parameter
rackn/test/workorder-cleanup
is set, it destroys the previous work order usingdrpcli
. -
Get Machine from Machine Pool:
- It counts the number of machines in the specified machine pool that match the given filter.
-
If no machines are available, it logs a success message and exits.
-
Allocate Machine:
- It attempts to allocate one machine from the pool using
drpcli
. - If the allocation fails, it retries up to 5 times.
-
If after 5 retries it still fails, it logs an error message and initiates a new work order template with updated metadata and parameters.
-
Work Order Template Initialization:
- It retrieves the current work order template and updates its metadata and parameters.
- It creates a new work order with the updated template.
The script uses various drpcli
commands to interact with the RackN Digital Rebar Provision (DRP) API, managing machine pools and work orders.