Merge pull request #10374 from ioito/hotfix/qx-aliyun-public-bandwidth

fix: aliyun public ip bandwidth
This commit is contained in:
Zexi Li
2021-03-11 11:43:33 +08:00
committed by GitHub
+4 -2
View File
@@ -577,10 +577,12 @@ func (self *SRegion) CreateInstance(name string, imageId string, instanceType st
params["InternetChargeType"] = "PayByTraffic"
params["InternetMaxBandwidthIn"] = "200"
params["InternetMaxBandwidthOut"] = "100"
if publicIp.PublicIpBw > 0 && publicIp.PublicIpChargeType == cloudprovider.ElasticipChargeTypeByBandwidth {
params["InternetChargeType"] = "PayByBandwidth"
if publicIp.PublicIpBw > 0 {
params["InternetMaxBandwidthOut"] = fmt.Sprintf("%d", publicIp.PublicIpBw)
}
if publicIp.PublicIpChargeType == cloudprovider.ElasticipChargeTypeByBandwidth {
params["InternetChargeType"] = "PayByBandwidth"
}
params["HostName"] = stringutils2.GenerateHostName(name, osType)
if len(passwd) > 0 {
params["Password"] = passwd