Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions content/kubevirt/virtual-bmc/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
title: Virtual BMC
linktitle: Virtual BMC
description: Virtual BMC with VM's on KubeVirt / OCP-V
tags: ['cnv', 'kubevirt','ocp-v','v4.18','bmc','fakefish']
---
# Virtual BMC with VM's on KubeVirt / OCP-V

Two options available, lets go with fakefish:

* https://github.com/starbops/kubevirtbmc
* NEW: https://github.com/v1k0d3n/kubevirt-redfish
* https://github.com/openshift-metal3/fakefish/tree/main/kubevirt_scripts

Tested with:

|Component|Version|
|---|---|
|OpenShift|v4.18|
|OpenShift Virt|v4.18|

## Simple single VM example

```shell
export HOST="ff-node-oi5cyy-rbohne-fakefish.apps.isar.coe.muc.redhat.com"
export ISO_URL=http://tinycorelinux.net/16.x/x86/release/Core-current.iso

curl -s https://$HOST/redfish/v1/Systems | jq -r

curl -s https://$HOST/redfish/v1/Managers/1/VirtualMedia/Cd | jq '[{iso_connected: .Inserted}]'


curl -d \
'{"Image":"'"$ISO_URL"'", "Inserted": true}' \
-H "Content-Type: application/json" \
-X POST \
https://$HOST/redfish/v1/Managers/1/VirtualMedia/Cd/Actions/VirtualMedia.InsertMedia


curl -s -d '{"ResetType":"Off"}' \
-H "Content-Type: application/json" -X POST \
https://$HOST/redfish/v1/Systems/1/Actions/ComputerSystem.Reset


```

62 changes: 62 additions & 0 deletions content/kubevirt/virtual-bmc/install-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: v1
baseDomain: coe.muc.redhat.com
cpuPartitioningMode: None
compute:
- architecture: amd64
hyperthreading: Enabled
name: worker
platform: {}
replicas: 0
controlPlane:
architecture: amd64
hyperthreading: Enabled
name: master
platform: {}
replicas: 3
metadata:
creationTimestamp: null
name: rbohne-fakefish
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
machineNetwork:
- cidr: 10.32.96.0/20
networkType: OVNKubernetes
serviceNetwork:
- 172.30.0.0/16
platform:
baremetal:
hosts:
- name: node-0tfcw7
role: master
BootMACAddress: 02:d8:6d:00:00:4a
bmc:
address: redfish://ff-node-0tfcw7-rbohne-fakefish.apps.isar.coe.muc.redhat.com/redfish/v1/Systems/1
username: "fakefish"
password: "fakefish"
disableCertificateVerification: True
- name: node-ovacww
role: master
BootMACAddress: 02:d8:6d:00:00:4b
bmc:
address: redfish://ff-node-ovacww-rbohne-fakefish.apps.isar.coe.muc.redhat.com/redfish/v1/Systems/1
username: "fakefish"
password: "fakefish"
disableCertificateVerification: True
- name: node-puyubl
role: master
BootMACAddress: 02:d8:6d:00:00:4c
bmc:
address: redfish://ff-node-puyubl-rbohne-fakefish.apps.isar.coe.muc.redhat.com/redfish/v1/Systems/1
username: "fakefish"
password: "fakefish"
disableCertificateVerification: True
apiVIPs:
- "10.32.98.7"
ingressVIPs:
- "10.32.98.8"
publish: External
pullSecret: ...
sshKey: |
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEQM82o2imwpHyGVO7DxCNbdE0ZWnkp6oxdawb7/MOCT coe-muc
124 changes: 124 additions & 0 deletions content/kubevirt/virtual-bmc/node-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: ocp-node
objects:
- apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ff-${NAME}
name: ff-${NAME}
spec:
replicas: 1
selector:
matchLabels:
app: ff-${NAME}
strategy: {}
template:
metadata:
labels:
app: ff-${NAME}
spec:
automountServiceAccountToken: true
serviceAccountName: fakefish
containers:
- image: quay.io/rbohne/fakefish:kubevirt-20250519T133755

Check failure on line 26 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

26:11 [indentation] wrong indentation: expected 12 but found 10
name: fakefish
resources: {}
args:
- "--remote-bmc"

Check failure on line 30 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

