mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-05 09:17:41 +03:00
B OpenNebula/One#6625: Error parsing VM Template instantiation (#3125)
with user inputs * Fix error parsing vm template with user input * Retains the value of SOCKET input
This commit is contained in:
parent
81fc9f1ae0
commit
234200588d
@ -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"];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user