diff --git a/src/datastore_mad/remotes/ceph/cp b/src/datastore_mad/remotes/ceph/cp index a388c840d6..5d81aa186a 100755 --- a/src/datastore_mad/remotes/ceph/cp +++ b/src/datastore_mad/remotes/ceph/cp @@ -51,7 +51,7 @@ while IFS= read -r -d '' element; do done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/POOL_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/STAGING_DIR \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ @@ -66,7 +66,7 @@ unset i BASE_PATH="${XPATH_ELEMENTS[i++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[i++]}" SAFE_DIRS="${XPATH_ELEMENTS[i++]}" -DST_HOST="${XPATH_ELEMENTS[i++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[i++]}" POOL_NAME="${XPATH_ELEMENTS[i++]:-$POOL_NAME}" STAGING_DIR="${XPATH_ELEMENTS[i++]:-$STAGING_DIR}" SRC="${XPATH_ELEMENTS[i++]}" @@ -76,8 +76,10 @@ SHA1="${XPATH_ELEMENTS[i++]}" NO_DECOMPRESS="${XPATH_ELEMENTS[i++]}" LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[i++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/iscsi/cp b/src/datastore_mad/remotes/iscsi/cp index dfaec846a6..9f8587abc6 100755 --- a/src/datastore_mad/remotes/iscsi/cp +++ b/src/datastore_mad/remotes/iscsi/cp @@ -51,7 +51,7 @@ while IFS= read -r -d '' element; do done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ @@ -64,7 +64,7 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ BASE_PATH="${XPATH_ELEMENTS[j++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" BASE_IQN="${XPATH_ELEMENTS[j++]:-$BASE_IQN}" SRC="${XPATH_ELEMENTS[j++]}" @@ -74,8 +74,10 @@ SHA1="${XPATH_ELEMENTS[j++]}" NO_DECOMPRESS="${XPATH_ELEMENTS[j++]}" LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[j++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/datastore_mad/remotes/lvm/cp b/src/datastore_mad/remotes/lvm/cp index 7c9d95b0dd..5ed8ab9561 100755 --- a/src/datastore_mad/remotes/lvm/cp +++ b/src/datastore_mad/remotes/lvm/cp @@ -51,7 +51,7 @@ while IFS= read -r -d '' element; do done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/RESTRICTED_DIRS \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/SAFE_DIRS \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BRIDGE_LIST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE \ @@ -63,7 +63,7 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ BASE_PATH="${XPATH_ELEMENTS[j++]}" RESTRICTED_DIRS="${XPATH_ELEMENTS[j++]}" SAFE_DIRS="${XPATH_ELEMENTS[j++]}" -DST_HOST="${XPATH_ELEMENTS[j++]}" +BRIDGE_LIST="${XPATH_ELEMENTS[j++]}" VG_NAME="${XPATH_ELEMENTS[j++]:-$VG_NAME}" SRC="${XPATH_ELEMENTS[j++]}" SIZE="${XPATH_ELEMENTS[j++]}" @@ -72,8 +72,10 @@ SHA1="${XPATH_ELEMENTS[j++]}" NO_DECOMPRESS="${XPATH_ELEMENTS[j++]}" LIMIT_TRANSFER_BW="${XPATH_ELEMENTS[j++]}" +DST_HOST=`get_destination_host $IMAGE_ID` + if [ -z "$DST_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." + error_message "Datastore template missing 'BRIDGE_LIST' attribute." exit -1 fi diff --git a/src/sunstone/public/js/plugins/datastores-tab.js b/src/sunstone/public/js/plugins/datastores-tab.js index e81d01b161..5bcf24703f 100644 --- a/src/sunstone/public/js/plugins/datastores-tab.js +++ b/src/sunstone/public/js/plugins/datastores-tab.js @@ -231,16 +231,6 @@ var create_datastore_tmpl =
'+tr("Paths that can not be used to register images. A space separated list of paths. This will prevent users registering important files as VM images and accessing them thourgh their VMs. OpenNebula will automatically add its configuration directories: /var/lib/one, /etc/one and oneadmin's home ($HOME).")+'
\ \ \ -
\ -
\ - \ -
\ -
\ - \ -
\ -
\ -
\ -
\
\
\ \ @@ -251,13 +241,13 @@ var create_datastore_tmpl =
\
\
\ - \ + \
\
\ - \ + \
\
\ -
'+tr("Server name or IP where OpenNebula will be staging the new images into. This server will act as the entry point for new inmages in the datastore.")+'
\ +
'+tr("Space separated list of Server names or IPs where OpenNebula will be staging the new images into. This server will act as the entry point for new inmages in the datastore.")+'
\
\
\
\ @@ -863,10 +853,9 @@ function hide_all(context) { // Hide all the options that depends on datastore type // and reset the selects - $('label[for="bridge_list"],input#bridge_list',context).hide(); $('label[for="ds_use_ssh"],input#ds_use_ssh',context).hide(); $('label[for="tm_use_ssh"],input#tm_use_ssh',context).hide(); - $('label[for="host"],input#host',context).parent().parent().hide(); + $('label[for="bridge_list"],input#bridge_list',context).parent().parent().hide(); $('label[for="base_iqn"],input#base_iqn',context).hide(); $('label[for="vg_name"],input#vg_name',context).hide(); $('select#ds_mad').removeAttr('disabled'); @@ -956,7 +945,6 @@ function setupCreateDatastoreDialog(){ var bridge_list = $('#bridge_list',context).val(); var ds_use_ssh = $('#ds_use_ssh',context).is(':checked'); var tm_use_ssh = $('#tm_use_ssh',context).is(':checked'); - var host = $('#host',context).val(); var base_iqn = $('#base_iqn',context).val(); var vg_name = $('#vg_name',context).val(); @@ -996,9 +984,6 @@ function setupCreateDatastoreDialog(){ if (tm_use_ssh) ds_obj.datastore.tm_use_ssh = "YES"; - if (host) - ds_obj.datastore.host = host; - if (base_iqn) ds_obj.datastore.base_iqn = base_iqn; @@ -1069,7 +1054,7 @@ function select_filesystem(){ } function select_vmware_vmfs(){ - $('label[for="bridge_list"],input#bridge_list').fadeIn(); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('label[for="ds_use_ssh"],input#ds_use_ssh').fadeIn(); $('label[for="tm_use_ssh"],input#tm_use_ssh').fadeIn(); $('select#ds_mad').val('vmfs'); @@ -1085,7 +1070,7 @@ function select_iscsi(){ $('select#ds_mad').attr('disabled', 'disabled'); $('select#tm_mad').val('iscsi'); $('select#tm_mad').attr('disabled', 'disabled'); - $('label[for="host"],input#host').parent().parent().fadeIn(); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('label[for="base_iqn"],input#base_iqn').fadeIn(); $('label[for="vg_name"],input#vg_name').fadeIn(); $('select#disk_type').children('option').each(function() { @@ -1104,7 +1089,7 @@ function select_ceph(){ $('select#ds_mad').attr('disabled', 'disabled'); $('select#tm_mad').val('ceph'); $('select#tm_mad').attr('disabled', 'disabled'); - $('label[for="host"],input#host').parent().parent().fadeIn(); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('select#disk_type').val('RBD'); } @@ -1113,7 +1098,7 @@ function select_lvm(){ $('select#ds_mad').attr('disabled', 'disabled'); $('select#tm_mad').val('lvm'); $('select#tm_mad').attr('disabled', 'disabled'); - $('label[for="host"],input#host').parent().parent().fadeIn(); + $('label[for="bridge_list"],input#bridge_list').parent().parent().fadeIn(); $('label[for="vg_name"],input#vg_name').fadeIn(); $('select#disk_type').children('option').each(function() { var value_str = $(this).val();