diff --git a/pkg/scheduler/algorithm/predicates/disk_schedtag_predicate.go b/pkg/scheduler/algorithm/predicates/disk_schedtag_predicate.go index 51ee5a0aee..dc19b2183c 100644 --- a/pkg/scheduler/algorithm/predicates/disk_schedtag_predicate.go +++ b/pkg/scheduler/algorithm/predicates/disk_schedtag_predicate.go @@ -120,7 +120,14 @@ func (p *DiskSchedtagPredicate) IsResourceFitInput(u *core.Unit, c core.Candidat } } } - + if len(d.Medium) != 0 { + if storage.MediumType != d.Medium { + return &FailReason{ + fmt.Sprintf("Storage %s medium %s != %s", storage.Name, storage.MediumType, d.Medium), + StorageMedium, + } + } + } storageTypes := p.GetHypervisorDriver().GetStorageTypes() if len(storageTypes) != 0 && !utils.IsInStringArray(storage.StorageType, storageTypes) { return &FailReason{ diff --git a/pkg/scheduler/algorithm/predicates/error.go b/pkg/scheduler/algorithm/predicates/error.go index ae5147cb42..3c65c03dd3 100644 --- a/pkg/scheduler/algorithm/predicates/error.go +++ b/pkg/scheduler/algorithm/predicates/error.go @@ -126,4 +126,5 @@ const ( StorageMatch = "storage_match" StorageType = "storage_type" StorageOwnership = "storage_ownership" + StorageMedium = "storage_medium" )