mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-11-05 15:31:49 +08:00
fix create backup
This commit is contained in:
@@ -1400,6 +1400,11 @@ func (self *SGuest) GetExtraDetails(ctx context.Context, userCred mcclient.Token
|
||||
}
|
||||
extra.Add(isGpu, "is_gpu")
|
||||
|
||||
if len(self.BackupHostId) > 0 {
|
||||
backupHost := HostManager.FetchHostById(self.BackupHostId)
|
||||
extra.Set("backup_host_name", jsonutils.NewString(backupHost.Name))
|
||||
}
|
||||
|
||||
if self.IsPrepaidRecycle() {
|
||||
extra.Add(jsonutils.JSONTrue, "is_prepaid_recycle")
|
||||
} else {
|
||||
|
||||
@@ -231,7 +231,7 @@ func (self *GuestCreateBackupTask) OnGuestStart(ctx context.Context, guest *mode
|
||||
self.SetStage("OnSyncToBackup", nil)
|
||||
err := guest.GuestStartAndSyncToBackup(ctx, self.UserCred, nil, self.GetTaskId())
|
||||
if err != nil {
|
||||
self.SetStageFailed(ctx, fmt.Sprintf("Guest sycn to backup error %s", err.Error()))
|
||||
self.TaskFailed(ctx, guest, fmt.Sprintf("Guest sycn to backup error %s", err.Error()))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user