Install Host OS onto RMS2 from the Installer Bootstrap Host (RMS1)

Introduction

These procedures provide the steps required to install the OL7 image onto the RMS2 via the Installer Bootstrap Host using a occne/provision container. Once completed, RMS2 includes all necessary rpm updates and tools necessary to Install the Bastion Host. All commands are executed from RMS1.

Prerequisites

Limitations and Expectations

All steps are executable from a SSH application (putty) connected laptop accessible via the Management Interface.

Procedures

Table 3-9 Procedure to install the OL7 image onto the RMS2 via the installer bootstrap host

Step # Procedure Description
1.

Copy the Necessary Files from the Utility USB to Support the OS Install This procedure is used to provide the steps for copying all supporting files from the Utility USB to the appropriate directories so that the Provision Container successfully installs OL7 onto RMS2.

Note: The cluster_name field is derived from the occne_cluster_name field in the hosts.ini file.

  1. Create the directories needed on the Installer Bootstrap Host.
    $ mkdir /var/occne
    $ mkdir /var/occne/<cluster_name>
    $ mkdir /var/occne/<cluster_name>/yum.repos.d
    
  2. Mount the Utility USB.

    Note: Instructions for mounting a USB in Linux are at: Installation of Oracle Linux 7.5 on Bootstrap Host : Install Additional Packages. Only follow steps 1-4 to mount the USB.

  3. Copy the hosts.ini file (created using procedure: OCCNE Inventory File Preparation) into the /var/occne/<cluster_name>/ directory. This hosts.ini file defines RMS2 to the Provision Container running the provision image downloaded from the repo.
    $ cp /media/usb/hosts.ini /var/occne/<cluster_name>/hosts.ini
  4. Update the hosts.ini file to include the ToR host_net (vlan3) VIP for NTP clock synchronization. Use the ToR VIP address as defined in procedure: Installation PreFlight Checklist : Complete OA and Switch IP SwitchTable as the NTP source.
    $ vim /var/occne/<cluster_name>/hosts.ini
    
    Update the ntp_server field with the VIP address.
  5. Copy the customer specific ol7-mirror.repo and the docker-ce-stable repo on the Utility USB to the Installer Bootstrap Host.

    This is the .repo file created by the customer that provides access to the onsite (within their network) repositories needed to complete the full deployment of OCCNE 1.2 and to install docker-ce onto the Installer Bootstrap Host.
    $ cp /media/usb/ol7-mirror.repo /var/occne/<cluster_name>/yum.repos.d/ol7-mirror.repo
    $ cp /media/usb/ol7-mirror.repo /etc/yum.repos.d/ol7-mirror.repo
    $ cp /media/usb/docker-ce-stable.repo /etc/yum.repos.d/docker-ce-stable.repo
    
  6. If still enabled from procedure: OCCNE Installation of Oracle Linux 7.5 on Bootstrap Host, the /etc/yum.repos.d/Media.repo is to be disabled.

    $ mv /etc/yum.repos.d/Media.repo /etc/yum.repos.d/Media.repo.disable
2.

Copy the OL7 ISO to the Installer Bootstrap Host

The iso file should be accessible from a Customer Site Specific repository. This file should be accessible because the ToR switch configurations were completed in procedure: OCCNE Configure Top of Rack 93180YC-EX Switches.

Copy from RMS1, the OL7 ISO file to the /var/occne directory. The example below uses OracleLinux-7.5-x86_64-disc1.iso. Note: If the user copies this ISO from their laptop then they must use an application like WinSCP pointing to the Management Interface IP.

$ scp <usr>@<site_specific_address>:/<path_to_iso>/OracleLinux-7.5-x86_64-disc1.iso /var/occne/OracleLinux-7.5-x86_64-disc1.iso
3.

Install Docker onto the Installer Bootstrap Host
Use YUM to install docker-ce onto the installer Bootstrap Host. YUM should use the existing <customer_specific_repo_file>.repo in the /etc/yum.repos.d directory.
$ yum install docker-ce-18.06.1.ce-3.el7.x86_64
4.

Set up access to the Docker Registry on the Installer Bootstrap Host
  1. Add an entry to the /etc/hosts file on the Installer Bootstrap Host to provide a name mapping for the docker registry using the hosts.ini file fields occne_private_registry and occne_private_registry_address in OCCNE Inventory File Preparation.

    <occne_private_registry_address> <occne_private_registry>

    Example:10.75.200.217 reg-1

  2. Create the /etc/docker/daemon.json file on the Installer Bootstrap Host. Add an entry for the insecure-registries for the docker registry.
    $ mkdir /etc/docker
    $ vi /etc/docker/daemon.json
    Enter the following:
    
    {
    
      "insecure-registries": ["<occne_private_registry>:<occne_private_registry_port>"]
    
    }
    
    Example:
    
    cat /etc/docker/daemon.json
    
    {
    
      "insecure-registries": ["reg-1:5000"]
    
    }
    
    To Verify:
    
    ping <occne_private_registry>
    
    Example:
    
    # ping reg-1
    
    PING reg-1 (10.75.200.217) 56(84) bytes of data.
    
    64 bytes from reg-1 (10.75.200.217): icmp_seq=1 ttl=61 time=0.248 ms
    
    64 bytes from reg-1 (10.75.200.217): icmp_seq=2 ttl=61 time=0.221 ms
    
    64 bytes from reg-1 (10.75.200.217): icmp_seq=3 ttl=61 time=0.239 ms
  3. Create the docker service http-proxy.conf file.
    $ mkdir -p /etc/systemd/system/docker.service.d/
    
    $ vi /etc/systemd/system/docker.service.d/http-proxy.conf
    
    Add the following:
    
    [Service]
    
    Environment="NO_PROXY=<occne_private_registry_address>,<occne_private_registry>,127.0.0.1,localhost" 
    
    Example: 
    
    [Service]
    
    Environment="NO_PROXY=10.75.200.217,reg-1,127.0.0.1,localhost"
    
  4. Start the docker daemon
    $ systemctl daemon-reload
    $ systemctl restart docker
    $ systemctl enable docker
     
    Verify docker is running:
    $ ps -elf | grep docker
    $ systemctl status docker
    
5.

Setup NFS on the Installer Bootstrap Host

Run the following commands (assumes nfs-utils has already been installed in procedure: OCCNE Installation of Oracle Linux 7.5 on Bootstrap Host : Install Additional Packages).

Note: The IP address used in the echo command is the Platform VLAN IP Address (VLAN 3) of the Bootstrap Host (RMS 1) as given in: Installation PreFlight Checklist : Complete Site Survey Host Table.

$ echo'/var/occne 172.16.3.4/24(ro,no_root_squash)'>> /etc/exports
$ systemctl start nfs-server
$ systemctl enable nfs-server
Verify nfs is running:
$ ps -elf | grep nfs
$ systemctl status nfs-server
6.

Set up the Boot Loader on the Installer Bootstrap Host
Execute the following commands:
$ mkdir -p /var/occne/pxelinux
$ mount -t iso9660 -o loop /var/occne/OracleLinux-7.5-x86_64-disc1.iso /mnt
$ cp /mnt/isolinux/initrd.img /var/occne/pxelinux
$ cp /mnt/isolinux/vmlinuz /var/occne/pxelinux
7.

Verify and Set the PXE Configuration File Permissions on the Installer Bootstrap Host
Each file configured in the step above must be open for read and write permissions.
$ chmod 777 /var/occne/pxelinux
$ chmod 777 /var/occne/pxelinux/vmlinuz
$ chmod 777 /var/occne/pxelinux/initrd.img
8.

Disable DHCP and TFTP on the Installer Bootstrap Host
The TFTP and DHCP services running on the Installer Bootstrap Host may still be running. These services must be disabled.
$ systemctl stop dhcpd
$ systemctl disable dhcpd
$ systemctl stop tftp
$ systemctl disable tftp
9.

Disable SELINUX
SELINUX must be set to permissive mode. In order to successfully set the SELINUX mode, a reboot of the system is required. The getenforce command is used to determine the status of SELINUX.
$ getenforce
active
If the output of this command displays active, change it to permissive by editing the /etc/selinux/config file.
$ vi /etc/selinux/config
Change the SELINUX variable to passive: SELINUX=permissive
save the file
Reboot the system: reboot
10.

Execute the OS Install on RMS2 from the Installer Bootstrap Host
  1. Run the docker commands below to perform the OS install.
    docker run --rm --network host --cap-add=NET_ADMIN -v /var/occne/<cluster_name>/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit <db-2_node_name>, localhost --skip-tags "datastore,vms_provision,yum_configure" <image_name>:<image_tag>
     
    docker run --rm --network host --cap-add=NET_ADMIN -v /var/occne/<cluster_name>/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit <db-2_node_name>,localhost --tags yum_configure" <image_name>:<image_tag>
     
    docker run --rm --network host --cap-add=NET_ADMIN -v /var/occne/<cluster_name>/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit <db-2_node_name>,localhost --tags datastore" <image_name>:<image_tag>
     
    docker run --rm --network host --cap-add=NET_ADMIN -v /var/occne/<cluster_name>/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit <db-2_node_name>,localhost --tags vms_provision" <image_name>:<image_tag>
     
    Example:
     
    docker run -it --rm --network host --cap-add=NET_ADMIN -v /var/occne/rainbow.lab.us.oracle.com/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit db-2.rainbow.lab.us.oracle.com,localhost --skip-tags "datastore,vms_provision,yum_configure"" 10.75.200.217:5000/occne/provision:1.2.0
     
    docker run -it --rm --network host --cap-add=NET_ADMIN -v /var/occne/rainbow.lab.us.oracle.com/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit db-2.rainbow.lab.us.oracle.com,localhost --tags yum_configure" 10.75.200.217:5000/occne/provision:1.2.0
     
    docker run -it --rm --network host --cap-add=NET_ADMIN -v /var/occne/rainbow.lab.us.oracle.com/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit db-2.rainbow.lab.us.oracle.com,localhost --tags datastore" 10.75.200.217:5000/occne/provision:1.2.0
     
    docker run --rm --network host --cap-add=NET_ADMIN -v /var/occne/<cluster_name>/:/host -v /var/occne/:/var/occne:rw -e "OCCNEARGS=--limit db-2.rainbow.lab.us.oracle.com,localhost --tags vms_provision" 10.75.200.217:5000/occne/provision:1.2.0
    
  2. Verify that Bastion host vm is installed by logging into RMS2. Run the following in case of failure to Login ONLY:
    $ virsh list
     
     
    Output Example-
     Id    Name                           State
    ----------------------------------------------------
     11    bastion-1.rainbow.lab.us.oracle.com running
     
     
    $ virsh destroy bastion-1.rainbow.lab.us.oracle.com
    $ virsh undefine bastion-1.rainbow.lab.us.oracle.com
    $ virsh list
     
     
    Note: virsh list after destroy and undefine should not return any name in the list
  3. Execute the virt-install command on RMS2
    virt-install --name bastion_host --memory 8192 --vcpus 2 --metadata description="Bastion Host" \
                         --autostart --location /var/occne/OracleLinux-7.5-x86_64-disc1.iso \
                         --initrd-inject=/tmp/bastion_host.ks --os-variant ol7.5 \
                         --extra-args "ks=file:/bastion_host.ks console=tty0 console=ttyS0,115200" \
                         --disk path=/var/lib/libvirt/images/bastion_host.qcow2,size=300 \
                         --network bridge=teambr0 --network bridge=vlan2-br --network bridge=vlan4-br --graphics none

After the VM creation completes, the login prompt appears which allows the user to login to the Bastion Host.