Skip to content

Commit

Permalink
B #6625: Error parsing VM Template instantiation (#3125)
Browse files Browse the repository at this point in the history
with user inputs

* Fix error parsing vm template with user input
* Retains the value of SOCKET input
  • Loading branch information
jloboescalona2 authored Jun 25, 2024
1 parent 81fc9f1 commit 2342005
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,10 +407,14 @@ define(function(require) {

var topology = {};

if (tmp_json && tmp_json.CORES){
var vcpu_value = tmp_json.VCPU === undefined?
original_tmpl.TEMPLATE.VCPU === undefined? original_tmpl.TEMPLATE.CPU : original_tmpl.TEMPLATE.VCPU
: tmp_json.VCPU

if (tmp_json && tmp_json.CORES && vcpu_value){
topology.CORES = tmp_json["CORES"];
topology.SOCKETS = parseInt(tmp_json["VCPU"]) / parseInt(tmp_json["CORES"]);
topology.THREADS = 1;
topology.SOCKETS = tmp_json.SOCKETS !== undefined? tmp_json.SOCKETS : "" + parseInt(vcpu_value) / parseInt(tmp_json["CORES"]);
topology.THREADS = "1";
delete tmp_json["CORES"];
}

Expand Down

0 comments on commit 2342005

Please sign in to comment.