mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: Storage filter not work for Esxi
1. SESXiGuestDriver.DoScheduleStorageFilter should return true. 2. ESXi's SHost.GetStorageSizeMB should return the capacity of all the storage belonging to it.
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