Commit 6c44d721 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Merge pull request #1403 from notogawa/issue-1334

Fixes #1334, Add power on retry to ESXi Driver.
parents e422a454 eacae832
......@@ -57,7 +57,21 @@ func (d *ESX5Driver) IsRunning(string) (bool, error) {
}
func (d *ESX5Driver) Start(vmxPathLocal string, headless bool) error {
return d.sh("vim-cmd", "vmsvc/power.on", d.vmId)
for i := 0; i < 20; i++ {
err := d.sh("vim-cmd", "vmsvc/power.on", d.vmId)
if err != nil {
return err
}
time.Sleep((time.Duration(i) * time.Second) + 1)
running, err := d.IsRunning(vmxPathLocal)
if err != nil {
return err
}
if running {
return nil
}
}
return errors.New("Retry limit exceeded")
}
func (d *ESX5Driver) Stop(vmxPathLocal string) error {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment