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:
parent
ab36571766
commit
4cbd006268
|
@ -2110,7 +2110,14 @@ func (vm *virtualMachine) setupVirtualMachine(c *govmomi.Client) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if vm.hasBootableVmdk || vm.template != "" {
|
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)
|
err = newVM.WaitForPowerState(context.TODO(), types.VirtualMachinePowerStatePoweredOn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue