parent
a2190048af
commit
69a8b35a14
14
start.go
14
start.go
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
// 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 {
|
||||
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
|
||||
// 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")
|
||||
if len(dirs) == 0 {
|
||||
dirs = append(dirs, "/home/nfs2")
|
||||
dirs = append(dirs, "/home/nfs3")
|
||||
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 {
|
||||
fullname := findDisk(cluster.Dirs, disk.Filename)
|
||||
fullname := findDisk(dirs, disk.Filename)
|
||||
if fullname == "" {
|
||||
log.Info("can not find disk", d.Hostname, "dir", disk.Filepath, "filename", disk.Filename)
|
||||
os.Exit(-1)
|
||||
|
|
Loading…
Reference in New Issue