builder/virtualbox: actually attach the hard drive
This commit is contained in:
parent
7a9499e1f0
commit
c1c9204ee8
|
@ -1,9 +1,11 @@
|
|||
package virtualbox
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"log"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -46,13 +48,18 @@ func (d *VBox42Driver) SuppressMessages() error {
|
|||
}
|
||||
|
||||
func (d *VBox42Driver) VBoxManage(args ...string) error {
|
||||
var stdout, stderr bytes.Buffer
|
||||
|
||||
log.Printf("Executing VBoxManage: %#v", args)
|
||||
cmd := exec.Command(d.VBoxManagePath, args...)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return err
|
||||
}
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
err := cmd.Run()
|
||||
|
||||
return nil
|
||||
log.Printf("stdout: %s", strings.TrimSpace(stdout.String()))
|
||||
log.Printf("stderr: %s", strings.TrimSpace(stderr.String()))
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (d *VBox42Driver) Verify() error {
|
||||
|
|
|
@ -27,7 +27,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
|
|||
command := []string{
|
||||
"createhd",
|
||||
"--filename", path,
|
||||
"--size", "40",
|
||||
"--size", "40000",
|
||||
"--format", format,
|
||||
"--variant", "Standard",
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
|
|||
|
||||
// Attach the disk to the controller
|
||||
command = []string{
|
||||
"storagectl", vmName,
|
||||
"storageattach", vmName,
|
||||
"--storagectl", controllerName,
|
||||
"--port", "0",
|
||||
"--device", "0",
|
||||
|
|
Loading…
Reference in New Issue