From bba9b507151dee3839300bd38d7da0c36b7e77e8 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 25 Jun 2012 14:41:55 +0200 Subject: [PATCH 01/14] feature #1307: SUDO for detach in VMware --- src/vmm_mad/remotes/vmware/detach_disk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm_mad/remotes/vmware/detach_disk b/src/vmm_mad/remotes/vmware/detach_disk index fbea1aac1c..7985b8dbff 100755 --- a/src/vmm_mad/remotes/vmware/detach_disk +++ b/src/vmm_mad/remotes/vmware/detach_disk @@ -26,7 +26,7 @@ UNIT_NUMBER="$4" CONTROLLER_NUMBER=0 # Only one controller at the moment (up to 16 devices) # Get the VMware ID corresponding to the deploy_id -VMWAREID=`vim-cmd vmsvc/getallvms|grep $DEPLOYID|cut -d' ' -f 1` +VMWAREID=`$SUDO vim-cmd vmsvc/getallvms|grep $DEPLOYID|cut -d' ' -f 1` DETACH_PARAMS="$VMWAREID $CONTROLLER_NUMBER $UNIT_NUMBER $IMAGE_PATH" From aab607da3578d451a140545b19fef40940b16402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 25 Jun 2012 15:37:56 +0200 Subject: [PATCH 02/14] Update VM state diagrams --- share/doc/states/states-complete.dot | 8 ++++++-- share/doc/states/states-simple.dot | 11 ++++++++--- share/doc/xsd/acct.xsd | 3 ++- share/doc/xsd/image.xsd | 12 ++++++++++++ share/doc/xsd/vm.xsd | 3 ++- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/share/doc/states/states-complete.dot b/share/doc/states/states-complete.dot index 07d9baeb61..7f51deeba9 100644 --- a/share/doc/states/states-complete.dot +++ b/share/doc/states/states-complete.dot @@ -81,8 +81,12 @@ digraph OpenNebula { unknown -> boot [label="restart"]; boot -> boot [label="restart"]; -# reboot - running -> running [label="reboot"]; +# reboot, reset + running -> running [label="reboot / reset"]; + +# attachdisk + running -> hotplug [label="attachdisk / detachdisk"] + hotplug -> running [style="dashed"]; # resubmit "ANY \\ {suspended,done}" -> pending [label="resubmit"]; diff --git a/share/doc/states/states-simple.dot b/share/doc/states/states-simple.dot index 00b74e7d6b..75f6801bc7 100644 --- a/share/doc/states/states-simple.dot +++ b/share/doc/states/states-simple.dot @@ -21,7 +21,8 @@ digraph OpenNebula { subgraph { rank = min; user} # subgraph { rank = same; pending; hold; color="white"} subgraph { rank = same; prolog; boot; color="white" } - subgraph { rank = same; migrate; save; shutdown; unknown; color="white" } + subgraph { rank = same; migrate; save; shutdown; unknown; hotplug; + color="white" } subgraph { rank = max; suspended; done; failure; stopped; color="white" } # create @@ -75,8 +76,12 @@ digraph OpenNebula { unknown -> boot [label="restart"]; boot -> boot [label="restart"]; -# reboot - running -> running [label="reboot"]; +# reboot, reset + running -> running [label="reboot / reset"]; + +# attachdisk + running -> hotplug [label="attachdisk / detachdisk"] + hotplug -> running [style="dashed"]; # resubmit "ANY \\ {suspended,done}" -> pending [label="resubmit"]; diff --git a/share/doc/xsd/acct.xsd b/share/doc/xsd/acct.xsd index fe210dc829..3a96b5d37a 100644 --- a/share/doc/xsd/acct.xsd +++ b/share/doc/xsd/acct.xsd @@ -64,7 +64,7 @@ diff --git a/share/doc/xsd/image.xsd b/share/doc/xsd/image.xsd index 51867915b6..aafae26618 100644 --- a/share/doc/xsd/image.xsd +++ b/share/doc/xsd/image.xsd @@ -32,6 +32,18 @@ + + diff --git a/share/doc/xsd/vm.xsd b/share/doc/xsd/vm.xsd index 576790c2a4..134f196d2d 100644 --- a/share/doc/xsd/vm.xsd +++ b/share/doc/xsd/vm.xsd @@ -28,7 +28,7 @@ From 55f7cca13a520349e3e3d321620e0eefaa00953c Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 25 Jun 2012 15:24:29 +0200 Subject: [PATCH 03/14] Fix sunstone session timeout (cherry picked from commit df9ff281c71d1f9f29cffef417395765143a562f) --- src/sunstone/sunstone-server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/sunstone-server.rb b/src/sunstone/sunstone-server.rb index 499284e594..e55cef7a9c 100755 --- a/src/sunstone/sunstone-server.rb +++ b/src/sunstone/sunstone-server.rb @@ -184,7 +184,7 @@ end after do unless request.path=='/login' || request.path=='/' - unless session[:remember] + unless session[:remember] == "true" if params[:timeout] == true env['rack.session.options'][:defer] = true else From 18c41da670f04e46f44871a93d9ca571d57b6eed Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 25 Jun 2012 15:59:04 +0200 Subject: [PATCH 04/14] Remove old quotas from OCCI (cherry picked from commit cf8269df05d8f231e63cc522cfb166a8a280259d) --- src/cloud/occi/lib/UserOCCI.rb | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/cloud/occi/lib/UserOCCI.rb b/src/cloud/occi/lib/UserOCCI.rb index ecb71deb37..55ee0c6f9f 100644 --- a/src/cloud/occi/lib/UserOCCI.rb +++ b/src/cloud/occi/lib/UserOCCI.rb @@ -18,8 +18,6 @@ require 'OpenNebula' include OpenNebula -require 'quota' - class UserOCCI < User FORCE_USAGE = true @@ -28,20 +26,6 @@ class UserOCCI < User <%= self.id.to_s %> <%= self.name %> <%= self['GNAME'] %> - - <% user_quota.each { |key,value| - key_s = key.to_s.upcase - value_i = value.to_i %> - <<%= key_s %>><%= value_i %>> - <% } %> - - - <% user_usage.each { |key,value| - key_s = key.to_s.upcase - value_i = value.to_i %> - <<%= key_s %>><%= value_i %>> - <% } %> - } @@ -52,13 +36,6 @@ class UserOCCI < User # Creates the OCCI representation of a User def to_occi(base_url, verbose=false) - quota = Quota.new - user_usage = quota.get_usage(self.id, nil, FORCE_USAGE) - user_usage.delete(:uid) - - user_quota = quota.get_quota(self.id) - user_quota.delete(:uid) - occi = ERB.new(OCCI_USER) return occi.result(binding).gsub(/\n\s*/,'') end From a708ffb5f597d10f0b4d29024e9dc453cd3d2646 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 25 Jun 2012 15:17:07 +0200 Subject: [PATCH 05/14] Sunstone small fixes and corrections: This commit performs several small changes all around Sunstone: * Unify list bullets * Increase menu indentation to fit better with new menu icons (ozones and selfservice too) * Reduce tab headers width and include icon (took too much space on small screens) * Fix action drop down list gradient to work with opera and other browsers (or fallback to a color) * Do not attempt to plot empty series, instead inform that no monitoring is available: cover the case when no resources exist. * Remove unused, commented code * Fix individual host and VM monitoring information divs width, so no scrollbar appears. * Update documentation links to point to latest available documentation * Fix hotplugging tab width (cherry picked from commit cb4afbc091d124fa330351eb87b3ca1e1e851acc) --- .../occi/lib/ui/public/css/application.css | 5 + src/cloud/occi/lib/ui/public/css/layout.css | 4 +- src/ozones/Server/public/css/application.css | 5 + src/ozones/Server/public/css/layout.css | 4 +- src/sunstone/public/css/application.css | 34 ++-- src/sunstone/public/css/layout.css | 4 +- src/sunstone/public/js/monitoring.js | 15 +- src/sunstone/public/js/opennebula.js | 6 - src/sunstone/public/js/plugins/acls-tab.js | 2 +- .../public/js/plugins/clusters-tab.js | 177 ++++-------------- .../public/js/plugins/dashboard-tab.js | 47 ----- .../public/js/plugins/dashboard-users-tab.js | 47 ----- .../public/js/plugins/datastores-tab.js | 2 +- src/sunstone/public/js/plugins/groups-tab.js | 2 +- src/sunstone/public/js/plugins/hosts-tab.js | 14 +- src/sunstone/public/js/plugins/images-tab.js | 2 +- src/sunstone/public/js/plugins/infra-tab.js | 20 +- .../public/js/plugins/marketplace-tab.js | 2 +- src/sunstone/public/js/plugins/system-tab.js | 19 +- .../public/js/plugins/templates-tab.js | 2 +- src/sunstone/public/js/plugins/users-tab.js | 4 +- src/sunstone/public/js/plugins/vms-tab.js | 35 ++-- src/sunstone/public/js/plugins/vnets-tab.js | 2 +- .../public/js/plugins/vresources-tab.js | 16 +- src/sunstone/public/js/sunstone-util.js | 6 +- 25 files changed, 142 insertions(+), 334 deletions(-) diff --git a/src/cloud/occi/lib/ui/public/css/application.css b/src/cloud/occi/lib/ui/public/css/application.css index d05346ad44..d7b4fb97fd 100644 --- a/src/cloud/occi/lib/ui/public/css/application.css +++ b/src/cloud/occi/lib/ui/public/css/application.css @@ -115,6 +115,11 @@ div.panel_info table.info_table td.value_td { text-align: right; } +div.panel_info ul { + list-style: circle; + margin-left: 25px; +} + .green { color: green!important; } diff --git a/src/cloud/occi/lib/ui/public/css/layout.css b/src/cloud/occi/lib/ui/public/css/layout.css index 8859755b76..2bfe875597 100644 --- a/src/cloud/occi/lib/ui/public/css/layout.css +++ b/src/cloud/occi/lib/ui/public/css/layout.css @@ -136,14 +136,14 @@ body { line-height: 1.8em; font-size: 12px; text-align: left; - padding-left: 30px; + padding-left: 45px; } .navigation li.subsubTab { line-height: 1.7em; font-size: 11px; text-align: left; - padding-left: 40px; + padding-left: 55px; } .navigation li.topTab span.plusIcon, diff --git a/src/ozones/Server/public/css/application.css b/src/ozones/Server/public/css/application.css index 45942c3305..764fa310de 100644 --- a/src/ozones/Server/public/css/application.css +++ b/src/ozones/Server/public/css/application.css @@ -115,6 +115,11 @@ div.panel_info table.info_table td.value_td { text-align: right; } +div.panel_info ul { + list-style: circle; + margin-left: 25px; +} + .green { color: green!important; } diff --git a/src/ozones/Server/public/css/layout.css b/src/ozones/Server/public/css/layout.css index 17d3708045..bff937986d 100644 --- a/src/ozones/Server/public/css/layout.css +++ b/src/ozones/Server/public/css/layout.css @@ -133,14 +133,14 @@ body { line-height: 1.8em; font-size: 12px; text-align: left; - padding-left: 30px; + padding-left: 40px; } .navigation li.subsubTab { line-height: 1.7em; font-size: 11px; text-align: left; - padding-left: 40px; + padding-left: 33px; } .navigation li.topTab span.plusIcon, diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css index 6b023a1a80..1126e30647 100644 --- a/src/sunstone/public/css/application.css +++ b/src/sunstone/public/css/application.css @@ -42,9 +42,10 @@ h2 { margin-bottom: 2px; margin-top: 8px; padding-bottom: 2px; - width:400px; + width:280px; + minWidth: 200px; color: #636663; - border-bottom: 3px solid; + border-bottom: 2px solid; } h3 { @@ -140,6 +141,11 @@ div.panel_info table.info_table td.value_td { text-align: right; } +div.panel_info ul { + list-style: circle; + margin-left: 25px; +} + .green { color: green!important; } @@ -548,18 +554,6 @@ ul.action_list{ /*background: #EDEDED;*/ border: 1px solid #525252; - background-image: -webkit-gradient( - linear, - left bottom, - left top, - color-stop(0.25, #E9E9E9), - color-stop(0.63, #F5F5F5) - ); - background-image: -moz-linear-gradient( - center bottom, - #E9E9E9 25%, - #F5F5F5 63% - ); position:absolute; z-index:1; list-style-type:none; @@ -574,6 +568,15 @@ ul.action_list{ border-radius:4px; border-bottom-right-radius:5px; border-bottom-left-radius:5px; + + background: rgb(233,233,233); /* Old browsers */ + background: -moz-linear-gradient(top, rgba(233,233,233,1) 25%, rgba(245,245,245,1) 63%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(25%,rgba(233,233,233,1)), color-stop(63%,rgba(245,245,245,1))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, rgba(233,233,233,1) 25%,rgba(245,245,245,1) 63%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, rgba(233,233,233,1) 25%,rgba(245,245,245,1) 63%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, rgba(233,233,233,1) 25%,rgba(245,245,245,1) 63%); /* IE10+ */ + background: linear-gradient(top, rgba(233,233,233,1) 25%,rgba(245,245,245,1) 63%); /* W3C */ + } ul.action_list li a{ @@ -654,7 +657,8 @@ ul.action_list li a:hover{ } .legend_p:before { - content: '⇨ '; +/* content: '⇨ '; */ + content: '○ '; } .big_text { diff --git a/src/sunstone/public/css/layout.css b/src/sunstone/public/css/layout.css index fca154e949..10594db12a 100644 --- a/src/sunstone/public/css/layout.css +++ b/src/sunstone/public/css/layout.css @@ -141,14 +141,14 @@ body { line-height: 1.8em; font-size: 12px; text-align: left; - padding-left: 30px; + padding-left: 45px; } .navigation li.subsubTab { line-height: 1.7em; font-size: 11px; text-align: left; - padding-left: 40px; + padding-left: 55px; } .navigation li.topTab span.plusIcon, diff --git a/src/sunstone/public/js/monitoring.js b/src/sunstone/public/js/monitoring.js index 59143bcacd..5b31bc1fd6 100644 --- a/src/sunstone/public/js/monitoring.js +++ b/src/sunstone/public/js/monitoring.js @@ -37,7 +37,14 @@ var SunstoneMonitoring = { plot : function(resource,plotID,container,series){ var config = SunstoneMonitoringConfig[resource].monitor[plotID] var options = config.plotOptions - $.plot(container,series,options) + + if (!series.length){ + $(container).unbind(); + $(container).text(tr("No monitoring information available")); + } + else { + $.plot(container,series,options) + } }, ops : { partition : function(resource,list,config){ @@ -95,7 +102,7 @@ var SunstoneMonitoring = { return series }, hostCpuUsagePartition : function(resource,list,config){ - partitions = { + var partitions = { "Idle" : 0, "Ok" : 0, "Used" : 0, @@ -103,6 +110,8 @@ var SunstoneMonitoring = { "Overloaded" : 0 } + if (!list.length) return []; + for (var i=0; i< list.length; i++){ var elem = list[i][resource] var value = elem.HOST_SHARE.USED_CPU * 100 / @@ -119,7 +128,7 @@ var SunstoneMonitoring = { partitions["Idle"]++ } - series = []; + var series = []; for (partition in partitions) { var data = partitions[partition] var color = config.colorize ? config.colorize(partition) : null diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 0f79839ac3..c8c52b4f27 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -482,9 +482,6 @@ var OpenNebula = { "monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.Host.resource,false); }, - "monitor_all" : function(params){ - OpenNebula.Action.monitor(params,OpenNebula.Host.resource,true); - } }, "Network": { @@ -677,9 +674,6 @@ var OpenNebula = { "monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.VM.resource,false); }, - "monitor_all" : function(params){ - OpenNebula.Action.monitor(params,OpenNebula.VM.resource,true); - }, "attachdisk" : function(params){ var action_obj = {"disk_template": params.data.extra_param}; OpenNebula.Action.simple_action(params,OpenNebula.VM.resource, diff --git a/src/sunstone/public/js/plugins/acls-tab.js b/src/sunstone/public/js/plugins/acls-tab.js index 34df47a434..9a9b8109b0 100644 --- a/src/sunstone/public/js/plugins/acls-tab.js +++ b/src/sunstone/public/js/plugins/acls-tab.js @@ -19,7 +19,7 @@ var dataTable_acls; var $create_acl_dialog; var acls_tab_content = '\ -

