Skip to content

Cloud-based Machine Discovery

DRP supports managing machines in cloud environments (AWS, Azure, GCP, and others) using the same workflow and task system used for physical hardware. Cloud machines are registered with DRP either by the Resource Broker provisioning them directly or by joining an existing DRP endpoint via the discover-joinup workflow. Unlike PXE discovery, cloud machines do not boot from the network — instead, DRP registers the machine via API and injects the DRP agent into the instance through cloud-init or a startup script.

Resource Brokers for Cloud

Resource Brokers are the primary mechanism for cloud-backed machine management in DRP. A Resource Broker is a DRP plugin or workflow that translates a work-order request (e.g., "allocate a machine with 16 vCPUs and 64 GB RAM in us-east-1") into cloud API calls that create and register the instance. The broker handles:

  • Provisioning — Creating the cloud VM with the requested size, image, and network configuration
  • Registration — Adding the new instance as a machine object in DRP with its IP address and metadata
  • Decommissioning — Terminating the cloud VM and removing the DRP machine record when the machine is returned to the broker

Cloud resource brokers are configured via the broker/* parameter family. The broker/pool-pool parameter identifies the pool the broker manages, and broker/mach-name controls the naming convention for created machines.

Cloud-Init vs. PXE Discovery

Physical machines typically enter DRP through PXE boot (see How to Set Up PXE Discovery in DRP), where Sledgehammer runs on the machine, contacts DRP, and registers the machine. Cloud machines cannot PXE boot in this way. Instead, they use one of two registration paths:

  • Resource Broker path — The broker creates the VM via cloud API and registers it in DRP before the VM even boots. DRP then deploys a startup script or cloud-init user-data payload that installs the DRP agent on first boot.
  • Join-up path — An existing cloud VM runs the discover-joinup workflow, which contacts the DRP endpoint and self-registers. This is useful for instances created outside of DRP (e.g., by Terraform) that need to participate in DRP-managed workflows.

Configuring Cloud Discovery

To enable cloud machine management:

  1. Install the appropriate cloud Resource Broker plugin for your cloud provider from the DRP catalog.
  2. Create a plugin instance configured with your cloud credentials and target region.
  3. Create a resource pool that uses the cloud broker as its provisioner.
  4. Issue work orders to allocate cloud machines, or point existing VMs at the DRP endpoint using the join-up workflow.
Bash
# List available resource broker plugins
drpcli catalog items list | jq '.[] | select(.Name | contains("broker"))'

# Check registered resource broker plugins
drpcli plugins list | jq '.[] | select(.Provider | contains("broker"))'

# View machines that joined via cloud discovery
drpcli machines list | jq '.[] | select(.Meta.CloudProvider != null) | {Name, Address, Meta}'

Cloud Inventory Collection

Once a cloud machine is registered, DRP runs the standard inventory stages to collect hardware metadata via the cloud-inventory stage. This stage collects cloud-specific metadata (instance ID, region, availability zone, instance type) in addition to the standard inventory fields, making it available for classification and workflow selection. See Inventory for details on the inventory system.