Skip to content

Containerized VirtualBMC for vSphere

kurokobo edited this page Oct 1, 2022 · 7 revisions

The VirtualBMC for vSphere can also work with Docker containers.

The container image is available at my GitHub Container Registory. Of course, you can customize and build your own image with the Dockerfile.

There is also docker-compose.yml file that can be used with Docker Compose.

Example: docker commands

# Start vBMC contaier in detached mode:
$ docker run -d --name vbmc4vsphere -p "6231:6231/udp" -p "6232:6232/udp" -p "6233:6233/udp" -v vsbmc-volume:/vsbmc ghcr.io/kurokobo/vbmc4vsphere:0.3.0

# Create new virtual BMCs:
$ docker exec -it vbmc4vsphere vsbmc add kuro-vkvm91 --port 6231 --viserver 192.168.0.201 --viserver-username [email protected] --viserver-password Vmware123!
$ docker exec -it vbmc4vsphere vsbmc add kuro-vkvm92 --port 6232 --viserver 192.168.0.201 --viserver-username [email protected] --viserver-password Vmware123!
$ docker exec -it vbmc4vsphere vsbmc add kuro-vkvm93 --port 6233 --viserver 192.168.0.201 --viserver-username [email protected] --viserver-password Vmware123!

# Start virtual BMCs:
$ docker exec -it vbmc4vsphere vsbmc start kuro-vkvm91
$ docker exec -it vbmc4vsphere vsbmc start kuro-vkvm92
$ docker exec -it vbmc4vsphere vsbmc start kuro-vkvm93

# Get the list of virtual BMCs:
$ docker exec -it vbmc4vsphere vsbmc list

Example: docker compose commands

# Download docker-compose.yml and start vBMC contaier in detached mode:
$ curl -O https://raw.githubusercontent.com/kurokobo/virtualbmc-for-vsphere/main/docker/docker-compose.yml
$ docker compose up -d

# Create new virtual BMCs:
$ docker compose exec vbmc4vsphere vsbmc add kuro-vkvm91 --port 6231 --viserver 192.168.0.201 --viserver-username [email protected] --viserver-password Vmware123!
$ docker compose exec vbmc4vsphere vsbmc add kuro-vkvm92 --port 6232 --viserver 192.168.0.201 --viserver-username [email protected] --viserver-password Vmware123!
$ docker compose exec vbmc4vsphere vsbmc add kuro-vkvm93 --port 6233 --viserver 192.168.0.201 --viserver-username [email protected] --viserver-password Vmware123!

# Start virtual BMCs:
$ docker compose exec vbmc4vsphere vsbmc start kuro-vkvm91
$ docker compose exec vbmc4vsphere vsbmc start kuro-vkvm92
$ docker compose exec vbmc4vsphere vsbmc start kuro-vkvm93

# Get the list of virtual BMCs:
$ docker compose exec vbmc4vsphere vsbmc list

Example: Build your own container image

# Download Dockerfile:
$ curl -O https://raw.githubusercontent.com/kurokobo/virtualbmc-for-vsphere/main/docker/Dockerfile

# Build new container image with tag
$ docker build -t vbmc4vsphere:0.0.0 .

Consideration: Port binding

You have to determine which port on the container host will be listening for IPMI commands and bind it properly to the port the vBMC is listening for in the container.

This container image does not expose any ports by default. All binding of the ports to be used must be specified in the -p option or docker-compose.yml file.

Please note IPMI will use UDP instead of TCP. Therefore you have to add the strings /udp with your port binding as shown in the above example.

Consideration: Data persistence

All vBMC information that you added is stored under the path /vsbmc/.vsbmc in the container.

By mounting this path by your volume with -v option or docker-compose.yml file, the stored information can be persisted outside the container.