Automatic merge from release/2.3.0 -> release/2.4.0

* commit 'a83f63e12ba6c1170546596fb71718dbb2e765cb':
  暂时取消系统盘大小校验
This commit is contained in:
邱剑
2018-12-17 21:05:30 +08:00
+4 -8
View File
@@ -102,16 +102,12 @@ func (self *SQcloudGuestDriver) ValidateCreateData(ctx context.Context, userCred
}
switch sysDisk.Backend {
case models.STORAGE_CLOUD_BASIC, models.STORAGE_CLOUD_SSD:
if sysDisk.SizeMb < 50*10024 || sysDisk.SizeMb > 500*1024 {
return nil, fmt.Errorf("The %s system disk size must be in the range of 50 ~ 500GB", sysDisk.Backend)
if sysDisk.SizeMb > 500*1024 {
return nil, fmt.Errorf("The %s system disk size must be less than 500GB", sysDisk.Backend)
}
case models.STORAGE_CLOUD_PREMIUM:
if sysDisk.SizeMb < 50*1024 || sysDisk.SizeMb > 1024*1024 {
return nil, fmt.Errorf("The %s system disk size must be in the range of 50 ~ 1024GB", sysDisk.Backend)
}
default:
if sysDisk.SizeMb < 50*1024 {
return nil, fmt.Errorf("The system disk must be greater than or equal to 50GB")
if sysDisk.SizeMb > 1024*1024 {
return nil, fmt.Errorf("The %s system disk size must be less than 1024GB", sysDisk.Backend)
}
}
return data, nil