From 05b0e08ee03a4bd7040bc5e9a5327ed28d1f6dcb Mon Sep 17 00:00:00 2001 From: markmental Date: Mon, 15 Dec 2025 18:49:40 -0500 Subject: [PATCH] Sets default VM disk size to 12GB --- main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.go b/main.go index 33072da..212c6fb 100644 --- a/main.go +++ b/main.go @@ -19,6 +19,8 @@ const ( memMB = "1024" cpus = "1" + + baseDiskSize = "12G" ) type OSImage struct { @@ -330,6 +332,17 @@ func createVM(name, osName, pubKeyPath string) { panic(string(out)) } + resizeCmd := exec.Command( + "qemu-img", "resize", + diskPath(name), + baseDiskSize, + ) + + if out, err := resizeCmd.CombinedOutput(); err != nil { + panic("disk resize failed:\n" + string(out)) + } + + createCloudInitSeed(name, osName, vmPubKeyPath(name)) fmt.Println("VM created:", name, "OS:", osName) }