1
0
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:
Jorge Miguel Lobo Escalona 2024-06-25 17:38:14 +02:00 committed by GitHub
parent 81fc9f1ae0
commit 234200588d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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"];
}