Merge pull request #5049 from ioito/automated-cherry-pick-of-#5048-upstream-release-3.1

Automated cherry pick of #5048: fix: google e2不支持本地盘
This commit is contained in:
yunion-ci-robot
2020-02-07 16:42:54 +08:00
committed by GitHub
+3
View File
@@ -150,6 +150,9 @@ func (self *SGoogleGuestDriver) ValidateCreateData(ctx context.Context, userCred
if localDisk > 8 {
return nil, httperrors.NewInputParameterError("%s disk cannot exceed 8", api.STORAGE_GOOGLE_LOCAL_SSD)
}
if localDisk > 0 && strings.HasPrefix(input.InstanceType, "e2") {
return nil, httperrors.NewNotSupportedError("%s for %s features are not compatible for creating instance", input.InstanceType, api.STORAGE_GOOGLE_LOCAL_SSD)
}
return input, nil
}