parent
a2190048af
commit
69a8b35a14
14
start.go
14
start.go
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// generate the XML for 'virsh create'
|
// generate the XML for 'virsh create'
|
||||||
func GenerateDropletXml(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) error {
|
func GenerateDropletXml(dirs []string, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) error {
|
||||||
/*
|
/*
|
||||||
if d == nil {
|
if d == nil {
|
||||||
log.Info("droplet is nil")
|
log.Info("droplet is nil")
|
||||||
|
@ -70,14 +70,14 @@ func GenerateDropletXml(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.D
|
||||||
// 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 {
|
if len(dirs) == 0 {
|
||||||
log.Info("ERROR: cluster dirs was empty. adding default location.")
|
dirs = append(dirs, "/home/nfs2")
|
||||||
log.Info("add paths to search for in ~/.config/virtigo/cluster.text")
|
dirs = append(dirs, "/home/nfs3")
|
||||||
cluster.Dirs = append(cluster.Dirs, "/var/libvirt/images")
|
dirs = append(dirs, "/var/lib/libvirt/images")
|
||||||
}
|
}
|
||||||
log.Info("Should look in cluster dirs:", cluster.Dirs)
|
log.Info("Should look in dirs:", dirs)
|
||||||
for _, disk := range d.Disks {
|
for _, disk := range d.Disks {
|
||||||
fullname := findDisk(cluster.Dirs, disk.Filename)
|
fullname := findDisk(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)
|
||||||
|
|
Loading…
Reference in New Issue