2024-03-10 07:15:49 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
log.Println("Starting clustvirt, the libvirt cluster manager")
|
|
|
|
|
|
|
|
// Try connecting to libvirt
|
2024-03-11 02:32:11 +00:00
|
|
|
doms, err := GetDomsInCluster("earth.staur.ca", "mars.staur.ca", "venus.staur.ca")
|
2024-03-10 07:15:49 +00:00
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2024-03-11 02:32:11 +00:00
|
|
|
log.Printf("Domains in cluster: %d", len(doms))
|
|
|
|
// Example of xmlns uri found in libvirt xml definition:
|
|
|
|
// xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"
|
|
|
|
for _, d := range doms {
|
|
|
|
log.Println(d.GetMetadata(0, "", 0))
|
|
|
|
d.Free()
|
2024-03-10 07:15:49 +00:00
|
|
|
}
|
|
|
|
}
|