30:13 [indentation] wrong indentation: expected 14 but found 12
- ${NAME}_${NAMESPACE}
- "--tls-mode"
- "disabled"
- apiVersion: v1
kind: Service
metadata:
labels:
app: ff-${NAME}
name: ff-${NAME}
spec:
ports:
- name: http

Check failure on line 42 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

42:7 [indentation] wrong indentation: expected 8 but found 6
port: 9000
protocol: TCP
targetPort: 9000
selector:
app: ff-${NAME}
type: ClusterIP

- apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ff-${NAME}
spec:
port:
targetPort: http
tls:
termination: edge
to:
kind: "Service"
name: ff-${NAME}
weight: null
- apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
annotations:
name: ${NAME}
namespace: ${NAMESPACE}
spec:
dataVolumeTemplates:
- metadata:

Check failure on line 71 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

71:7 [indentation] wrong indentation: expected 8 but found 6
creationTimestamp: null
name: ${NAME}-root
spec:
source:
blank: {}
storage:
accessModes:
- ReadWriteMany

Check failure on line 79 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

79:13 [indentation] wrong indentation: expected 14 but found 12
resources:
requests:
storage: 120Gi
storageClassName: ocs-storagecluster-ceph-rbd-virtualization
runStrategy: Manual
template:
spec:
architecture: amd64
domain:
cpu:
cores: 16
devices:
disks:
- disk:

Check failure on line 93 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

93:15 [indentation] wrong indentation: expected 16 but found 14
bus: virtio
name: root
interfaces:
- bridge: {}

Check failure on line 97 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

97:15 [indentation] wrong indentation: expected 16 but found 14
model: virtio
name: coe
machine:
type: pc-q35-rhel9.4.0
memory:
guest: 32Gi
resources:
limits:
memory: 33188Mi
requests:
memory: 32Gi
networks:
- multus:

Check failure on line 110 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

110:11 [indentation] wrong indentation: expected 12 but found 10
networkName: coe-bridge
name: coe
volumes:
- dataVolume:

Check failure on line 114 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

114:11 [indentation] wrong indentation: expected 12 but found 10
name: ${NAME}-root
name: root
parameters:
- description: VM name

Check failure on line 118 in content/kubevirt/virtual-bmc/node-template.yaml

View workflow job for this annotation

GitHub Actions / pre-commit-and-deploy

118:1 [indentation] wrong indentation: expected 2 but found 0
from: node-[a-z0-9]{6}
generate: expression
name: NAME
- description: Namespace of the DataSource
name: NAMESPACE
required: true
58 changes: 58 additions & 0 deletions content/kubevirt/virtual-bmc/single-vm-vbmc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: fakefish-single-vm
name: fakefish-single-vm
spec:
replicas: 1
selector:
matchLabels:
app: fakefish-single-vm
strategy: {}
template:
metadata:
labels:
app: fakefish-single-vm
spec:
automountServiceAccountToken: true
serviceAccountName: fakefish
containers:
- image: quay.io/rbohne/fakefish:kubevirt-20250519T133755
name: fakefish
resources: {}
args:
- "--remote-bmc"
- "single-vm_rbohne-fakefish"
- "--tls-mode"
- "disabled"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: fakefish-single-vm
name: fakefish-single-vm
spec:
ports:
- name: http
port: 9000
protocol: TCP
targetPort: 9000
selector:
app: fakefish-single-vm
type: ClusterIP
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: fakefish-single-vm
spec:
port:
targetPort: http
tls:
termination: edge
to:
kind: "Service"
name: fakefish-single-vm
weight: null
40 changes: 40 additions & 0 deletions content/kubevirt/virtual-bmc/single-vm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: kubevirt.io/v1
kind: VirtualMachine
metadata:
labels:
kubevirt.io/vm: single-vm
name: single-vm
spec:
dataVolumeTemplates:
- apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: single-vm-root
spec:
source:
blank: {}
storage:
resources:
requests:
storage: 30Gi
runStrategy: Manual
template:
metadata:
labels:
kubevirt.io/vm: single-vm
tentant: tentant
spec:
domain:
devices:
disks:
- disk:
bus: virtio
name: rootdisk
resources:
requests:
memory: 1024Mi
terminationGracePeriodSeconds: 0
volumes:
- dataVolume:
name: single-vm-root
name: rootdisk