1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-19 06:50:07 +03:00

B #5873: Fix VM Template creation with memory cost in GB (#2141)

This commit is contained in:
Frederick Borges 2022-06-10 13:06:26 +02:00 committed by GitHub
parent fa6917fe06
commit 782660a00b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -146,7 +146,7 @@ define(function(require) {
CapacityCreate.calculatedRealMemory(context);
});
context.on("change", "#CPU_COST", function() {
context.on("change", "#CPU_COST", function() {
CapacityCreate.calculatedRealCpu(context);
});
@ -237,12 +237,12 @@ define(function(require) {
cpu_input = "1";
// [NUMA]
$("#numa-pin-policy", formContext)
.prop('disabled', false)
.prop("disabled", false)
.val("SHARED")
.prop('disabled', true);
.prop("disabled", true);
$("#numa-sockets", formContext).val("1");
$("#numa-threads", formContext)
.prop('disabled', false)
.prop("disabled", false)
.prop("max", NUMA_THREADS_MAX)
.val(NUMA_THREADS_MIN)
.keyup(function(){
@ -251,7 +251,7 @@ define(function(require) {
else if (this.value < NUMA_THREADS_MIN)
this.value = NUMA_THREADS_MIN;
});
$(".disabled_firecracker", formContext).prop("disabled", true);
$(".not_firecracker", formContext).hide();
@ -377,7 +377,7 @@ define(function(require) {
templateJSON["VCENTER_VM_FOLDER"] = WizardFields.retrieveInput($("#vcenter_vm_folder", context));
}
}
if (templateJSON["HYPERVISOR"] == "lxc"){
templateJSON["LXC_UNPRIVILEGED"] = $("#lxc_security_unprivileged", context).val().toUpperCase();
}
@ -423,7 +423,7 @@ define(function(require) {
$.extend(true, templateJSON, CapacityCreate.retrieve($("div.capacityCreate", context)));
if (templateJSON["MEMORY_COST"] && templateJSON["MEMORY_UNIT_COST"] && templateJSON["MEMORY_UNIT_COST"] == "GB") {
templateJSON["MEMORY_COST"] = templateJSON["MEMORY_COST"] / 1024;
templateJSON["MEMORY_COST"] = (templateJSON["MEMORY_COST"] / 1024).toString();
}
if (templateJSON["DISK_COST"]) {
templateJSON["DISK_COST"] = (templateJSON["DISK_COST"] / 1024).toString();