Browse Source

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>
changes/92/697892/11
Eric MacDonald 2 years ago
parent
commit
8959d8258d
  1. 1
      centos_pkg_dirs
  2. 1
      centos_stable_docker_images.inc
  3. 2
      tools/rvmc/centos/build_srpm.data
  4. 16
      tools/rvmc/centos/docker/Dockerfile
  5. 24
      tools/rvmc/centos/docker/examples/rvmc_job.yaml
  6. 12
      tools/rvmc/centos/docker/examples/rvmc_multi_target_config_example.yaml
  7. 19
      tools/rvmc/centos/docker/examples/rvmc_pod.yaml
  8. 5
      tools/rvmc/centos/docker/examples/rvmc_single_target_config_example.yaml
  9. 1446
      tools/rvmc/centos/docker/rvmc.py
  10. 2
      tools/rvmc/centos/rvmc.stable_docker_image

1
centos_pkg_dirs

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

1
centos_stable_docker_images.inc

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

2
tools/rvmc/centos/build_srpm.data

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

16
tools/rvmc/centos/docker/Dockerfile

@ -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

24
tools/rvmc/centos/docker/examples/rvmc_job.yaml

@ -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

12
tools/rvmc/centos/docker/examples/rvmc_multi_target_config_example.yaml

@ -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>

19
tools/rvmc/centos/docker/examples/rvmc_pod.yaml

@ -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

5
tools/rvmc/centos/docker/examples/rvmc_single_target_config_example.yaml

@ -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

File diff suppressed because it is too large

2
tools/rvmc/centos/rvmc.stable_docker_image

@ -0,0 +1,2 @@
BUILDER=docker
LABEL=rvmc
Loading…
Cancel
Save