Sets default VM disk size to 12GB

This commit is contained in:
markmental 2025-12-15 18:49:40 -05:00
commit 05b0e08ee0

13
main.go
View file

@ -19,6 +19,8 @@ const (
memMB = "1024" memMB = "1024"
cpus = "1" cpus = "1"
baseDiskSize = "12G"
) )
type OSImage struct { type OSImage struct {
@ -330,6 +332,17 @@ func createVM(name, osName, pubKeyPath string) {
panic(string(out)) 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)) createCloudInitSeed(name, osName, vmPubKeyPath(name))
fmt.Println("VM created:", name, "OS:", osName) fmt.Println("VM created:", name, "OS:", osName)
} }