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) }