Merge pull request #5448 from zexi/automated-cherry-pick-of-#5447-upstream-release-3.1

Automated cherry pick of #5447: region: host update storage set enabled
This commit is contained in:
Zexi Li
2020-03-11 15:58:23 +08:00
committed by GitHub
+2
View File
@@ -725,6 +725,7 @@ func (self *SHost) PerformUpdateStorage(
storage.MediumType = self.StorageType
storage.Cmtbound = 1.0
storage.Status = api.STORAGE_ONLINE
storage.Enabled = tristate.True
storage.ZoneId = zoneId
storage.StoragecacheId = storageCacheId
err := StorageManager.TableSpec().Insert(&storage)
@@ -752,6 +753,7 @@ func (self *SHost) PerformUpdateStorage(
diff, err := db.Update(storage, func() error {
storage.Capacity = capacity
storage.StoragecacheId = storageCacheId
storage.Enabled = tristate.True
return nil
})
if err != nil {