Introduction
In the world of Bare Metal clusters, there are some installation methods. On of them is called Assisted Installer.
This installation is managed by ACM operator, and requires to load an ISO file on each of the Bare Metal nodes using iDRAC, and this can take a lot of time to produce. In this article you will see how Combining iDRAC and OpenShift with Redfish API is a way to automate the mission of loading ISO files. First lets understand some basics. iDRAC is the management platform for DELL servers, and Redfish API is RESTful API for server management and data center infrastructure.
Prerequisites
- DELL Bare Metal Servers with iDRAC configuration
- OCP Bare Metal Cluster
- Hub cluster with ACM operator installed and configured
Step 1 – Enabling Redfish API in iDRAC
First we need to make sure the Redfish API is enabled in iDRAC. In order to check, login to your to your iDRAC servers. After you successfully logged in, navigate to iDRAC Settings -> Redfish -> Enabled.
Step 2 – Preparing The BMC Files
Part 1 – Using BMC For Node Installation
BMC (Bare Metal Controller) is the OpenShift component that controls the connection to the servers.
In this part we will see how to use BMC for installing a node with CoreOS image.
First, we need to create a secret for our iDRAC credentials:
apiVersion: v1
kind: Secret
metadata:
name: bmc-idrac-creds
namespace: <cluster-name>
labels:
environment.metal3.io: baremetal
data:
password: <your-idrac-password>
username: <your-idrac-username>
type: Opaque
Next, we have to prepare a YAML file for each of our servers, you may use the following template:
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
annotations:
bmac.agent-install.openshift.io/hostname: <Desired-Hostname>
bmac.agent-install.openshift.io/role: worker
inspect.metal3.io: disabled
name: <Desired-Host>
namespace: <cluster-name>
lables:
infraenvs.agent-install.openshift.io: <infrastructure-environment-name>
spec:
automatedCleaningMode: disabled
bmc:
address: 'idrac-virtualmedia://<iDRAC-IP-address>/redfish/v1/Systems/System.Embedded.1/'
credentials: bmc-idrac-creds
disableCertificateVerification: true
bootMACAddress: '<server's-mac-address>'
customDeploy:
method: start_assisted_install
online: true
After creating the files apply them in the following order:
$ oc apply -f bmc-idrac-creds.yaml
$ oc apply -f <host-name>.yaml
After you successfully applied the files, all your servers should appear in your host inventory and be available for adding the node to the cluster.
Part 2 – Using BMC For Connectivity
If you already have a Bare Metal cluster you may use a similar method in order to achieve the full potential of BMC. With connecting the OpenShift cluster to our iDRAC management we can manage our node directly from our OCP cluster. We can perform tasks like: Power on, Power off and Restart to our servers and nodes.
In order to achieve this state we need to create a similar secret like before with little changes:
apiVersion: v1
kind: Secret
metadata:
name: bmc-idrac-creds
namespace: openshift-machine-api
labels:
environment.metal3.io: baremetal
data:
password: <your-idrac-password>
username: <your-idrac-username>
type: Opaque
Afterwards, we need to create a BareMetalHost file like before but with small changes:
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
name: <Desired-Host>
namespace: openshift-machine-api
spec:
bmc:
address: 'idrac-virtualmedia://<iDRAC-IP-address>/redfish/v1/Systems/System.Embedded.1/'
credentials: bmc-idrac-creds
disableCertificateVerification: true
bootMACAddress: '<server's-mac-address>'
online: true
After creating the files apply them in the following order:
$ oc apply -f bmc-idrac-creds.yaml
$ oc apply -f <host-name>.yaml
After you successfully applied the files, all your servers should appear in appear in the BareMetalHost tab as Externally Provisioned.
Summary
In this article we saw how to use the power of automating the process of installing and connecting Bare metal servers as nodes by combining iDRAC and OpenShift with Redfish API. This guide can be used for cluster installation, adding nodes to an existing Bere Metal cluster and just for controlling existing nodes using OpenShift.
