metal3-io / baremetal-operator

Bare metal host provisioning integration for Kubernetes
Apache License 2.0
585 stars 255 forks source link

E2E: Make go tool for creating BMH VMs #1560

Closed lentzi90 closed 3 months ago

lentzi90 commented 8 months ago

User Story

As a developer I would like to have a go module for creating virtualized BMHs, so that this can be easily reused and consumed between repos and scripts.

Detailed Description

Similar to make-virt-host, convert the scripts that we use into a go tool that can be reused for e2e tests, tilt setup and (in the future) CAPM3. The currently used scripts work well but are tricky to reuse. It is doable for e2e and tilt so far but it would be much nicer to have a proper go module for it. That module could then be used also by projects building on BMO, e.g. CAPM3, not to mention downstream projects and "testing environments".

At a high level, I want to be able to

  1. go install a binary for creating VMs that can be used as BMHs
  2. import a go module to do the same in go code
  3. specify some basic parameters for how to configure the VMs (amount of VMs to create, CPU, RAM, disk size, MAC, etc). Some kind of config file would probably make sense for this.

Anything else you would like to add:

I think this is the library we should use: https://gitlab.com/libvirt/libvirt-go-module

/kind feature

lentzi90 commented 8 months ago

/cc @Rozzii /triage accepted

metal3-io-bot commented 5 months ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues will close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

/lifecycle stale

mquhuy commented 5 months ago

/remove-lifecycle stale

Rozzii commented 5 months ago

@lentzi90 should we either reword this or should we create a separate for the KubeVirt approach (if it doesn't exist already, I haven't checked) . As far as I understand right now the main goal would be to bring kube-virt into our dev-env and e2e tests to handle the VMs.

lentzi90 commented 5 months ago

I can create a separate for kubevirt, but there is work needed on the kubevirt side before we can start using it. Until we have that, I think this is a good alternative that we could do pretty quickly if prioritized.

mquhuy commented 5 months ago

/assign

mquhuy commented 5 months ago

Hi @lentzi90, did you mean to refer to this script instead?

lentzi90 commented 5 months ago

Well, the script I linked to calls the script you linked but it also does a few more things that we would need. The go tool would need to do these things also, e.g. handle the network and adding the VMs to sushy-tools or VBMC

mquhuy commented 5 months ago

Well, the script I linked to calls the script you linked but it also does a few more things that we would need. The go tool would need to do these things also, e.g. handle the network and adding the VMs to sushy-tools or VBMC

Thanks. I just want to make sure, since the script you linked doesn't seem to be needed for tilt setup. Anyway, all the functionalities can fit well in the same module, and we can just call what we need.