Automated Installation

This section details the steps required to execute the automated configuration of the Bastion Host VM. This consists of two main section:

  1. Setting up and executing the deploy.sh script on the Bootstrap Host.
  2. Accessing the Bastion Host and executing the final commands to execute the pipeline.sh script to complete the Bastion Host configuration and deploy the OCCNE cluster.

Table 2-13 Automated Installation

Step # Procedure Description
1.

Setting up for and executing the deploy.sh script on the Bootstrap Host
The deploy.sh script performs the initial pre-configuration of the Bastion host. This includes installing ansible, executing the ansible playbook configBastionHost.yaml to setup the initial files and staging directories on the Bastion Host and executing the pipeline to setup the artifacts directory. The script is executed on the Bootstrap Host using a set of environment variables that can be initialized on the command line along with the deploy.sh script. These variables include the following:
Name Comment Example usage
CENTRAL_REPO Defines the customer specific repository host name. Note: This would be used in conjunction with CENTRAL_REPO_IP and CENTRAL_REPO_DOCKER_PORT. CENTRAL_REPO=customer_repo \ CENTRAL_REPO_IP=10.10.10.10 \ CENTRAL_REPO_DOCKER_PORT=5000 ./deploy.sh
CENTRAL_REPO_IP Defines the customer specific repository IPv4 address. See above.
CENTRAL_REPO_DOCKER_PORT Defines the customer specific repository docker port number. Defaults to 5000. See above.
OCCNE_CLUSTER Defines the cluster short name. OCCNE_CLUSTER=rainbow
BASTION_HOST Bastion Host "ansible_host" IP address (ex: 172.16.3.100) BASTION_HOST=172.16.3.100
OCCNE_VERSION The version tag of the image releases OCCNE_VERSION=1.3.2
2.

