Skip to content

Machine Discovery

This guide provides step-by-step instructions for tasks associated with Machine Discovery.

PXE Boot:

Configure Subnet

To enable machines to PXE boot via DRP, configure the relevant subnet in DRP to match the machines' subnet. You can set this up either through the DRP UI or using drpcli on the command line.

Configuring subnet from UX

  • Navigate to the Subnets section of the UX. This is present under the Networking section in the nav bar
  • Click on create
  • Choose the relevant subnet or add it manually. Ensure DRP can access this network.

Configuring subnet from CLI

  • Prepare a JSON object detailing your subnet. Refer to the subnet object for the required format.
  • Once your json object is create, you can use the following DRPCLI command to create your subnet
echo '{
  "ActiveEnd": "192.168.122.254",
  "ActiveLeaseTime": 3600,
  "ActiveStart": "192.168.122.10",
  "Enabled": true,
  "Meta": {
    "icon": "cloud",
    "color": "black",
    "title": "User added"
  },
  "Name": "example-subnet",
  "OnlyReservations": false,
  "Options": [
    {
      "Code": 3,
      "Value": "192.168.122.1"
    },
    {
      "Code": 6,
      "Value": "192.168.122.143"
    },
    {
      "Code": 15,
      "Value": "test.example.com"
    }
  ],
  "Pickers": [
    "hint",
    "nextFree",
    "mostExpired"
  ],
  "Proxy": false,
  "ReservedLeaseTime": 21600,
  "Strategy": "MAC",
  "Subnet": "192.168.122.143/24",
  "Unmanaged": false
}' > /tmp/example_subnet.json

drpcli subnets create - < /tmp/local_subnet.json

Once set up, machines in these subnets are ready to PXE boot into DRP.

Set Bootenv Preferences (non universal install)

Note

This part can be skipped if the DRP install was done with --universal flag. Universal install sets the necessary preferences.

By default, Digital Rebar Provision (DRP) attempts to "do no harm". This means that by default, any system that receives a DHCP lease from the DRP Endpoint, will by default, be set to local mode, which means boot from local disks. You must explicitly change this behavior to enable provisioning activities of Machines.

drpcli prefs set unknownBootEnv discovery defaultBootEnv sledgehammer defaultStage discover

Once these preferences are set, new machines discovered on the configured subnets will boot into sledgehammer.

Manual Join

Another way a machine can be added to DRP is by using the join-up.sh script. Some examples of this usage can be found here:

IPMI Scanning

The IPMI plugin can create machines from their BMC presence if the feature is enabled. This can be done in one of two ways. Automatic discovery or a range-scan action.

Before diving in to either of these methods, you need to ensure that the IPMI plugin is downloaded and IPMI discovery has been enabled. This is done via setting the ipmi/discover/enabled param to true on the IPMI Plugin.

Note

Please note that in order for your discovered machines to be successfully processed and have DRP machine objects created for them, we need to successfully be able to login to these machines via the Redfish API. There are two params that allow you to provide these credentials to us. ipmi/discover/oobm-default-credentials is a default set of credentials that will be tried for all machines and ipmi/discover/oobm-user-provided-credentials which are creds for a specific machine.

Automatic Discovery

Whenever a new DHCP lease is generated, a corresponding event also gets generated by the DRP server. The IPMI plugin listens to these new lease events and if it finds a machine that is not already in DRP, it will go ahead and process it to see if it is a BMC and will create a machine object if all conditions are satisfied. For more details, please refer to the IPMI Plugin Docs page.

To enable auto-discovery, the following param needs to be set on the Plugin

  • ipmi/discover/from-lease: This needs to be set to true. Once this is enabled, all new lease events will be processed by DRP to check for BMC presence

This is the mandatory param but further configuration can be done. Please refer to IPMI Plugin Docs for more info.

Once the above setup is complete your machines are ready to be discovered by lease events!

Range scan

Another way to scan for BMCs is by doing a range-scan action using the IPMI plugin. Once the IPMI discovery is enabled and the credentials are set up, a range scan can be performed by making the following drpcli call. In this case no subnet configuration needs to be done. We are going to kick off a "discovery" on each IP in the range. If a BMC is discovered in this range, we will try to login, collect information and create a machine object for it.

drpcli plugins runaction ipmi scan-range ipmi/discover/scan-start-address "1.1.1.0" ipmi/discover/scan-end-address "1.1.1.5"

In the given example, we will work with the IP addresses 1.1.1.0 through 1.1.1.5. Should any of these IP addresses correspond to a Baseboard Management Controller (BMC) that we can establish a connection with and login successfully, a corresponding machine object will be created in DRP.

Labs

For a practical grasp of IPMI range scanning and its applications, we offer interactive labs that you can integrate into your DRP endpoint. These labs provide detailed, step-by-step guidance, culminating in the setup of an automated batch job that conducts nightly range scans. Detailed instructions on accessing and implementing these labs will be available soon.

References: