Skip to content

Commit

Permalink
Merge pull request #9 from pjini/master
Browse files Browse the repository at this point in the history
[Cloudit] VM 생성 시 Get 무한루프 로직 수정 적용
  • Loading branch information
dev-secloudit authored Jun 1, 2020
2 parents 600cf39 + 64e18af commit b811642
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,21 @@ func (vmHandler *ClouditVMHandler) StartVM(vmReqInfo irs.VMReqInfo) (irs.VMInfo,
if err != nil {
return irs.VMInfo{}, err
}

index := 100
// VM 생성 완료까지 wait
for {
// Check VM Deploy Status
vmInfo, err := server.Get(vmHandler.Client, creatingVm.ID, &requestOpts)
if err != nil {
return irs.VMInfo{}, err
}

if index == 0 {
cblogger.Error(err)
break
}
if vmInfo.PrivateIp == "" {
time.Sleep(1 * time.Second)
index--
continue
} else {
ok, err := vmHandler.AssociatePublicIP(creatingVm.Name, vmInfo.PrivateIp)
Expand Down

0 comments on commit b811642

Please sign in to comment.