diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js
index e53426f5e8..f36f8d8e3a 100644
--- a/src/sunstone/public/js/plugins/templates-tab.js
+++ b/src/sunstone/public/js/plugins/templates-tab.js
@@ -494,14 +494,18 @@ function updateTemplatesView(request, templates_list){
function generate_capacity_tab_content() {
var html =
- '
'+
+ '
'+
'
'+
@@ -620,7 +624,7 @@ function setup_capacity_tab_content(capacity_section) {
capacity_section.on("change", "input[name='hypervisor']", function(){
var context = $(this).closest("#create_template_form_wizard");
$(".hypervisor", context).hide();
- $("." + this.value, context).show();
+ $(".only_" + this.value, context).show();
});
setup_capacity_inputs(capacity_section);
@@ -3665,6 +3669,7 @@ function build_template(dialog){
addSectionJSON(vm_json,$('#capacityTab',dialog));
vm_json["DESCRIPTION"] = $('#DESCRIPTION',$('#capacityTab',dialog)).val();
vm_json["LOGO"] = $('#LOGO',$('#capacityTab',dialog)).val();
+ vm_json["HYPERVISOR"] = $('input[name="hypervisor"]:checked', $('#capacityTab',dialog)).val();
//
// OS
@@ -3864,6 +3869,12 @@ var fillTemplatePopUp = function(template, dialog){
$("#DESCRIPTION", capacity_section).val(escapeDoubleQuotes(htmlDecode(template["DESCRIPTION"])));
delete template["DESCRIPTION"];
+ if (template["HYPERVISOR"]) {
+ $("input[name='hypervisor'][value='"+template["HYPERVISOR"]+"']", capacity_section).trigger("click")
+ delete template["HYPERVISOR"];
+ }
+
+
//
// DISKS
//