In this section, you will leverage RackHD to perform an unattended install of CentOS 7 onto a discovered compute node. The config.json file for this demo already has an http proxy server set up for http://mirror.centos.org/ The install workflow will use this proxy to install the OS image.
The compute vNode discoved in the previous section will be used as the OS-Install target node in this Lab. Get the information of vnode.
curl 127.0.0.1:9090/api/2.0/nodes?type=compute | jq '.'
The node-id
specified in the response will be used in the following steps.
To provision the OS to the node, RackHD can act as an OS mirror repository.
cd ./RackHD/example/rackhd/files/mount/common/
mkdir -p centos/7/os/x86_64/
sudo mount -o loop ~/iso/CentOS-7-x86_64-Everything-1708.iso ./centos/7/os/x86_64/
In this step, you will create a payload file, and then leverage the RackHD build-in workflow to install the OS on the vNode.
Create a file named install_centos_7_payload.json and add the following to it:
{
"name": "Graph.InstallCentOS",
"options": {
"defaults": {
"version": "7",
"repo": "http://172.31.128.2:9090/common/centos/7/os/x86_64",
"rootPassword": "RackHDRocks!"
}
}
}
<node-ID>
that you obtained in the Prerequisites at the beginning of this lab. Run the following commandcurl -X POST -H 'Content-Type: application/json' -d @install_centos_7_payload.json 127.0.0.1:9090/api/2.0/nodes/<node-ID>/workflows?name=Graph.InstallCentOS | jq '.'
root@rackhd:/home/vagrant# curl 127.0.0.1:9090/api/2.0/nodes/<Node_ID>/workflows?active=true | jq '.'
In the json output RackHD responses, you will see “_status” field is “running”, and “graphName” field is “Install Cent OS”,
Note: If the “[]” is returned, the workflow failed immediately. The failure is likely because the OBM setting is not set. (No OBM service assigned to this node.)