kinda works

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-26 10:34:26 -05:00
parent 636068c5b7
commit 5406da8e75
2 changed files with 9 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import (
)
// generate the XML for 'virsh create'
func StartDropletXml(d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) {
func StartDropletXml(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) {
/*
if d == nil {
log.Info("droplet is nil")
@ -70,8 +70,14 @@ func StartDropletXml(d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string)
// add a check here to make these unique
// setRandomMacs(domcfg)
if len(cluster.Dirs) == 0 {
log.Info("ERROR: cluster dirs was empty. adding default location.")
log.Info("add paths to search for in ~/.config/virtigo/cluster.text")
cluster.Dirs = append(cluster.Dirs, "/var/libvirt/images")
}
log.Info("Should look in cluster dirs:", cluster.Dirs)
for _, disk := range d.Disks {
fullname := findDisk([]string{"/home/nfs2", "/var/lib/libvirt/images"}, disk.Filename)
fullname := findDisk(cluster.Dirs, disk.Filename)
if fullname == "" {
log.Info("can not find disk", d.Hostname, "dir", disk.Filepath, "filename", disk.Filename)
os.Exit(-1)

View File

@ -167,6 +167,7 @@ func CheckDiskFilenames(cluster *pb.Cluster) []*pb.Event {
return alle
}
// this doesn't run often
func CheckDroplets(cluster *pb.Cluster, dump bool) bool {
// uuid map to check for duplicates
var umap map[string]string