winterhazel commented on code in PR #7867:
URL: https://github.com/apache/cloudstack/pull/7867#discussion_r1303417341


##########
ui/src/views/compute/DeployVM.vue:
##########
@@ -1789,11 +1789,17 @@ export default {
         if (template) {
           var size = template.size / (1024 * 1024 * 1024) || 0 // bytes to GB
           this.dataPreFill.minrootdisksize = Math.ceil(size)
-          this.defaultBootType = this.template?.details?.UEFI ? 'UEFI' : ''
-          this.fetchBootModes(this.defaultBootType)
-          this.defaultBootMode = this.template?.details?.UEFI
-          this.updateTemplateLinkedUserData(this.template.userdataid)
-          this.userdataDefaultOverridePolicy = this.template.userdatapolicy
+          this.updateTemplateLinkedUserData(template.userdataid)
+          this.userdataDefaultOverridePolicy = template.userdatapolicy
+          this.form.dynamicscalingenabled = template.isdynamicallyscalable
+          this.defaultBootType = template.details?.UEFI ? 'UEFI' : 'BIOS'
+          this.form.boottype = this.defaultBootType
+          this.fetchBootModes(this.form.boottype)
+          this.defaultBootMode = template.details?.UEFI || 
this.options.bootModes?.[0]?.id || undefined
+          this.form.bootmode = this.defaultBootMode
+          this.form.iothreadsenabled = template.details?.iothreads ? 
template.details.iothreads === 'enabled' : null

Review Comment:
   I have checked how the backend infers this setting and I think that it is 
better to change this line to `this.form.iothreadsenabled = template.details && 
Object.prototype.hasOwnProperty.call(template.details, 'iothreads')` to match 
its behavior. The backend considers iothreads as enabled when the VM details 
contain the key "iothreads", independently of its value.
   
   With the current changes, if "iothreads" is set to "example", the UI will 
set the parameter to false. With this suggestion, the UI will not infer it, but 
the backend will infer it as enabled since the parameter in the API call was 
null. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to