fix: aliyun public ip bandwidth

This commit is contained in:
Qu Xuan
2021-03-10 17:30:46 +08:00
parent 756e1c1b26
commit 02fa0373b8
+4 -2
View File
@@ -575,10 +575,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