Copy necessary files from Utility USB to the Bootstrap Host staging directory
  1. The MySQL .zip file (ex: V980756-01.zip) must be copied to the staging directory /var/occne directory. This file should be provided from the Utility USB. This file is used for installing the ndb MySQL nodes.
    $ cp /<usb_dev>/db/*.zip /var/occne/*.zip 
  2. Copy the configBastionHost.yaml file from the Customer Utility USB to the staging directory /var/occne/.
    $ cp /<usb_dev>/configBastionHost.yaml /var/occne/. 
  3. Copy the deploy.sh script from the Customer Utility USB to the staging directory at /var/occne/ and set the file to executable.
    $ cp /<usb_dev>/deploy.sh /var/occne/. 
    $ chmod +x /var/occne/deploy.sh
  4. On the Bootstrap Host add the following entry to the /etc/hosts file:
    $ sudo vi /etc/hosts
     
    Add the following:
    <bastion_ip_address> <bastion_full_name>
    Save/write the file
     
    Example entry:
    172.16.3.100  bastion-2.rainbow.us.labs.oracle.com
3.

Execute Deploy
Execute the deploy.sh script from the /var/occne/ directory with the required parameters set.
$ export CENTRAL_REPO=<customer_specific_repo_name>
$ export CENTRAL_REPO_IP=<customer_specific_repo_ipv4>
$ export OCCNE_CLUSTER=<cluster_short_name>
$ export OCCNE_BASTION=<bastion_full_name>
$ export OCCNE_VERSION=1.3.x
$ ./deploy.sh
 
Customer Example:
$ export CENTRAL_REPO=central-repo
$ export CENTRAL_REPO_IP=10.10.10.10
$ export OCCNE_CLUSTER=rainbow
$ export OCCNE_BASTION=bastion-2.rainbow.us.labs.oracle.com
$ export OCCNE_VERSION=1.3.2
$ ./deploy.sh
 
The command above can be executed like the following:
$ OCCNE_VERSION=1.3.2 CENTRAL_REPO=central-repo CENTRAL_REPO_IP=10.10.10.10 OCCNE_CLUSTER=rainbow OCCNE_BASTION=bastion-2.rainbow.us.labs.oracle.com ./deploy.sh
 
Internal Example:
Internally the defaults would be used so the only possible variables that needs to be provided are the OCCNE_CLUSTER, OCCNE_BASTION, and OCCNE_VERSION.
 
$ OCCNE_VERSION=1.3.2 OCCNE_CLUSTER=rainbow OCCNE_BASTION=bastion-2.rainbow.us.labs.oracle.com ./deploy.sh
4.

Executing Final Deploy on Bastion Host

The following commands are executed from the Bastion Host to complete the Bastion Host configuration and deploy OCCNE on the Bare Metal system.

Note: The Bootstrap Host cannot be used to access the Bastion Host as it will be re-paved from execution of this command.

  1. Login to the Bastion Host as admusr. The private key that was saved earlier should be used to access the Bastion Host from a server other than the Bootstrap Host using the ssh command. This private key should be copied to the /home/<user>/.ssh directory on that server as id_rsa using scp (or winSCP from a desktop PC). The permissions of the key must be set to 0600 using the command: chmod 0600 ~/.ssh/id_rsa
    $ ssh -i ~/.ssh/id_rsa admusr@<bastion_host_external_ip_address>
  2. The MetalLB configuration file must be located on the Bastion Host at /var/occne/cluster/<cluster_name>. Follow the procedure at Populate the MetalLB Configuration File to find an example of this file and instructions on how to configure it. You will have to manually edit (using vi) a file on the Bastion Host and copy the contents of the example MetalLB file (maintaining the formatting) into that file on the Bastion Host.
  3. Execute the following command to complete the deployment of OCCNE from the Bastion Host (excluding re-install on the Bastion Host and its KVM host, which are already setup). This action will re-pave the Bootstrap Host RMS.

    Note: You can use the following to pipe the output of the pipeline.sh script to a file: tee pipeline$(date +"%F_%H%M%S").log

    $ export PROV_DEPLOY_ARGS='--limit=!<bastion_full_name>,!<bastion_kvm_host_full_name>'
    $ export OCCNE_VERSION=1.3.x
    $ /var/occne/cluster/<cluster_short_name>/artifacts/pipeline.sh
     
    Customer Example:
    $ export PROV_DEPLOY_ARGS='--limit=!bastion-2.rainbow.lab.us.oracle.com,!db-2.rainbow.lab.us.oracle.com'
    $ export OCCNE_VERSION=1.3.2
    $ /var/occne/cluster/rainbow/artifacts/pipeline.sh
     
    To save the output from the pipeline.sh script the command can be written as:
    $ /var/occne/cluster/rainbow/artifacts/pipeline.sh | tee pipeline$(date +"%F_%H%M%S").log 
5.

Update the Bastion KVM Host repo file

Since db-2 was not part of the final OS install and cluster deploy, it's /var/occne/yum.repos.d/*.repo file is not pointing to the Bastion Host as its YUM repo. That file on RMS2/db-2 must be updated so that it now points to the Bastion Host as the repo. After the Bastion Host was created, the .repo file that was copied onto the Bastion Host has the correct settings. That file can just be copied back to RMS2/db-2.

  1. From the Bastion Host, login to the Bastion Host KVM Host, using the occne private key and the internal host IP address for that node (extracted from the hosts.ini file)
    $ ssh -i /var/occne/cluster/<cluster_short_name>/.ssh/occne_id_rsa admusr@<bastion_kvm_host_ip_address>
  2. Remove the existing .repo files:
    $ sudo rm /var/occne/yum.repos.d/*.repo
  3. Copy the Bastion specific .repo file from the Bastion Host to the Bastion KVM Host. Execute this command from the Bastion KVM Host.
    scp admusr@<bastion_ip_address>:/var/occne/yum.repos.d/*.repo /var/occne/yum.repos.d/
     
    Example:
    scp admusr@172.16.3.100:/var/occne/yum.repos.d/*.repo /var/occne/yum.repos.d/
6.

Change MySQL root user password Refer to Change MySQL root user password