Merge pull request #719 from Zexi/hotfix/backup-server-sched-panic

fix: create backup server panic when schedule
This commit is contained in:
yunion-ci-robot
2019-05-05 21:10:14 +08:00
committed by GitHub
+1 -2
View File
@@ -2731,10 +2731,9 @@ func (self *SGuest) createDiskOnHost(
if err != nil {
return nil, err
}
// TODO: use scheduler candidate storage
if len(self.BackupHostId) > 0 {
backupHost := HostManager.FetchHostById(self.BackupHostId)
backupStorage := self.GetDriver().ChooseHostStorage(backupHost, diskConfig.Backend, backupCandidate.StorageIds)
backupStorage := self.ChooseHostStorage(backupHost, diskConfig.Backend, backupCandidate)
diff, err := db.Update(disk, func() error {
disk.BackupStorageId = backupStorage.Id
return nil