mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
ucloud create instance & huawei change instance config bugfix
This commit is contained in:
@@ -587,13 +587,18 @@ func (self *SInstance) GetVNCInfo() (jsonutils.JSONObject, error) {
|
||||
}
|
||||
|
||||
func (self *SInstance) NextDeviceName() (string, error) {
|
||||
prefix := "s"
|
||||
if strings.Contains(self.OSEXTSRVATTRRootDeviceName, "/vd") {
|
||||
prefix = "v"
|
||||
}
|
||||
|
||||
currents := []string{}
|
||||
for _, item := range self.OSExtendedVolumesVolumesAttached {
|
||||
currents = append(currents, strings.ToLower(item.Device))
|
||||
}
|
||||
|
||||
for i := 0; i < 25; i++ {
|
||||
device := fmt.Sprintf("/dev/sd%s", string(98+i))
|
||||
device := fmt.Sprintf("/dev/%sd%s", prefix, string(98+i))
|
||||
if ok, _ := utils.InStringArray(device, currents); !ok {
|
||||
return device, nil
|
||||
}
|
||||
|
||||
@@ -339,7 +339,7 @@ func (self *SRegion) CreateInstance(name, imageId, hostType, password, vpcId, Su
|
||||
// data disk
|
||||
for i, disk := range disks[1:] {
|
||||
N := i + 1
|
||||
params.Set(fmt.Sprintf("Disks.%d.IsBoot", N), false)
|
||||
params.Set(fmt.Sprintf("Disks.%d.IsBoot", N), "False")
|
||||
params.Set(fmt.Sprintf("Disks.%d.Type", N), disk.DiskType)
|
||||
params.Set(fmt.Sprintf("Disks.%d.Size", N), disk.SizeGB)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user