From f6f7df804e616b630440367d2834e79ae7b40ec1 Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Mon, 10 Oct 2022 18:15:11 +0200 Subject: [PATCH] B #5970: Fix ignore volatile disks on VM instantiate (#2304) (cherry picked from commit 72704708ce788091916e9d8d7af48685379db475) --- .../public/app/tabs/templates-tab/form-panels/instantiate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js index 91ff453483..ee4ab273b2 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js @@ -254,8 +254,9 @@ define(function(require) { }); var disks = DisksResize.retrieve($(".disksContext" + template_id, context)); - if (disks.length > 0) { - tmp_json.DISK = diffValues(disks, original_tmpl.TEMPLATE.DISK); + var has_changes = diffValues(disks, original_tmpl.TEMPLATE.DISK).length > 0 + if (disks.length > 0 && has_changes) { + tmp_json.DISK = disks; } var vmgroup = VMGroupSection.retrieve($(".vmgroupContext"+ template_id, context));