mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #5218 from rainzm/automated-cherry-pick-of-#5217-upstream-release-3.1
Automated cherry pick of #5217: fix: Storage filter not work for Esxi
This commit is contained in:
@@ -54,6 +54,8 @@ func (self *SESXiGuestDriver) DoScheduleMemoryFilter() bool { return true }
|
||||
|
||||
func (self *SESXiGuestDriver) DoScheduleSKUFilter() bool { return false }
|
||||
|
||||
func (self *SESXiGuestDriver) DoScheduleStorageFilter() bool { return true }
|
||||
|
||||
func (self *SESXiGuestDriver) GetHypervisor() string {
|
||||
return api.HYPERVISOR_ESXI
|
||||
}
|
||||
|
||||
@@ -565,12 +565,16 @@ func (self *SHost) getStorages() []*SHostStorageAdapterInfo {
|
||||
}
|
||||
|
||||
func (self *SHost) GetStorageSizeMB() int {
|
||||
size := 0
|
||||
storages := self.GetStorageInfo()
|
||||
for i := 0; i < len(storages); i += 1 {
|
||||
size += storages[i].Size
|
||||
storages, err := self.GetIStorages()
|
||||
if err != nil {
|
||||
log.Errorf("SHost.GetStorageSizeMB: SHost.GetIStorages: %s", err)
|
||||
return 0
|
||||
}
|
||||
return size
|
||||
var size int64
|
||||
for _, stor := range storages {
|
||||
size += stor.GetCapacityMB()
|
||||
}
|
||||
return int(size)
|
||||
}
|
||||
|
||||
func (self *SHost) GetStorageType() string {
|
||||
|
||||
Reference in New Issue
Block a user