'+tr("Access Control Lists")+'

\ +

'+tr("Access Control Lists")+'

\
\
\
\ diff --git a/src/sunstone/public/js/plugins/clusters-tab.js b/src/sunstone/public/js/plugins/clusters-tab.js index ca5e3f7421..68db501e7c 100644 --- a/src/sunstone/public/js/plugins/clusters-tab.js +++ b/src/sunstone/public/js/plugins/clusters-tab.js @@ -18,7 +18,7 @@ var clusters_tab_content = '\ -

'+tr("Clusters")+'

\ +

'+tr("Clusters")+'

\ \
\
\ @@ -496,8 +496,8 @@ function clusterTabContent(cluster_json) { ' + tr("Hosts CPU Usage") + '\ \ \ -
\ -
\ +
\ +
\ \ \ \ @@ -534,10 +534,11 @@ function clusterTabContent(cluster_json) {
\

' + tr("Hosts") + '

\ \ \ \ @@ -546,9 +547,10 @@ function clusterTabContent(cluster_json) { \ \ @@ -558,9 +560,10 @@ function clusterTabContent(cluster_json) { \ \ @@ -599,8 +602,9 @@ function clusterTabContent(cluster_json) { ' + tr("Hosts CPU Usage") + '\ \ \ -
\ -
\ + \ +
'+tr("No monitoring information available")+'
\ +
'+tr("No monitoring information available")+'
\ \ \ \ @@ -639,8 +643,9 @@ function clusterTabContent(cluster_json) {
\ \


'+tr("Current number of hosts in this cluster")+': '+hosts_n+'.

\ - '+tr("Create new host")+'
\ - '+tr("Manage cluster hosts")+'

\ +
\ \ @@ -653,8 +658,10 @@ function clusterTabContent(cluster_json) { \


'+tr("Current number of datastores in this cluster")+': '+dss_n+'.

\ \ - '+tr("Create new datastore")+'
\ - '+tr("Manage cluster datastores")+'

\ + \
\ \ \ @@ -667,8 +674,10 @@ function clusterTabContent(cluster_json) { \


'+tr("Current number of virtual networks in this cluster")+': '+vnets_n+'.

\ \ - '+tr("Create new virtual network")+'
\ - '+tr("Manage cluster virtual networks")+'

\ + \ \ \ \ @@ -754,10 +763,6 @@ function newClusterMenuElement(element){ }; */ Sunstone.addMainTab('cluster_tab_'+cluster.ID,menu_cluster,true); - $('li#li_cluster_tab_'+cluster.ID).click(function(){ - $('div#cluster_tab_'+cluster.ID+' div.plot').trigger('resize'); - }); - // Sunstone.addMainTab('cluster_hosts_tab_'+cluster.ID,submenu_hosts,true); // Sunstone.addMainTab('cluster_datastores_tab_'+cluster.ID,submenu_datastores,true); @@ -813,118 +818,6 @@ function clusterResourceViewListeners(){ */ }; -/* -//Updates the host info panel tab content and pops it up -function updateHostInfo(request,host){ - var host_info = host.HOST; - - //Information tab - var info_tab = { - title : tr("Host information"), - content : - '\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
' + tr("Host information") + ' - '+host_info.NAME+'
' + tr("id") + ''+host_info.ID+'
' + tr("Name") + ''+host_info.NAME+'
' + tr("Cluster") + ''+host_info.CLUSTER+'
' + tr("State") + ''+tr(OpenNebula.Helper.resource_state("host",host_info.STATE))+'
' + tr("IM MAD") + ''+host_info.IM_MAD+'
' + tr("VM MAD") + ''+host_info.VM_MAD+'
'+ tr("VN MAD") +''+host_info.VN_MAD+'
'+ tr("TM MAD") +''+host_info.TM_MAD+'
\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
' + tr("Host shares") + '
' + tr("Max Mem") + ''+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'
' + tr("Used Mem (real)") + ''+humanize_size(host_info.HOST_SHARE.USED_MEM)+'
' + tr("Used Mem (allocated)") + ''+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'
' + tr("Used CPU (real)") + ''+host_info.HOST_SHARE.USED_CPU+'
' + tr("Used CPU (allocated)") + ''+host_info.HOST_SHARE.CPU_USAGE+'
' + tr("Running VMs") + ''+host_info.HOST_SHARE.RUNNING_VMS+'
' - } - - //Template tab - var template_tab = { - title : tr("Host template"), - content : - '\ - '+ - prettyPrintJSON(host_info.TEMPLATE)+ - '
' + tr("Host template") + '
' - } - - var monitor_tab = { - title: tr("Monitoring information"), - content : generateMonitoringDivs(host_graphs,"host_monitor_") - } - - //Sunstone.updateInfoPanelTab(info_panel_name,tab_name, new tab object); - Sunstone.updateInfoPanelTab("host_info_panel","host_info_tab",info_tab); - Sunstone.updateInfoPanelTab("host_info_panel","host_template_tab",template_tab); - Sunstone.updateInfoPanelTab("host_info_panel","host_monitoring_tab",monitor_tab); - - Sunstone.popUpInfoPanel("host_info_panel"); - //pop up panel while we retrieve the graphs - for (var i=0; i'); @@ -968,7 +861,15 @@ function popUpCreateClusterDialog(){ } function monitorClusters(list){ - clustered_hosts = {} + var clustered_hosts = { "-" : []} + + //extract current clusters from table + //and initialize the object in which hosts will be divided + var cluster_list = dataTable_clusters.fnGetData(); + $.each(cluster_list,function(){ + clustered_hosts[this[1]] = [] + }); + for (var i = 0; i < list.length; i++){ var cluster_id = list[i].HOST.CLUSTER_ID; if (!clustered_hosts[cluster_id]) diff --git a/src/sunstone/public/js/plugins/dashboard-tab.js b/src/sunstone/public/js/plugins/dashboard-tab.js index 73282092aa..a9f0a1f65b 100644 --- a/src/sunstone/public/js/plugins/dashboard-tab.js +++ b/src/sunstone/public/js/plugins/dashboard-tab.js @@ -188,53 +188,6 @@ Sunstone.addMainTab('dashboard_tab',dashboard_tab); var $dashboard; -function plot_global_graph(data,info){ - var context = $('#historical_table',main_tabs_context); - var id = info.title; - var monitoring = data.monitoring; - var serie; - var series = []; - var width = ($(window).width()-129)*48/100; - var mon_count = 0; - var labels_array = info.monitor_resources.split(','); - - $('#'+id,context).html('
'); - - for (var i=0; i
'); - - for (var i=0; i\ +

'+tr("Datastores")+'

\ \
\
\ diff --git a/src/sunstone/public/js/plugins/groups-tab.js b/src/sunstone/public/js/plugins/groups-tab.js index df5c7fe6ff..aeafedeff9 100644 --- a/src/sunstone/public/js/plugins/groups-tab.js +++ b/src/sunstone/public/js/plugins/groups-tab.js @@ -20,7 +20,7 @@ var $create_group_dialog; var $group_quotas_dialog; var groups_tab_content = '\ -

'+tr("Groups")+'

\ +

'+tr("Groups")+'

\ \
\
\ diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js index f181a6049c..04b815e62e 100644 --- a/src/sunstone/public/js/plugins/hosts-tab.js +++ b/src/sunstone/public/js/plugins/hosts-tab.js @@ -34,7 +34,7 @@ var host_graphs = [ var hosts_tab_content = '\ -

'+tr("Hosts")+'

\ +

'+tr("Hosts")+'

\ \
\
\ @@ -237,16 +237,6 @@ var host_actions = { error: hostMonitorError }, - "Host.monitor_all" : { - type: "monitor_global", - call: OpenNebula.Host.monitor_all, - callback: function(req,response) { - var info = req.request.data[0].monitor; - plot_global_graph(response,info); - }, - error: onError - }, - "Host.fetch_template" : { type: "single", call: OpenNebula.Host.fetch_template, @@ -378,7 +368,7 @@ SunstoneMonitoringConfig['HOST'] = { $('#totalHosts', $dashboard).text(monitoring['totalHosts']) delete monitoring['totalHosts'] - if (!$dashboard.is(':visible')) return; + //if (!$dashboard.is(':visible')) return; for (plotID in monitoring){ var container = $('div#'+plotID,$dashboard); diff --git a/src/sunstone/public/js/plugins/images-tab.js b/src/sunstone/public/js/plugins/images-tab.js index c52d9e51e1..be93b0abee 100644 --- a/src/sunstone/public/js/plugins/images-tab.js +++ b/src/sunstone/public/js/plugins/images-tab.js @@ -17,7 +17,7 @@ /*Images tab plugin*/ var images_tab_content = '\ -

'+tr("Images")+'

\ +

'+tr("Images")+'

\ \
\
\ diff --git a/src/sunstone/public/js/plugins/infra-tab.js b/src/sunstone/public/js/plugins/infra-tab.js index bb5551a48a..50acc37f44 100644 --- a/src/sunstone/public/js/plugins/infra-tab.js +++ b/src/sunstone/public/js/plugins/infra-tab.js @@ -53,12 +53,12 @@ var infra_tab_content = \ \ @@ -75,10 +75,10 @@ var infra_tab_content =

network icon'+tr("The Infrastructure menu allows management of Hosts, Datastores, Virtual Networks. Users in the oneadmin group can manage clusters as well.")+'

\

'+tr("You can find further information on the following links:")+'

\ \
\
\ diff --git a/src/sunstone/public/js/plugins/marketplace-tab.js b/src/sunstone/public/js/plugins/marketplace-tab.js index 689d2a0b4b..64f92a5fb8 100644 --- a/src/sunstone/public/js/plugins/marketplace-tab.js +++ b/src/sunstone/public/js/plugins/marketplace-tab.js @@ -129,7 +129,7 @@ var market_buttons = { }; var marketplace_tab_content = '\ -

'+tr("OpenNebula Marketplace")+'

\ +

'+tr("OpenNebula Marketplace")+'

\ \
\
\ diff --git a/src/sunstone/public/js/plugins/system-tab.js b/src/sunstone/public/js/plugins/system-tab.js index 6e93b1278f..fd0bbe78f9 100644 --- a/src/sunstone/public/js/plugins/system-tab.js +++ b/src/sunstone/public/js/plugins/system-tab.js @@ -49,11 +49,11 @@ var system_tab_content = \ \ @@ -70,10 +70,11 @@ var system_tab_content =

user'+tr("System resources management is only accesible to users of the oneadmin group. It comprises the operations regarding OpenNebula groups, users and ACLs.")+'

\

'+tr("You can find further information on the following links:")+'

\ \
\ \ diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 5b97595544..359ea14e42 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -17,7 +17,7 @@ /*Templates tab plugin*/ var templates_tab_content = '\ -

'+tr("Templates")+'

\ +

'+tr("Templates")+'

\ \
\
\ diff --git a/src/sunstone/public/js/plugins/users-tab.js b/src/sunstone/public/js/plugins/users-tab.js index 2bc4e8ac40..07602a9c8b 100644 --- a/src/sunstone/public/js/plugins/users-tab.js +++ b/src/sunstone/public/js/plugins/users-tab.js @@ -22,7 +22,7 @@ var $user_quotas_dialog; var $update_pw_dialog; var users_tab_content = '\ -

'+tr("Users")+'

\ +

'+tr("Users")+'

\ \
\
\ @@ -446,7 +446,7 @@ SunstoneMonitoringConfig['USER'] = { plot: function(monitoring){ $('#totalUsers', $dashboard).text(monitoring['totalUsers']) - if (!$dashboard.is(':visible')) return; + //if (!$dashboard.is(':visible')) return; var container = $('div#usersPerGroup',$dashboard); SunstoneMonitoring.plot('USER', diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index f4e353b01c..997fe4500e 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -56,7 +56,7 @@ var netUsage = { } var vms_tab_content = '\ -

'+tr("Virtual Machines")+'

\ +

'+tr("Virtual Machines")+'

\ \
\
\ @@ -441,15 +441,7 @@ var vm_actions = { }, error: vmMonitorError }, - "VM.monitor_all" : { - type: "monitor_global", - call: OpenNebula.VM.monitor_all, - callback: function(req,response) { - var info = req.request.data[0].monitor; - plot_global_graph(response,info); - }, - error: onError - }, + "VM.chown" : { type: "multiple", call: OpenNebula.VM.chown, @@ -697,7 +689,7 @@ SunstoneMonitoringConfig['VM'] = { netUsage.up = monitoring['netUsageBar'][1].data[0][0] netUsage.down = monitoring['netUsageBar'][0].data[0][0] - if (!$dashboard.is(':visible')) return; + //if (!$dashboard.is(':visible')) return; var container = $('div#vmStatePie',$dashboard); SunstoneMonitoring.plot('VM', @@ -1085,7 +1077,8 @@ function updateVMInfo(request,vm){ Sunstone.runAction("VM.monitor",vm_info.ID,vm_graphs[i]); }; - var $hotplugging_tab = $('div#vm_info_panel div#vm_hotplugging_tab'); + var $info_panel = $('div#vm_info_panel'); + var $hotplugging_tab = $('div#vm_hotplugging_tab', $info_panel); $('tr.at_volatile',$hotplugging_tab).hide(); $('tr.at_image',$hotplugging_tab).show(); } @@ -1099,7 +1092,7 @@ function printDisks(vm_info){ [tr("DISABLED"),tr("LOCKED"),tr("ERROR")] ); var html ='\ - \ + \ \ \ \ @@ -1146,7 +1139,7 @@ function printDisks(vm_info){ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ @@ -80,9 +80,9 @@ var vres_tab_content =

'+tr("Virtual Machine templates can be instantiated as many times as you want. You can do it from the Templates tab or by creating a new VM in the VM tab. The second method allows you to customize the name and the number of VMs you want to launch.")+'

\

'+tr("You can find further information on the following links:")+'

\ \ \ \ diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index 636c21e4e4..fa0999b477 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -603,8 +603,8 @@ function escapeDoubleQuotes(string){ function generateMonitoringDivs(graphs, id_prefix){ var str = ""; //43% of the width of the screen minus - //129px (left menu size) - var width = ($(window).width()-129)*40/100; + //181px (left menu size) + var width = ($(window).width()-181)*40/100; var id_suffix=""; var label=""; var id=""; @@ -618,7 +618,7 @@ function generateMonitoringDivs(graphs, id_prefix){ \ \
'+tr("Disks information")+'
\ - \ \ \ \ @@ -1154,24 +1147,24 @@ function printDisks(vm_info){
\ - \ '+im_sel+'\ \
\ - \ + \
\ - \ + \
\ - \ \ \ \ @@ -1179,12 +1172,12 @@ function printDisks(vm_info){
\ - \ + \
\ - \ \ \ \ @@ -1192,7 +1185,7 @@ function printDisks(vm_info){
\ - \ \ \ \ diff --git a/src/sunstone/public/js/plugins/vnets-tab.js b/src/sunstone/public/js/plugins/vnets-tab.js index 530dcf2cdc..27cbb7fd31 100644 --- a/src/sunstone/public/js/plugins/vnets-tab.js +++ b/src/sunstone/public/js/plugins/vnets-tab.js @@ -17,7 +17,7 @@ /*Virtual networks tab plugin*/ var vnets_tab_content = '\ -

'+tr("Virtual Networks")+'

\ +

'+tr("Virtual Networks")+'

\ \
\
\ diff --git a/src/sunstone/public/js/plugins/vresources-tab.js b/src/sunstone/public/js/plugins/vresources-tab.js index 1d5494370e..494f8eb1a2 100644 --- a/src/sunstone/public/js/plugins/vresources-tab.js +++ b/src/sunstone/public/js/plugins/vresources-tab.js @@ -58,11 +58,11 @@ var vres_tab_content = \
'+this.title+'
\ -
'+ +
'+ spinner+ '
\
'; From b91bb29284b2d547c952fff17090065a3c577027 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 26 Jun 2012 18:49:31 +0200 Subject: [PATCH 06/14] Feature #1254: datastore_mad part of the full iscsi support. This commit has adapted from the contribution provided by SZTAKI LPDS. --- src/datastore_mad/remotes/iscsi/cp | 24 +++++++++------ src/datastore_mad/remotes/iscsi/iscsi.conf | 4 +++ src/datastore_mad/remotes/iscsi/mkfs | 34 ++++++++++------------ src/datastore_mad/remotes/iscsi/rm | 6 ++-- src/mad/sh/scripts_common.sh | 18 ++++++++++++ 5 files changed, 57 insertions(+), 29 deletions(-) diff --git a/src/datastore_mad/remotes/iscsi/cp b/src/datastore_mad/remotes/iscsi/cp index 44119c73b7..22dec153e9 100755 --- a/src/datastore_mad/remotes/iscsi/cp +++ b/src/datastore_mad/remotes/iscsi/cp @@ -56,6 +56,7 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_TID \ + /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/TARGET_CONF \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE \ /DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/MD5 \ @@ -69,10 +70,11 @@ DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}" VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}" BASE_IQN="${XPATH_ELEMENTS[6]:-$BASE_IQN}" BASE_TID="${XPATH_ELEMENTS[7]:-$BASE_TID}" -SRC="${XPATH_ELEMENTS[8]}" -SIZE="${XPATH_ELEMENTS[9]}" -MD5="${XPATH_ELEMENTS[10]}" -SHA1="${XPATH_ELEMENTS[11]}" +TARGET_CONF="${XPATH_ELEMENTS[8]:-$TARGET_CONF}" +SRC="${XPATH_ELEMENTS[9]}" +SIZE="${XPATH_ELEMENTS[10]}" +MD5="${XPATH_ELEMENTS[11]}" +SHA1="${XPATH_ELEMENTS[12]}" set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK" @@ -80,14 +82,18 @@ LV_NAME="lv-one-${ID}" IQN="$BASE_IQN:$DST_HOST.$VG_NAME.$LV_NAME" DEV="/dev/$VG_NAME/$LV_NAME" -let TID=ID+BASE_TID - REGISTER_CMD=$(cat <& /dev/null" +} + ### function iscsiadm_discovery { From d3d122592b1bde3664ce9fe5782832ac12262f8a Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 28 Jun 2012 14:46:54 +0200 Subject: [PATCH 07/14] Feature #1254: BASE_TID is hardcoded to 1. TARGET_CONF is globally defined in the configuration file. --- src/datastore_mad/remotes/iscsi/cp | 13 +++++-------- src/datastore_mad/remotes/iscsi/iscsi.conf | 3 --- src/datastore_mad/remotes/iscsi/mkfs | 10 ++-------- src/datastore_mad/remotes/iscsi/rm | 4 +--- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/datastore_mad/remotes/iscsi/cp b/src/datastore_mad/remotes/iscsi/cp index 22dec153e9..1e693e5033 100755 --- a/src/datastore_mad/remotes/iscsi/cp +++ b/src/datastore_mad/remotes/iscsi/cp @@ -56,7 +56,6 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_TID \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/TARGET_CONF \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE \ /DS_DRIVER_ACTION_DATA/IMAGE/TEMPLATE/MD5 \ @@ -69,12 +68,10 @@ UMASK="${XPATH_ELEMENTS[3]}" DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}" VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}" BASE_IQN="${XPATH_ELEMENTS[6]:-$BASE_IQN}" -BASE_TID="${XPATH_ELEMENTS[7]:-$BASE_TID}" -TARGET_CONF="${XPATH_ELEMENTS[8]:-$TARGET_CONF}" -SRC="${XPATH_ELEMENTS[9]}" -SIZE="${XPATH_ELEMENTS[10]}" -MD5="${XPATH_ELEMENTS[11]}" -SHA1="${XPATH_ELEMENTS[12]}" +SRC="${XPATH_ELEMENTS[7]}" +SIZE="${XPATH_ELEMENTS[8]}" +MD5="${XPATH_ELEMENTS[9]}" +SHA1="${XPATH_ELEMENTS[10]}" set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK" @@ -88,7 +85,7 @@ REGISTER_CMD=$(cat < Date: Thu, 28 Jun 2012 14:54:03 +0200 Subject: [PATCH 08/14] Feature #1254: tm_mad part of the full iSCSI support. This commit has adapted from the contribution provided by SZTAKI LPDS. --- src/tm_mad/iscsi/clone | 74 +++++++++++++++++++++++++++++++++-- src/tm_mad/iscsi/delete | 87 +++++++++++++++++++++++++++++++++++------ src/tm_mad/iscsi/ln | 3 +- src/tm_mad/iscsi/mv | 1 - src/tm_mad/iscsi/mvds | 60 +++++++++++++++++++++++++++- 5 files changed, 206 insertions(+), 19 deletions(-) diff --git a/src/tm_mad/iscsi/clone b/src/tm_mad/iscsi/clone index 5d51fdabd4..b0f827830c 100755 --- a/src/tm_mad/iscsi/clone +++ b/src/tm_mad/iscsi/clone @@ -36,8 +36,76 @@ else TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh fi -. $TMCOMMON +DRIVER_PATH=$(dirname $0) -log_error "CLONE not supported for TM_ISCSI. Use persistent images" + . $TMCOMMON -exit 1 +#------------------------------------------------------------------------------- +# Set src, dst path and dir +#------------------------------------------------------------------------------- + +TARGET=`arg_path $SRC` + +DST_PATH=`arg_path $DST` +DST_HOST=`arg_host $DST` +DST_DIR=`dirname $DST_PATH` + +#------------------------------------------------------------------------------- +# IQN and TARGETs +#------------------------------------------------------------------------------- + +IQN=$SRC +NEW_IQN=$IQN-$VM_ID + +VG_NAME=`echo $TARGET|$AWK -F. '{print $(NF-1)}'` +LV_NAME=`echo $TARGET|$AWK -F. '{print $(NF)}'` +SOURCE_DEV="/dev/$VG_NAME/$LV_NAME" + +TARGET_LV_NAME=`echo $LV_NAME-$VMID` +TARGET_DEV="/dev/${VG_NAME}/${TARGET_LV_NAME}" +TARGET_HOST="${TARGET%.$VG_NAME.$LV_NAME}" + +#------------------------------------------------------------------------------- +# Clone script +#------------------------------------------------------------------------------- + +CLONE_CMD=$(cat < Date: Thu, 28 Jun 2012 14:58:01 +0200 Subject: [PATCH 09/14] Feature #1254: Dump tgtadmin configuration in the clone and rm events. --- src/datastore_mad/remotes/iscsi/clone | 1 + src/datastore_mad/remotes/iscsi/rm | 1 + 2 files changed, 2 insertions(+) diff --git a/src/datastore_mad/remotes/iscsi/clone b/src/datastore_mad/remotes/iscsi/clone index 8b0fe39205..4dbdd8a821 100755 --- a/src/datastore_mad/remotes/iscsi/clone +++ b/src/datastore_mad/remotes/iscsi/clone @@ -85,6 +85,7 @@ CLONE_CMD=$(cat < Date: Thu, 28 Jun 2012 16:11:54 +0200 Subject: [PATCH 10/14] Feature #1254: Completely drop BASE_TID --- src/datastore_mad/remotes/iscsi/clone | 16 +++++++--------- src/datastore_mad/remotes/iscsi/cp | 1 - src/datastore_mad/remotes/iscsi/mkfs | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/datastore_mad/remotes/iscsi/clone b/src/datastore_mad/remotes/iscsi/clone index 4dbdd8a821..f60dd02fa8 100755 --- a/src/datastore_mad/remotes/iscsi/clone +++ b/src/datastore_mad/remotes/iscsi/clone @@ -51,7 +51,6 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/DATASTORE/BASE_PATH \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/HOST \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/VG_NAME \ /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_IQN \ - /DS_DRIVER_ACTION_DATA/DATASTORE/TEMPLATE/BASE_TID \ /DS_DRIVER_ACTION_DATA/IMAGE/PATH \ /DS_DRIVER_ACTION_DATA/IMAGE/SIZE) @@ -62,9 +61,8 @@ UMASK="${XPATH_ELEMENTS[3]}" DST_HOST="${XPATH_ELEMENTS[4]:-$HOST}" VG_NAME="${XPATH_ELEMENTS[5]:-$VG_NAME}" BASE_IQN="${XPATH_ELEMENTS[6]:-$BASE_IQN}" -BASE_TID="${XPATH_ELEMENTS[7]:-$BASE_TID}" -SRC="${XPATH_ELEMENTS[8]}" -SIZE="${XPATH_ELEMENTS[9]}" +SRC="${XPATH_ELEMENTS[7]}" +SIZE="${XPATH_ELEMENTS[8]}" set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK" @@ -72,8 +70,6 @@ LV_NAME="lv-one-${ID}" IQN="$BASE_IQN:$DST_HOST.$VG_NAME.$LV_NAME" DEV="/dev/$VG_NAME/$LV_NAME" -let TID=ID+BASE_TID - LV_SRC=$(echo $SRC|awk -F. '{print $NF}') DEV_SRC="/dev/$VG_NAME/$LV_SRC" @@ -82,9 +78,11 @@ CLONE_CMD=$(cat < Date: Thu, 28 Jun 2012 16:45:21 +0200 Subject: [PATCH 11/14] Feature #1254: fix small clone typos --- src/tm_mad/iscsi/clone | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tm_mad/iscsi/clone b/src/tm_mad/iscsi/clone index b0f827830c..384eb7379c 100755 --- a/src/tm_mad/iscsi/clone +++ b/src/tm_mad/iscsi/clone @@ -55,7 +55,7 @@ DST_DIR=`dirname $DST_PATH` #------------------------------------------------------------------------------- IQN=$SRC -NEW_IQN=$IQN-$VM_ID +NEW_IQN=$IQN-$VMID VG_NAME=`echo $TARGET|$AWK -F. '{print $(NF-1)}'` LV_NAME=`echo $TARGET|$AWK -F. '{print $(NF)}'` @@ -76,7 +76,7 @@ CLONE_CMD=$(cat < Date: Thu, 28 Jun 2012 17:23:46 +0200 Subject: [PATCH 12/14] Feature #1254: load iscsi.conf from all the tm iscsi scripts --- src/tm_mad/iscsi/clone | 2 ++ src/tm_mad/iscsi/ln | 3 +++ src/tm_mad/iscsi/mvds | 2 ++ 3 files changed, 7 insertions(+) diff --git a/src/tm_mad/iscsi/clone b/src/tm_mad/iscsi/clone index 384eb7379c..ccce7f0df8 100755 --- a/src/tm_mad/iscsi/clone +++ b/src/tm_mad/iscsi/clone @@ -40,6 +40,8 @@ DRIVER_PATH=$(dirname $0) . $TMCOMMON +source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf + #------------------------------------------------------------------------------- # Set src, dst path and dir #------------------------------------------------------------------------------- diff --git a/src/tm_mad/iscsi/ln b/src/tm_mad/iscsi/ln index 3a19daacab..c2529ee253 100755 --- a/src/tm_mad/iscsi/ln +++ b/src/tm_mad/iscsi/ln @@ -38,6 +38,9 @@ fi . $TMCOMMON +DRIVER_PATH=$(dirname $0) + +source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf #------------------------------------------------------------------------------- # Set dst path and dir #------------------------------------------------------------------------------- diff --git a/src/tm_mad/iscsi/mvds b/src/tm_mad/iscsi/mvds index 6a89f9ae0c..53d7f87cfc 100755 --- a/src/tm_mad/iscsi/mvds +++ b/src/tm_mad/iscsi/mvds @@ -40,6 +40,8 @@ DRIVER_PATH=$(dirname $0) . $TMCOMMON +source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf + SRC_HOST=`arg_host $SRC` NEW_IQN="$DST" From 7bdc2ab16c143a59af3c6ced8f70360e550d65c4 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Fri, 29 Jun 2012 10:52:23 +0200 Subject: [PATCH 13/14] Feature #1254: Enhance TM MV action --- src/tm_mad/iscsi/mv | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/tm_mad/iscsi/mv b/src/tm_mad/iscsi/mv index 2936cac94f..066c4eeb7a 100755 --- a/src/tm_mad/iscsi/mv +++ b/src/tm_mad/iscsi/mv @@ -71,32 +71,43 @@ if [ "$SRC" == "$DST" ]; then exit 0 fi +#------------------------------------------------------------------------------- +# Get image information +#------------------------------------------------------------------------------- + +XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin" + +unset i XPATH_ELEMENTS + +while IFS= read -r -d '' element; do + XPATH_ELEMENTS[i++]="$element" +done < <(onevm show -x $VMID| $XPATH \ + /VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/PERSISTENT) + +PERSISTENT="${XPATH_ELEMENTS[0]}" + +if [ -z "$PERSISTENT" ]; then + IQN=$IQN-$VMID +fi + +#------------------------------------------------------------------------------- +# Start actions +#------------------------------------------------------------------------------- + if is_iscsi "$SRC_HOST"; then log "Logging out of $IQN in $SRC_HOST" LOGOUT_CMD=$(cat < Date: Fri, 29 Jun 2012 09:36:09 +0200 Subject: [PATCH 14/14] Feature #1254: Fix bugs in full iSCSI support --- src/datastore_mad/remotes/iscsi/mkfs | 4 +++- src/tm_mad/iscsi/delete | 18 +++++++++++++----- src/tm_mad/iscsi/mv | 11 +++++++---- src/tm_mad/iscsi/mvds | 8 +++++++- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/datastore_mad/remotes/iscsi/mkfs b/src/datastore_mad/remotes/iscsi/mkfs index 5554e9bcca..2665bb036d 100755 --- a/src/datastore_mad/remotes/iscsi/mkfs +++ b/src/datastore_mad/remotes/iscsi/mkfs @@ -84,7 +84,9 @@ REGISTER_CMD=$(cat <