Utility to install a server via Redfish

This update introduces the implementation for a docker container named
'rvmc', standing for Redfish Virtual Media Controller, which executes a
python file that imports the open source redfish-python-library used to
establish a secure Redfish communication session with a Redfish
supported Board Management Controller to insert a URL based ISO image
into its Virtual Media CD/DVD device so that on that server's next
reboot will boot and install that image.

This container supports single and multi target configuration files with
IPV4 and IPV6 BMC addressing.

Change-Id: I4d555046800c8d193686b9ef3a2b1e61c13d4ff8
Depends-On: https://review.opendev.org/#/c/700434/
Depends-On: https://review.opendev.org/#/c/700080/
Story: 2006980
Task: 37775
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
This commit is contained in:
Eric MacDonald 2019-12-08 16:35:51 -05:00
parent 6ccd0f4a43
commit 8959d8258d
10 changed files with 1528 additions and 0 deletions

View File

@ -7,3 +7,4 @@ installer/pxe-network-installer
kickstart
inventory
python-inventoryclient
tools/rvmc

View File

@ -0,0 +1 @@
tools/rvmc

View File

@ -0,0 +1,2 @@
TIS_PATCH_VER=1
BUILD_IS_SLOW=5

View File

@ -0,0 +1,16 @@
ARG BASE
FROM ${BASE}
MAINTAINER eric.macdonald@windriver.com
RUN yum install -y iproute python3 pip3 datetime time
RUN pip3 install pyyaml redfish
COPY rvmc.py /usr/local/bin
ENV debug=0
ENV target=None
ENTRYPOINT /usr/local/bin/rvmc.py --target $target --debug $debug
# Execution Examples:
#
# sudo docker run -v /etc/rvmc.yaml:/etc/rvmc.yaml rvmc:latest
# sudo docker run -v /etc/rvmc.yaml:/etc/rvmc.yaml --env target=dcloud1 rvmc:latest
# sudo docker run -v /etc/rvmc.yaml:/etc/rvmc.yaml --env target=dcloud1,dcloud2 rvmc:latest
# sudo docker run -v /etc/rvmc.yaml:/etc/rvmc.yaml --env target=dcloud1,dcloud2 --env debug=1 rvmc:latest

View File

@ -0,0 +1,24 @@
---
apiVersion: batch/v1
kind: Job
metadata:
name: rvmc-subcloud1
spec:
ttlSecondsAfterFinished: 60
activeDeadlineSeconds: 600
backoffLimit: 1
template:
spec:
nodeSelector:
kubernetes.io/hostname: controller-0
containers:
- name: rvmc
image: rvmc:dev-centos-stable-build
volumeMounts:
- mountPath: /etc/rvmc.yaml
name: rvmc-config
volumes:
- name: rvmc-config
hostPath:
path: /etc/rvmc_subcloud1.yaml
restartPolicy: Never

View File

@ -0,0 +1,12 @@
---
virtual_media_iso:
dcloud1:
bmc_address: <bmc ip address>
bmc_username: <bmc username>
bmc_password: <bmc password - base64 encoded >
image: <url address, port and path to image>
dcloud2:
bmc_address: <bmc ip address>
bmc_username: <bmc username>
bmc_password: <bmc password - base64 encoded>
image: <url address, port and path to image>

View File

@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Pod
metadata:
name: rvmc
spec:
nodeSelector:
kubernetes.io/hostname: controller-0
containers:
- name: rvmc
image: rvmc:dev-centos-stable-build
volumeMounts:
- mountPath: /etc/rvmc.yaml
name: rvmc-config
volumes:
- name: rvmc-config
hostPath:
path: /etc/rvmc.yaml
restartPolicy: Never

View File

@ -0,0 +1,5 @@
---
bmc_address: <bmc ip address>
bmc_username: <bmc username>
bmc_password: <bmc password - base64 encoded>
image: <url address, port and path to image>

1446
tools/rvmc/centos/docker/rvmc.py Executable file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
BUILDER=docker
LABEL=rvmc