WRCP Plugin Prestage
Overview
The prestage feature streamlines WRCP subcloud deployment by generating a pre-staged ISO that includes all the required images, removing the requirement to download these images during the deployment.
To achieve this, a WRCP system controller is provided with an RVMC pod in running state. When the prestage workflow is initiated, the details of the WRCP system controller are passed from the conductor for the workflow to be executed. Via ssh, Conductor accesses the WRCP system controller and edits the rvmc YAML file contained in the RVMC. The YAML file is updated with the parameters and path to the prestage ISO (which is in CFS). After the update is complete, a python script is executed to initiate the prestaging. The response from the script is captured and shown in the conductor.
Prerequisites
- Conductor-wrcp-plugin installed on Conductor.
- A WRCP system controller with RVMC pod running inside it. The details should be given when the prestage workflow is initiated.
- Generate Prestage ISO file and copy to CFS. The path should be provided in the CIQ files.
- Update CIQ files with path of prestage iso file and bmc server details (in the ndc file, add as a new field “prestage_iso”).
Generate Prestage ISO file manually - Using multiple script
- Execute all the steps as ROOT user.
- Download images from http://delivers.windriver.com/
- Base ISO file (e.g.: WRCP 22.12 MR2(Patch 4) ISO)
- Container image list (e.g.: wind-river-cloud-platform-container-images-list-wr-aws-22.12_PATCH_0004.txt)
- gen-image-archive.sh
- gen-prestaged-iso.sh
- stx-iso-utils.sh
- Update permission for all the scripts to 755.
- Download and tar the container images
- Docker login to windriver registry https://registry.delivers.windriver.com
- Modify script gen-image-archive.sh
- Replace 625619392498.dkr.ecr.us-west-2.amazonaws.com with appropriate prefix in script: gen-image-archive.sh
- WRS_REGISTRY_PREFIX=‘registry.delivers.windriver.com/wrcp-cd’
- Execute gen-image-archive.sh
- ./gen-image-archive.sh wind-river-cloud-platform-container-images-list-wr-harbor-22.12_PATCH_0004.txt
- This will create multiple tar files.
- The tar files are created and will be in multiple files as there is a restriction of 4GB per file.
- Troublshooting
- Check if the user has permission to do a docker pull.
- Check if these are executed as root user.
- Check script file permissions.
- Docker login to windriver registry https://registry.delivers.windriver.com
- (Optional) Create an images folder and move these tar files into it.
- Generate the md5sum for all tar.gz files and save it to a file.
- md5sum container-image1.tar.gz container-image2.tar.gz > container-image.tar.gz.md5
- md5sum container-image1.tar.gz container-image2.tar.gz > container-image.tar.gz.md5
- Generate the md5sum for all tar.gz files and save it to a file.
- Generate prestage ISO
- For executing this as a root user a couple of packages must be installed.
sudo apt-get install coreutils cpio debianutils findutils gawk genisoimage grep initscripts isomd5sum libguestfs-tools mount rpm2cpio rsync sed syslinux tar udisks2
- Refer this link for the packages: Packages required.
- If you have issues installing some packages, installed the following separately:
- syslinux-utils
- libguestfs-tools
- Isomd5sum
- Inputs for the scripts:
- input – base iso image
- images – the container images zip files. There can be multiple files, add all of them. These are the files created via the
gen-image-archive.sh
script. - output – the output file path
- param boot_device and rootfs_device – These should be based on the disk details of the target machine.
- ./gen-prestaged-iso.sh \
--input wind-river-cloud-platform-host-installer-22.12-b160-PATCH_0004.iso \
--images images/container-image1.tar.gz \
--images images/container-image2.tar.gz \
--output prestage-2212mr2.iso \
--param boot_device=/dev/disk/by-path/pci-0000:44:00.0-nvme-1 \
--param rootfs_device=/dev/disk/by-path/pci-0000:44:00.0-nvme-1
- For executing this as a root user a couple of packages must be installed.
4. Executing the above step will generate a prestage iso file in the path mentioned in output.
5. Troubleshooting:
1. If the image md5sum is not created, update the command with the correct images path.
2. Make sure the path of base iso and images are correct with respect to the script
3. If any error comes up when running the generate prestage iso script, check if all the necessary packages are installed. These are system wide packages. Refer to Packages required.
Generate Prestage ISO file manually - Using single script
Prerequisites:
- Execute all the steps as ROOT
- The following scripts are required to carry out the Prestage Creation. To be downloaded from http://delivers.windriver.com/
- gen-image-archive.sh
- gen-prestaged-iso.sh
- stx-iso-utils.sh
- build-image-and-prestage-iso.sh
- This is a newly created script, which make use of the other scripts to execute this in a single step.
- Update permission for all the scripts to 755.
- chmod +x build-image-and-prestage-iso.sh
- chmod +x gen-image-archive.sh
- chmod +x stx-iso-utils.sh
- chmod +x gen-prestaged-iso.sh
- The following files are also required for generation. Download images from delivers.windriver.com
- Base ISO file (e.g.: WRCP 22.12 MR2(Patch 4) ISO)
- Container image list (e.g.: wind-river-cloud-platform-container-images-list-wr-aws-22.12_PATCH_0004.txt)
- Docker login to windriver registry https://registry.delivers.windriver.com
- Modify script gen-image-archive.sh 1. Replace 625619392498.dkr.ecr.us-west-2.amazonaws.com with appropriate prefix in script: gen-image-archive.sh - WRS_REGISTRY_PREFIX=‘registry.delivers.windriver.com/wrcp-cd’
- For executing the script, couple of packages are required to be installed.
- ~sudo apt-get install coreutils cpio debianutils findutils gawk genisoimage grep initscripts isomd5sum libguestfs-tools mount rpm2cpio rsync sed syslinux tar udisks2`
- This can have issues. If so try to install the following additionally in the machine:
- syslinux-utils
- libguestfs-tools
- isomd5sum
- You will also need approximately 30 GB of disk space on the machine running the script.
Steps:
-
Execute the build-image-and-prestage-iso.sh with the required inputs:
- Usage:
build-image-and-prestage-iso.sh --input <input bootimage.iso> --output <output bootimage.iso> --image-list <image list image_list.txt> [ --patch <patch-name.patch> ] [ --kickstart-patch <kickstart-enabler.patch> ] [ --addon <ks-addon.cfg> ] [ --param <param>=<value> ] [ --default-boot <default menu option> ] [ --timeout <menu timeout> ] --input <file>: Specify input ISO file --output <file>: Specify output ISO file --image-list <image_list.txt>: Eg: wind-river-cloud-platform-container-images-list.txt The txt file containing the list of images. --patch <patch-name.patch>: Specify WRCP software patch file(s). Can be specified more than once, or provide a comma separated list. --kickstart-patch <kickstart-enabler.patch>: A patch to replace the prestaged installer kickstart. Not to be included in the runtime patches. --addon <file>: Specify ks-addon.cfg file. --param <p=v>: Specify boot parameter(s). Can be specified more than once, or provide a comma separated list. Examples: --param rootfs_device=nvme0n1,boot_device=nvme0n1 --param rootfs_device=/dev/disk/by-path/pci-0000:00:0d.0-ata-1.0 --param boot_device=/dev/disk/by-path/pci-0000:00:0d.0-ata-1.0 --default-boot <default menu option>: Specify default boot menu option: 0 - Serial Console 1 - Graphical Console (default) --timeout <menu timeout>: Specify boot menu timeout, in seconds. (default 30) A value of -1 will wait forever. --force-install: Force install the prestaged content even if there is already an installation on the target.
- Example:
sudo ./build-image-and-prestage-iso.sh \
--input wind-river-cloud-platform-host-installer-22.12-b160-PATCH_0004.iso \
--image-list test_list1.txt --output prestage-test1.iso \
--param boot_device=/dev/disk/by-path/pci-0000:44:00.0-nvme-1 \
--param rootfs_device=/dev/disk/by-path/pci-0000:44:00.0-nvme-1 \
--setup my-setup.ks \
--addon my-addon.ks \
--patch my-patch1.patch \
--kickstart-patch my-kickstart-patch.patch \
--default-boot 1 \
--timeout 60 \
--force-install
- The log will be displayed. Additionally, the logs are written into a log file in the same path where the script is in. The log file name will be <script_filename>.log
- Example: build-image-and-prestage-iso.sh.log
Procedure Steps
-
Initiate the newly added workflow.
-
While executing this workflow:
- Fetch the following parameters related to WRCP system controller as input for the workflow:
- system_controller_host
- system_controller_username
- system_controller_password
- system_controller_ssh_port (default 22)
Note:
- The actual installation is ongoing in this case and is not completed. For checking that will have to manually checked the target machine to see if the installation is completed.
- Based on the prestage ISO used, the configuration can differ.
- Fetch the following parameters related to WRCP system controller as input for the workflow: