diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js
index 3b8a2dfd3f..91a59403a6 100644
--- a/src/sunstone/public/js/plugins/datastores-tab.js
+++ b/src/sunstone/public/js/plugins/datastores-tab.js
@@ -95,10 +95,10 @@ var create_datastore_tmpl =
\
\
\
- \
+ \
\
\
-
\
@@ -805,7 +805,7 @@ function setupCreateDatastoreDialog(){
setupTips(dialog);
- $('#ds_type').change(function(){
+ $('#presets').change(function(){
hide_all($(this).parent());
var choice_str = $(this).val();
switch(choice_str)
@@ -839,7 +839,7 @@ function setupCreateDatastoreDialog(){
var context = $( "#create_datastore_form", dialog);
var name = $('#name',context).val();
var cluster_id = $('#cluster_id',context).val();
- var system = $('#sys_ds',context).is(':checked');
+ var ds_type = $('input[name=ds_type]:checked',context).val();
var ds_mad = $('#ds_mad',context).val();
var tm_mad = $('#tm_mad',context).val();
var type = $('#disk_type',context).val();
@@ -861,17 +861,16 @@ function setupCreateDatastoreDialog(){
"datastore" : {
"name" : name,
"tm_mad" : tm_mad,
- "disk_type" : type
+ "disk_type" : type,
+ "type" : ds_type
},
"cluster_id" : cluster_id
};
// If we are adding a system datastore then
// we do not use ds_mad
- if (system)
- ds_obj.datastore.system = "YES";
- else
- ds_obj.datastore.ds_mad = ds_mad;
+ if (ds_type != "SYSTEM_DS")
+ s_obj.datastore.ds_mad = ds_mad;
if (safe_dirs)
ds_obj.datastore.safe_dirs = safe_dirs;