2024-03-10 06:54:40 +00:00
|
|
|
# clustvirt - Libvirt cluster manager
|
2024-03-10 06:18:10 +00:00
|
|
|
|
2024-03-10 06:54:40 +00:00
|
|
|
Clustered virtualization has gotten to complicated. We have a great system for
|
|
|
|
it built into the Linux kernel, with shared software stacks between whatever
|
|
|
|
base distro you want to use.
|
2024-03-10 06:18:10 +00:00
|
|
|
|
2024-03-10 06:54:40 +00:00
|
|
|
Every other option has buy in, and buzzwords. I want something truly simple that
|
|
|
|
can manage virtual machines on multiple hosts, integrating with existing tools,
|
|
|
|
running from one/all of the hosts, a raspberry pi, or as a guest machine on the
|
|
|
|
cluster itself.
|
2024-03-10 06:18:10 +00:00
|
|
|
|
2024-03-10 06:54:40 +00:00
|
|
|
The mission: Talk to libvirt hosts, coordinate them, manage them, and let people
|
|
|
|
take their clusters back.
|
2024-03-10 06:18:10 +00:00
|
|
|
|
|
|
|
Overall goals:
|
2024-03-10 06:54:40 +00:00
|
|
|
|
2024-03-10 06:18:10 +00:00
|
|
|
- HA Cluster resource manager (simpler then existing options, just for libvirt)
|
|
|
|
- Share secrets
|
|
|
|
- Share VM configs
|
|
|
|
- know what VM is running on what cluster host
|
|
|
|
- trigger migrations of hosts
|
2024-03-10 06:54:40 +00:00
|
|
|
- most simple quorum algorithm possible, ability to run 2 hosts reliably,
|
|
|
|
up to ?? hosts without worry
|
|
|
|
- Simplest quorum: If the controller can't reach it, it's down.
|
2024-03-10 06:18:10 +00:00
|
|
|
- Shared Network management
|
|
|
|
- Shared storage managment
|
|
|
|
- Does not include clustered storage configuration
|
|
|
|
- Can use different clustered storage systems (just not configure them directly)
|
|
|
|
- Reliable backup and snapshotting
|
|
|
|
- The tools exist for this, just needs to be exposed
|
2024-03-10 06:54:40 +00:00
|
|
|
- Install on any libvirt system, as long as the basic requirements are met as
|
|
|
|
far as compatibility is concerned
|
|
|
|
- Should be able to have hosts on RedHat, Rocky, Arch, Ubuntu, Debian,
|
|
|
|
whatever without worry
|
|
|
|
- Cloud-init configuration help to create useful and reusable cloud-init files,
|
|
|
|
that don't need to be used by the system only. It's a standard, use it.
|
|
|
|
|
|
|
|
## Existing tools and libraries to use
|
2024-03-10 06:18:10 +00:00
|
|
|
|
|
|
|
- [https://pkg.go.dev/libvirt.org/go/libvirt] Go Bindings for libvirt
|
2024-03-10 06:54:40 +00:00
|
|
|
- Not sure if it can be used without libvirt existing on the system it's
|
|
|
|
running on. Worth a try.
|
2024-03-10 06:18:10 +00:00
|
|
|
|
2024-03-10 06:54:40 +00:00
|
|
|
## Roadmap
|
2024-03-10 06:18:10 +00:00
|
|
|
|
2024-03-10 06:54:40 +00:00
|
|
|
- Create simple daemon that can run on 1 or more hosts that will keep track of things
|
2024-03-10 06:18:10 +00:00
|
|
|
- Libvirt daemon
|
|
|
|
- Host Capabilities
|
|
|
|
- Migration Capabilities
|
|
|
|
- Secret management
|
|
|
|
- Storage pool management
|
|
|
|
- Volume management
|
|
|
|
- Guest management
|
|
|
|
- Connection management (to other libvirt hosts)
|
2024-03-10 06:54:40 +00:00
|
|
|
- Create a simple WebUI with HTMX to monitor that stuff
|
|
|
|
- Add the ability to manage that stuff once we can monitor it, through the WebUI.
|
2024-03-11 02:32:11 +00:00
|
|
|
|
|
|
|
## Special XMLNS definitions
|
|
|
|
|
|
|
|
### Domain
|
|
|
|
|
|
|
|
- `xmlns:clustvirt="https://git.staur.ca/stobbsm/clustvirt"`
|
|
|
|
|
|
|
|
```xml
|
|
|
|
<metadata>
|
|
|
|
<clustvirt:data xmlns:clustvirt="https://git.staur.ca/stobbsm/clustvirt/">
|
|
|
|
<clustvirt:created>true</clustvirt:created>
|
|
|
|
<clustvirt:managed>true</clustvirt:managed>
|
|
|
|
<clustvirt:currentHost>host01</clustvirt:currentHost>
|
|
|
|
<clustvirt:origHost>host02</clustvirt:origHost>
|
|
|
|
<clustvirt:baseGuest>rocky-9-base</clustvirt:baseGuest>
|
|
|
|
</clustvirt:data>
|
|
|
|
</metadata>
|
|
|
|
```
|
2024-03-19 04:38:28 +00:00
|
|
|
|
|
|
|
### Open Source Projects
|
|
|
|
|
|
|
|
The following projects are being used as part of ClustVirt.
|
|
|
|
Only those being used directly are listed, not the dependencies.
|
|
|
|
|
|
|
|
#### Go
|
|
|
|
|
|
|
|
| Library | Use | License |
|
|
|
|
| --- | --- | --- |
|
|
|
|
| [xdg](https://github.com/adrg/xdg) | XDG paths | MIT |
|
|
|
|
| [spf13/viper](https://github.com/spf13/viper) | Configuration | MIT |
|
|
|
|
| [spf13](https://github.com/spf13/cobra) | Command Pattern CLI | Apache 2.0 |
|
|
|
|
| [go-chart/v2](https://github.com/wcharczuk/go-chart) | Chart generation | MIT |
|
|
|
|
| [libvirt](https://libvirt.org/go/libvirt) | Communications with Libvirtd | MIT |
|
|
|
|
| [libvirtxml](https://libvirt.org/go/libvirtxml) | Libvirt XML parsing and generation | MIT |
|
|
|
|
| [templ](https://github.com/a-h/templ) | HTML Templating Engine | MIT |
|
|
|
|
| [chi/v5](https://github.com/go-chi/chi) | HTTP Routing | MIT |
|
|
|
|
|
|
|
|
#### Node NPM
|
|
|
|
|
|
|
|
| Library | Use | License |
|
|
|
|
| --- | --- | ------- |
|
|
|
|
| [tailwindcss](https://tailwindcss.com) | CSS UI library | MIT |
|
|
|
|
| [tailwindcss/forms](https://tailwindcss.com) | CSS UI library for forms | MIT |
|