diff --git a/server/src/com/cloud/api/commands/ListTemplatesCmd.java b/server/src/com/cloud/api/commands/ListTemplatesCmd.java index 2d25fdf32d4..ccb33ea9dcd 100644 --- a/server/src/com/cloud/api/commands/ListTemplatesCmd.java +++ b/server/src/com/cloud/api/commands/ListTemplatesCmd.java @@ -39,6 +39,7 @@ import com.cloud.storage.VMTemplateVO; import com.cloud.storage.dao.VMTemplateDao.TemplateFilter; import com.cloud.storage.template.TemplateConstants; import com.cloud.user.Account; +import com.cloud.user.AccountVO; import com.cloud.user.UserContext; @Implementation(method="listTemplates", description="List all public, private, and privileged templates.") @@ -151,7 +152,9 @@ public class ListTemplatesCmd extends BaseListCmd { List templateResponses = new ArrayList(); for (VMTemplateVO template : templates) { - if (!showDomr && template.getId() == TemplateConstants.DEFAULT_SYSTEM_VM_DB_ID) { + // Since we've added multiple domR templates and with different DB ids, I'm changing + // this to filter out any templates with names that start with system for now. + if (!showDomr && template.getName().startsWith("SystemVM")) { continue; } diff --git a/ui/new/scripts/cloud.core2.instance.js b/ui/new/scripts/cloud.core2.instance.js index 0a19ddcf45a..7f4f6f16352 100644 --- a/ui/new/scripts/cloud.core2.instance.js +++ b/ui/new/scripts/cloud.core2.instance.js @@ -537,11 +537,10 @@ function initVMWizard() { var commandString; var searchInput = $vmPopup.find("#search_input").val(); if (selectedTemplateTypeInVmPopup != "blank") { //template - var hypervisor = $vmPopup.find("#wizard_hypervisor").val(); if (searchInput != null && searchInput.length > 0) - commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&hypervisor="+hypervisor+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup; + commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&keyword="+searchInput+"&page="+currentPageInTemplateGridInVmPopup; else - commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&hypervisor="+hypervisor+"&page="+currentPageInTemplateGridInVmPopup; + commandString = "command=listTemplates&templatefilter="+selectedTemplateTypeInVmPopup+"&zoneid="+zoneId+"&page="+currentPageInTemplateGridInVmPopup; } else { //ISO if (searchInput != null && searchInput.length > 0) @@ -673,13 +672,6 @@ function initVMWizard() { return false; }); - $vmPopup.find("#wizard_hypervisor").bind("change", function(event) { - var selectedHypervisor = $(this).val(); - if(selectedHypervisor != null && selectedHypervisor.length > 0) - listTemplatesInVmPopup(); - return false; - }); - function displayDiskOffering(type) { if(type=="data") { $vmPopup.find("#wizard_data_disk_offering_title").show(); @@ -763,8 +755,9 @@ function initVMWizard() { $thisPopup.find("#root_disk_offering_container").hide(); } - $thisPopup.find("#wizard_review_zone").text($thisPopup.find("#wizard_zone option:selected").text()); - $thisPopup.find("#wizard_review_hypervisor").text($thisPopup.find("#wizard_hypervisor option:selected").text()); + $thisPopup.find("#wizard_review_zone").text($thisPopup.find("#wizard_zone option:selected").text()); + // This is taking from the selected template but need to change this to the dropdown that supports ISO. + $thisPopup.find("#wizard_review_hypervisor").text($selectedVmWizardTemplate.data("hypervisor")); $thisPopup.find("#wizard_review_template").text($thisPopup.find("#step1 .rev_wiztemplistbox_selected .rev_wiztemp_listtext").text()); }