fix create backup

This commit is contained in:
wanyaoqi
2019-02-21 17:32:39 +08:00
parent f09fcec33a
commit ee028422f7
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -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 {
+1 -1
View File
@@ -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()))
}
}