mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-05-31 21:12:07 +08:00
feat(scheduler): support filtering storage via medium
This commit is contained in:
@@ -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{
|
||||
|
||||
@@ -126,4 +126,5 @@ const (
|
||||
StorageMatch = "storage_match"
|
||||
StorageType = "storage_type"
|
||||
StorageOwnership = "storage_ownership"
|
||||
StorageMedium = "storage_medium"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user