@@ -16,10 +16,10 @@ This tool is under active development.
1616| VM management (create/delete/list) | ✅ Implemented |
1717| ` vbmctl create bml ` / ` vbmctl delete bml ` | ✅ Implemented |
1818| ` vbmctl status ` | ✅ Implemented (basic) |
19- | Configurable volumes | ❌ TODO (hard-coded to two per VM) |
19+ | Configurable volumes | ✅ Implemented |
2020| Network management | ⚠️ Partially implemented (only libvirt networks) |
2121| BMC emulator support | ❌ TODO |
22- | Image server | ❌ TODO |
22+ | Image server | ✅ Implemented (basic) |
2323| State management (persistent state) | ❌ TODO |
2424
2525## Features
@@ -30,6 +30,7 @@ This tool is under active development.
3030 libvirt networks
3131- ** Library Support** : Can be imported as a Go module for programmatic use
3232- ** Libvirt network management** : create and delete libvirt networks
33+ - ** Image Server Management** : Create, delete, list image server
3334
3435## Build Tags
3536
@@ -77,6 +78,10 @@ vbmctl create vm \
7778# Create a bare metal lab (all VMs and networks defined in spec.vms of the config file)
7879vbmctl create bml
7980
81+ # Create an image server with default settings. Please note that if
82+ # a name is specified, vbmctl will automatically add the prefix `vbmctl-`.
83+ vbmctl create image-server
84+
8085# Check status
8186vbmctl status
8287
@@ -89,6 +94,9 @@ vbmctl delete bml
8994# Create network with default values
9095vbmctl delete network
9196
97+ # Delete the image server
98+ vbmctl delete image-server
99+
92100# Show help
93101vbmctl --help
94102```
@@ -157,6 +165,9 @@ spec:
157165 bridge : metal3
158166 address : 192.168.222.1
159167 netmask : 255.255.255.0
168+ imageServer :
169+ dataDir : " /tmp"
170+ port : 80
160171` ` `
161172
162173The ` spec.vms` section defines the VMs that will be created when you run `vbmctl
@@ -175,6 +186,7 @@ import (
175186
176187 "github.com/metal3-io/baremetal-operator/test/vbmctl/pkg/api"
177188 "github.com/metal3-io/baremetal-operator/test/vbmctl/pkg/libvirt"
189+ "github.com/metal3-io/baremetal-operator/test/vbmctl/pkg/containers"
178190 libvirtgo "libvirt.org/go/libvirt"
179191)
180192
@@ -233,6 +245,19 @@ func main() {
233245 log.Fatal(err)
234246 }
235247
248+ // Create an Image Server
249+ err = containers.CreateImageServerInstance(ctx, &api.ImageServerConfig{
250+ Image: "nginx:latest",
251+ ContainerName: "image-server",
252+ DataDir: "/var/lib/vbmctl/images",
253+ ContainerDataDir: "/usr/share/nginx/html",
254+ Port: 8080,
255+ ContainerPort: 80,
256+ })
257+ if err != nil {
258+ log.Fatal(err)
259+ }
260+
236261 fmt.Printf("Created VM: %s (UUID: %s)\n ", vm.Config.Name, vm.UUID)
237262}
238263` ` `
0 commit comments