Don't ignore VM power on errors. This prevents Terraform from hanging indefinitely for the VM to power on. (#11604)

This commit is contained in:
Darren White 2017-02-01 14:31:40 +00:00 committed by Paul Stack
parent ab36571766
commit 4cbd006268
1 changed files with 8 additions and 1 deletions

View File

@ -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