mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix: baremetal server create params not override disks
This commit is contained in:
@@ -4170,13 +4170,15 @@ func (self *SGuest) ToCreateInput(userCred mcclient.TokenCredential) *api.Server
|
||||
if err != nil {
|
||||
return genInput
|
||||
}
|
||||
// fill missing create params like schedtags
|
||||
for idx, disk := range genInput.Disks {
|
||||
if idx < len(userInput.Disks) {
|
||||
disk.Schedtags = userInput.Disks[idx].Schedtags
|
||||
userInput.Disks[idx] = disk
|
||||
} else {
|
||||
userInput.Disks = append(userInput.Disks, disk)
|
||||
if self.GetHypervisor() != api.HYPERVISOR_BAREMETAL {
|
||||
// fill missing create params like schedtags
|
||||
for idx, disk := range genInput.Disks {
|
||||
if idx < len(userInput.Disks) {
|
||||
disk.Schedtags = userInput.Disks[idx].Schedtags
|
||||
userInput.Disks[idx] = disk
|
||||
} else {
|
||||
userInput.Disks = append(userInput.Disks, disk)
|
||||
}
|
||||
}
|
||||
}
|
||||
for idx, net := range genInput.Networks {
|
||||
|
||||
Reference in New Issue
Block a user