Merge pull request #10375 from ioito/automated-cherry-pick-of-#10374-upstream-release-3.7

Automated cherry pick of #10374: fix: aliyun public ip bandwidth
This commit is contained in:
Zexi Li
2021-03-11 11:43:43 +08:00
committed by GitHub

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