parent
636068c5b7
commit
5406da8e75
10
start.go
10
start.go
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// generate the XML for 'virsh create'
|
// 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 {
|
if d == nil {
|
||||||
log.Info("droplet is 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
|
// add a check here to make these unique
|
||||||
// setRandomMacs(domcfg)
|
// 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 {
|
for _, disk := range d.Disks {
|
||||||
fullname := findDisk([]string{"/home/nfs2", "/var/lib/libvirt/images"}, disk.Filename)
|
fullname := findDisk(cluster.Dirs, disk.Filename)
|
||||||
if fullname == "" {
|
if fullname == "" {
|
||||||
log.Info("can not find disk", d.Hostname, "dir", disk.Filepath, "filename", disk.Filename)
|
log.Info("can not find disk", d.Hostname, "dir", disk.Filepath, "filename", disk.Filename)
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
|
|
|
@ -167,6 +167,7 @@ func CheckDiskFilenames(cluster *pb.Cluster) []*pb.Event {
|
||||||
return alle
|
return alle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this doesn't run often
|
||||||
func CheckDroplets(cluster *pb.Cluster, dump bool) bool {
|
func CheckDroplets(cluster *pb.Cluster, dump bool) bool {
|
||||||
// uuid map to check for duplicates
|
// uuid map to check for duplicates
|
||||||
var umap map[string]string
|
var umap map[string]string
|
||||||
|
|
Loading…
Reference in New Issue