7.6. Perform an Unattended OS Install

7.6.1. Overview

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.

7.6.1.1. Prerequisite

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 '.'
../_images/docker_node_info.png

The node-id specified in the response will be used in the following steps.

7.6.1.2. Install OS with RackHD API

In this step, you will create a payload file, and then leverage the RackHD build-in workflow to install the OS on the vNode.

  1. Create a payload json file by for the OS install.

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/centos/7/os/x86_64",
            "rootPassword": "RackHDRocks!"
        }
    }
}
  1. Install the OS by using built-in “Graph.InstallCentOS” workflow and the <node-ID> that you obtained in the Prerequisites at the beginning of this lab. Run the following command
curl -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 '.'

7.6.1.3. Installation Progress

  1. Run the following API to monitor a workflow that is running.
root@rackhd:/home/vagrant# curl 127.0.0.1:8080/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.)

  1. Use VNC to monitor the corresponding vNode’s console.
  2. It will PXE boot from the CentOS install image. And start the OS installation:
../_images/docker_install_os_process.png
  1. After the OS install has completed, you can now log into the system using the rootPassword you specified in the payload file above.