Sets default VM disk size to 12GB
This commit is contained in:
parent
a6fa0b22cf
commit
05b0e08ee0
1 changed files with 13 additions and 0 deletions
13
main.go
13
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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue