From 14dadbcf3ce8d732354d2c4ef30f3374f80950f9 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 18 Oct 2024 06:00:05 -0500 Subject: write out xml file for virsh create (maybe?) Signed-off-by: Jeff Carr --- Makefile | 1 + main.go | 5 +- resources/xml/go.wit.com.xml | 191 +++++++++++++++++++++++++++++++++++++++++ resources/xml/jcarr.xml | 4 + resources/xml/memory.xml | 4 + resources/xml/network.xml | 10 +++ resources/xml/qcow.xml | 11 +++ resources/xml/spice.xml | 9 ++ resources/xml/standard.x86.xml | 173 +++++++++++++++++++++++++++++++++++++ xml.go | 58 +++++++++++++ 10 files changed, 464 insertions(+), 2 deletions(-) create mode 100644 resources/xml/go.wit.com.xml create mode 100644 resources/xml/jcarr.xml create mode 100644 resources/xml/memory.xml create mode 100644 resources/xml/network.xml create mode 100644 resources/xml/qcow.xml create mode 100644 resources/xml/spice.xml create mode 100644 resources/xml/standard.x86.xml create mode 100644 xml.go diff --git a/Makefile b/Makefile index a954867..8450c66 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,7 @@ all: GO111MODULE=off go build -v -ldflags "-X main.Version=${VERSION} -X gui.GUIVERSION=${VERSION}" ./virtigo --version ./virtigo --hosts farm01 farm02 farm03 + ./virtigo --start jcarr start-all-droplets: curl --silent http://localhost:8080/start?start=git.wit.org diff --git a/main.go b/main.go index 671c935..1c62669 100644 --- a/main.go +++ b/main.go @@ -49,9 +49,10 @@ func main() { d := findDroplet(argv.Start) if d == nil { log.Info("droplet is unknown:", argv.Start) - } else { - log.Info("start droplet here:", d.Hostname) + os.Exit(0) } + log.Info("start droplet here:", d.Hostname) + makeXml(d) os.Exit(0) } diff --git a/resources/xml/go.wit.com.xml b/resources/xml/go.wit.com.xml new file mode 100644 index 0000000..b4f7bbc --- /dev/null +++ b/resources/xml/go.wit.com.xml @@ -0,0 +1,191 @@ + + go.wit.com + 9e795cd7-7142-4757-bef2-f607b4f9944f + + + + + + 2097152 + 2097152 + 2 + + /machine + + + hvm + + + + + + + + + + + + + + destroy + restart + destroy + + + + + + /usr/bin/qemu-system-x86_64 + + + + + +
+ + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + +
+ + +
+ + +
+ + +
+ + + + + +
+ + + + + + + + + + + +
+ + + +
+ + +
+ + + + + + + +
+ +