mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(region): reset password for cloudpods baremetal (#20486)
This commit is contained in:
@@ -401,13 +401,14 @@ func (self *SCloudpodsBaremetalGuestDriver) RequestDeployGuestOnHost(ctx context
|
||||
|
||||
log.Debugf("%s baremetal config: %s", val, jsonutils.Marshal(desc).String())
|
||||
|
||||
iHost, err := host.GetIHost(ctx)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch val {
|
||||
case "create":
|
||||
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
|
||||
iHost, err := host.GetIHost(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
h := iHost.(*cloudpods.SHost)
|
||||
opts := &api.ServerCreateInput{
|
||||
ServerConfigs: &api.ServerConfigs{},
|
||||
@@ -485,6 +486,10 @@ func (self *SCloudpodsBaremetalGuestDriver) RequestDeployGuestOnHost(ctx context
|
||||
data := fetchIVMinfo(desc, iVM, guest.Id, desc.Account, desc.Password, desc.PublicKey, "create")
|
||||
return data, nil
|
||||
})
|
||||
case "deploy":
|
||||
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
|
||||
return self.SManagedVirtualizedGuestDriver.RemoteDeployGuestForDeploy(ctx, guest, iHost, task, desc)
|
||||
})
|
||||
case "rebuild":
|
||||
taskman.LocalTaskRun(task, func() (jsonutils.JSONObject, error) {
|
||||
iVm, err := guest.GetIVM(ctx)
|
||||
|
||||
@@ -295,7 +295,11 @@ func (self *SInstance) DeployVM(ctx context.Context, opts *cloudprovider.SInstan
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "deploy")
|
||||
}
|
||||
return cloudprovider.WaitMultiStatus(self, []string{api.VM_READY, api.VM_RUNNING}, time.Second*5, time.Minute*3)
|
||||
timeout := time.Minute * 3
|
||||
if self.Hypervisor == api.HYPERVISOR_BAREMETAL {
|
||||
timeout = time.Minute * 10
|
||||
}
|
||||
return cloudprovider.WaitMultiStatus(self, []string{api.VM_READY, api.VM_RUNNING}, time.Second*5, timeout)
|
||||
}
|
||||
|
||||
func (self *SInstance) ChangeConfig(ctx context.Context, opts *cloudprovider.SManagedVMChangeConfig) error {
|
||||
|
||||
Reference in New Issue
Block a user