fix: create backup server panic when schedule

This commit is contained in:
Zexi
2019-05-05 19:58:21 +08:00
parent d60966fe1a
commit b3cb260e07
+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