Skip to content

Commit

Permalink
Don't ignore VM power on errors. This prevents Terraform from hanging…
Browse files Browse the repository at this point in the history
… indefinitely for the VM to power on. (#11604)
  • Loading branch information
darrenswhite authored and stack72 committed Feb 1, 2017
1 parent ab36571 commit 4cbd006
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,14 @@ func (vm *virtualMachine) setupVirtualMachine(c *govmomi.Client) error {
}

if vm.hasBootableVmdk || vm.template != "" {
newVM.PowerOn(context.TODO())
t, err := newVM.PowerOn(context.TODO())
if err != nil {
return err
}
_, err = t.WaitForResult(context.TODO(), nil)
if err != nil {
return err
}
err = newVM.WaitForPowerState(context.TODO(), types.VirtualMachinePowerStatePoweredOn)
if err != nil {
return err
Expand Down

0 comments on commit 4cbd006

Please sign in to comment.