mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
避免部署主机失败后未设置external_id而删除主机失败
This commit is contained in:
@@ -162,6 +162,8 @@ func (self *SAliyunGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gu
|
||||
if createErr != nil {
|
||||
return nil, createErr
|
||||
}
|
||||
guest.SetExternalId(iVM.GetGlobalId())
|
||||
|
||||
log.Debugf("VMcreated %s, wait status ready ...", iVM.GetGlobalId())
|
||||
err = cloudprovider.WaitStatus(iVM, models.VM_READY, time.Second*5, time.Second*1800)
|
||||
if err != nil {
|
||||
|
||||
@@ -133,6 +133,8 @@ func (self *SAwsGuestDriver) RequestDeployGuestOnHost(ctx context.Context, guest
|
||||
return nil, createErr
|
||||
}
|
||||
|
||||
guest.SetExternalId(iVM.GetGlobalId())
|
||||
|
||||
log.Debugf("VMcreated %s, wait status running ...", iVM.GetGlobalId())
|
||||
err = cloudprovider.WaitStatus(iVM, models.VM_RUNNING, time.Second*5, time.Second*1800)
|
||||
if err != nil {
|
||||
|
||||
@@ -154,11 +154,12 @@ func (self *SAzureGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gue
|
||||
}
|
||||
|
||||
iVM, createErr := ihost.CreateVM(&desc)
|
||||
|
||||
if createErr != nil {
|
||||
return nil, createErr
|
||||
}
|
||||
|
||||
guest.SetExternalId(iVM.GetGlobalId())
|
||||
|
||||
log.Debugf("VMcreated %s, wait status running ...", iVM.GetGlobalId())
|
||||
if err = cloudprovider.WaitStatus(iVM, models.VM_RUNNING, time.Second*5, time.Second*1800); err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -123,6 +123,8 @@ func (self *SHuaweiGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gu
|
||||
if createErr != nil {
|
||||
return nil, createErr
|
||||
}
|
||||
guest.SetExternalId(iVM.GetGlobalId())
|
||||
|
||||
log.Debugf("VMcreated %s, wait status ready ...", iVM.GetGlobalId())
|
||||
err = cloudprovider.WaitStatus(iVM, models.VM_RUNNING, time.Second*5, time.Second*1800)
|
||||
if err != nil {
|
||||
|
||||
@@ -181,6 +181,7 @@ func (self *SQcloudGuestDriver) RequestDeployGuestOnHost(ctx context.Context, gu
|
||||
if createErr != nil {
|
||||
return nil, createErr
|
||||
}
|
||||
guest.SetExternalId(iVM.GetGlobalId())
|
||||
|
||||
log.Debugf("VMcreated %s, wait status running ...", iVM.GetGlobalId())
|
||||
err = cloudprovider.WaitStatus(iVM, models.VM_RUNNING, time.Second*5, time.Second*1800)
|
||||
|
||||
Reference in New Issue
Block a user