try building a package
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
69a8b35a14
commit
255ffc9488
|
@ -8,9 +8,9 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
pb "go.wit.com/lib/protobuf/virtbuf"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
"libvirt.org/go/libvirtxml"
|
"libvirt.org/go/libvirtxml"
|
||||||
pb "go.wit.com/lib/protobuf/virtbuf"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// import a libvirt xml file
|
// import a libvirt xml file
|
||||||
|
@ -298,9 +298,9 @@ func updateNetwork(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.Domain
|
||||||
}
|
}
|
||||||
if eth.Name != brname {
|
if eth.Name != brname {
|
||||||
// if argv.IgnoreBr {
|
// if argv.IgnoreBr {
|
||||||
log.Info("network was:", eth.Mac, eth.Name)
|
log.Info("network was:", eth.Mac, eth.Name)
|
||||||
log.Info("network now:", eth.Mac, brname)
|
log.Info("network now:", eth.Mac, brname)
|
||||||
log.Info("ignoring network change (--xml-ignore-net)")
|
log.Info("ignoring network change (--xml-ignore-net)")
|
||||||
// } else {
|
// } else {
|
||||||
// return nil, errors.New("bridge name changed")
|
// return nil, errors.New("bridge name changed")
|
||||||
// }
|
// }
|
||||||
|
|
21
start.go
21
start.go
|
@ -3,6 +3,7 @@
|
||||||
package virtigoxml
|
package virtigoxml
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -15,21 +16,9 @@ import (
|
||||||
|
|
||||||
// generate the XML for 'virsh create'
|
// generate the XML for 'virsh create'
|
||||||
func GenerateDropletXml(dirs []string, 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 {
|
return errors.New("*droplet == nil")
|
||||||
log.Info("droplet is nil")
|
}
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
log.Info("start droplet here:", d.Hostname)
|
|
||||||
domcfg := &libvirtxml.Domain{}
|
|
||||||
|
|
||||||
addDefaultXml(domcfg, "standard.x86")
|
|
||||||
// addDefaultXml(domcfg, "memory")
|
|
||||||
// addDefaultXml(domcfg, "network")
|
|
||||||
addDefaultXml(domcfg, "spice")
|
|
||||||
addDefaultXml(domcfg, "qcow")
|
|
||||||
*/
|
|
||||||
|
|
||||||
domcfg.Type = "kvm"
|
domcfg.Type = "kvm"
|
||||||
domcfg.Name = d.Hostname
|
domcfg.Name = d.Hostname
|
||||||
domcfg.UUID = d.Uuid
|
domcfg.UUID = d.Uuid
|
||||||
|
@ -71,9 +60,9 @@ func GenerateDropletXml(dirs []string, d *pb.Droplet, domcfg *libvirtxml.Domain,
|
||||||
// setRandomMacs(domcfg)
|
// setRandomMacs(domcfg)
|
||||||
|
|
||||||
if len(dirs) == 0 {
|
if len(dirs) == 0 {
|
||||||
|
dirs = append(dirs, "/var/lib/libvirt/images")
|
||||||
dirs = append(dirs, "/home/nfs2")
|
dirs = append(dirs, "/home/nfs2")
|
||||||
dirs = append(dirs, "/home/nfs3")
|
dirs = append(dirs, "/home/nfs3")
|
||||||
dirs = append(dirs, "/var/lib/libvirt/images")
|
|
||||||
}
|
}
|
||||||
log.Info("Should look in dirs:", dirs)
|
log.Info("Should look in dirs:", dirs)
|
||||||
for _, disk := range d.Disks {
|
for _, disk := range d.Disks {
|
||||||
|
|
Loading…
Reference in New Issue