From 244ef191538540517fbf372da442040d077d36e9 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 23 Sep 2011 21:07:27 +0200 Subject: [PATCH 01/28] Feature #790: Update oZones create VDC dialog By default the new dialog only shows the hosts of the selected zone which are not part of a different VDC. An option exists to force addition of hosts which do not complain with the uniqueness requirement. (cherry picked from commit 776c18825733c7f9fe9c18bd4aa78fb377cefb39) Conflicts: src/ozones/Server/models/OzonesServer.rb (cherry picked from commit cbec09ab8c53d4b4ab8b795e04bb33d71f38ea7a) --- src/ozones/Server/models/OzonesServer.rb | 34 ++++---- .../Server/public/js/plugins/vdcs-tab.js | 80 +++++++++++++++++-- 2 files changed, 93 insertions(+), 21 deletions(-) diff --git a/src/ozones/Server/models/OzonesServer.rb b/src/ozones/Server/models/OzonesServer.rb index 25eeed4204..d7623781ba 100644 --- a/src/ozones/Server/models/OzonesServer.rb +++ b/src/ozones/Server/models/OzonesServer.rb @@ -165,12 +165,13 @@ class OzonesServer return [404, error.to_json] end - if (!vdc_data[:force] or vdc_data[:force].upcase!="YES") and + if (!defined? vdc_data[:force] or + (defined? vdc_data[:force] and vdc_data[:force]!="yes")) and !host_uniqueness?(zone, vdc_data[:hosts]) return [403, OZones::Error.new( "Error: Couldn't create resource #{kind}. " + - "Hosts are not unique, and no force option" + - " was given.").to_json] + "One or several hosts belong to a different VDC "+ + "and no force option was provided.").to_json] end vdcadminname = vdc_data[:vdcadminname] @@ -265,7 +266,7 @@ class OzonesServer return [404, error.to_json] end end - + ############################################################################ # Update resources ############################################################################ @@ -289,7 +290,7 @@ class OzonesServer } # Check parameters - if !vdc_data[:hosts] || !vdc_id + if !vdc_data[:hosts] || !vdc_id return [400, OZones::Error.new( "Error: Couldn't update resource #{kind}. " + "Need ID and HOSTS to update.").to_json] @@ -302,7 +303,7 @@ class OzonesServer "#{vdc_id} not found, cannot update Vdc.") return [404, error.to_json] end - + # Get the zone where the Vdc belongs zone=OZones::Zones.get(vdc.zones.id) if !zone @@ -310,24 +311,25 @@ class OzonesServer "#{vdc.zones.id} not found, cannot update Vdc.") return [404, error.to_json] end - - if (!vdc_data[:force] or vdc_data[:force].upcase!="YES") and - !host_uniqueness?(zone, vdc_data[:hosts], vdc_id.to_i) + + if (!defined? vdc_data[:force] or + (defined? vdc_data[:force] and vdc_data[:force]!="yes")) and + !host_uniqueness?(zone, vdc_data[:hosts], vdc_id.to_i) return [403, OZones::Error.new( "Error: Couldn't update resource #{kind}. " + - "Hosts are not unique, and no force option" + - " was given.").to_json] + "One or several hosts belong to a different VDC "+ + "and no force option was provided.").to_json] end - + rc = @ocaInt.update_vdc_hosts(zone, vdc, vdc_data[:hosts]) - + if !OpenNebula.is_error?(rc) vdc.hosts = vdc_data[:hosts] vdc.get_host_acls!(rc) vdc.save - - if vdc.saved? + + if vdc.saved? return [200, vdc.to_json] else return [500, OZones::Error.new( @@ -378,7 +380,7 @@ class OzonesServer ############################################################################ # Helper functions ############################################################################ - + # Check if hosts are already include in any Vdc of the zone def host_uniqueness?(zone, host_list, vdc_id = -1) all_hosts = "" diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index dcd5555296..572d7db5e0 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -25,6 +25,7 @@ var vdcs_tab_content = ID\ Name\ Zone ID\ + Hosts\ \ \ \ @@ -44,7 +45,12 @@ var create_vdc_tmpl = \ \ \ +
\ +
\ + \ + \ +
Allows hosts belonging to other VDCs to be re-added to this one. They will appear marked with * in the list.
\ +
\ \ \ \ @@ -81,6 +87,19 @@ var vdc_actions = { call: openCreateVDCDialog }, + "VDC.update" : { + type: "create", + call: oZones.VDC.update, + callback: updateVDCElement, + error: onError, + notify: true + }, + + "VDC.update_dialog" : { + type: "custom", + call: openUpdateVDCDialog + }, + "VDC.list" : { type: "list", call: oZones.VDC.list, @@ -169,7 +188,8 @@ function vdcElementArray(vdc_json){ '', vdc.id, vdc.name, - vdc.zones_id + vdc.zones_id, + vdc.hosts ? vdc.hosts : "none" ]; } @@ -230,6 +250,18 @@ function updateVDCInfo(req,vdc_json){ Hosts\ '+(vdc.hosts? vdc.hosts : "none")+'\ \ + \ + Admin name\ + '+vdc.vdcadminname+'\ + \ + \ + Group ID\ + '+vdc.group_id+'\ + \ + \ + ACLs\ + '+vdc.acls+'\ + \ \ ' }; @@ -239,13 +271,41 @@ function updateVDCInfo(req,vdc_json){ } function fillHostList(req, host_list_json){ - list = ""; + var list = ""; + var force = $('div#create_vdc_dialog #vdc_force_hosts:checked').length ? + true : false; + var zone_id = req.request.data[0]; + var free; + $.each(host_list_json,function(){ - list+='
  • '+this.HOST.NAME+'
  • '; + free = isHostFree(this.HOST.ID,zone_id); + + if (force || free){ + list+='
  • '+(free? this.HOST.NAME : this.HOST.NAME+'*')+'
  • '; + } }); $('div#create_vdc_dialog #vdc_available_hosts_list').html(list); } +function isHostFree(id,zone_id){//strings + var data = dataTable_vdcs.fnGetData(); + var result = true; + var hosts; + for (var i=0; i= 0){ + result = false; + break; + } + } + return result; +} + function setupCreateVDCDialog(){ $('div#dialogs').append('
    '); var dialog = $('div#create_vdc_dialog'); @@ -266,6 +326,12 @@ function setupCreateVDCDialog(){ containment: dialog }); + $('input#vdc_force_hosts').change(function(){ + select = $('select#zoneid'); + if (select.val().length){ + select.trigger("change"); + } + }); //load zone hosts $('select#zoneid').change(function(){ @@ -289,6 +355,7 @@ function setupCreateVDCDialog(){ var vdcadminname = $('#vdcadminname',$(this)).val(); var vdcadminpass = $('#vdcadminpass',$(this)).val(); var zoneid = $('select#zoneid',$(this)).val(); + var force = $('#vdc_force_hosts',$(this)).length ? "yes" : "please no"; if (!name.length || !vdcadminname.length || !vdcadminpass.length || !zoneid.length){ notifyError("Name, administrator credentials or zones are missing"); @@ -308,6 +375,7 @@ function setupCreateVDCDialog(){ "zoneid" : zoneid, "vdcadminname" : vdcadminname, "vdcadminpass" : vdcadminpass, + "force" : force } }; if (hosts.length){ @@ -347,15 +415,17 @@ $(document).ready(function(){ "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, { "sWidth": "60px", "aTargets": [0] }, + { "sWidth": "150px", "aTargets": [4] }, { "sWidth": "35px", "aTargets": [1,3] } ] }); dataTable_vdcs.fnClearTable(); - addElement([spinner,'','',''],dataTable_vdcs); + addElement([spinner,'','','',''],dataTable_vdcs); Sunstone.runAction("VDC.list"); setupCreateVDCDialog(); + setupTips($('#create_vdc_dialog')); setVDCAutorefresh(); initCheckAllBoxes(dataTable_vdcs); tableCheckboxesListener(dataTable_vdcs); From 5bfa14ce2f1133b2ba9372874c55415cdbe15df4 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Sat, 24 Sep 2011 00:42:54 +0200 Subject: [PATCH 02/28] Feature #817: Added GUI support for add/remove hosts from VDC in oZones (cherry picked from commit 0820dd38a01929b9bf0f847ceb46d5e317617deb) (cherry picked from commit 532175b4e23334315e419d83d0752d328a7aa987) --- src/ozones/Server/public/js/ozones.js | 27 ++- .../Server/public/js/plugins/vdcs-tab.js | 216 +++++++++++++++++- 2 files changed, 237 insertions(+), 6 deletions(-) diff --git a/src/ozones/Server/public/js/ozones.js b/src/ozones/Server/public/js/ozones.js index 051df3fb0b..734cc4d6c6 100644 --- a/src/ozones/Server/public/js/ozones.js +++ b/src/ozones/Server/public/js/ozones.js @@ -201,6 +201,28 @@ var oZones = { }); }, + "update": function(params,resource){ + var callback = params.success; + var callback_error = params.error; + var id = params.data.id; + var data = params.data.extra_param; + var request = oZones.Helper.request(resource,"update", data); + + $.ajax({ + url: resource.toLowerCase()+'/'+id, + type: "PUT", + dataType: "json", + data: JSON.stringify(data), + success: function(response){ + return callback ? callback(request, response) : null; + }, + error: function(response){ + return callback_error ? + callback_error(request, oZones.Error(response)) : null; + } + }); + }, + "delete": function(params,resource){ var callback = params.success; var callback_error = params.error; @@ -385,7 +407,7 @@ var oZones = { callback(request, oZones.Helper.pool(subresource.toUpperCase(),response)) : null; }, error: function(response){ - return callback_error ? calback_error(request,oZones.Error(response)) : null; + return callback_error ? callback_error(request,oZones.Error(response)) : null; } }); @@ -421,6 +443,9 @@ var oZones = { "create": function(params){ oZones.Action.create(params,oZones.VDC.resource); }, + "update": function(params){ + oZones.Action.update(params,oZones.VDC.resource); + }, "delete": function(params){ oZones.Action.delete(params,oZones.VDC.resource); }, diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index 572d7db5e0..db7e6fc211 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -67,7 +67,36 @@ var create_vdc_tmpl = \ '; +var update_vdc_tmpl = +'
    \ +
    \ +
    \ + \ + \ +
    \ + \ + \ +
    Allows hosts belonging to other VDCs to be re-added to this one. They will appear marked with * in the list.
    \ +
    \ + \ + \ + \ +
    \ +
      \ +
        \ +
        \ +
        \ +
        \ +
        \ + \ + \ +
        \ +
        \ +
        '; + var dataTable_vdcs; +var $update_vdc_dialog; function vdcSelectedNodes() { return getSelectedNodes(dataTable_vdcs); @@ -88,7 +117,7 @@ var vdc_actions = { }, "VDC.update" : { - type: "create", + type: "single", call: oZones.VDC.update, callback: updateVDCElement, error: onError, @@ -142,6 +171,12 @@ var vdc_actions = { call: oZones.Zone.host, callback: fillHostList, error: onError + }, + "VDC.update_zone_hosts" : { + type: "single", + call: oZones.Zone.host, + callback: fillUpdateHostList, + error: onError } }; @@ -156,6 +191,10 @@ var vdc_buttons = { text: "+ New", alwaysActive:true }, + "VDC.update_dialog" : { + type: "action", + text: "Add/Remove hosts", + }, "VDC.delete" : { type: "action", text: "Delete", @@ -213,6 +252,12 @@ function addVDCElement(req,vdc_json){ addElement(element,dataTable_vdcs); } +function updateVDCElement(request, vdc_json){ + var id = vdc_json.VDC.id; + var element = vdcElementArray(vdc_json); + updateSingleElement(element,dataTable_vdcs,'#vdc_'+id); +} + function updateVDCsView(req,vdc_list){ var vdc_list_array = []; @@ -287,6 +332,52 @@ function fillHostList(req, host_list_json){ $('div#create_vdc_dialog #vdc_available_hosts_list').html(list); } +//return the array of hosts +function isHostMine(host_id,vdc_id){ + //locate myself + var vdcs = dataTable_vdcs.fnGetData(); + var my_hosts=null; + for (var i=0; i < vdcs.length; i++){ + if (vdcs[i][1]==vdc_id){ + my_hosts = vdcs[i][4].split(','); + break; + } + }; + if (!my_hosts) return false; + return $.inArray(host_id,my_hosts) >= 0; +} + +function fillUpdateHostList(req, host_list_json){ + var list = ""; + var list_mine = ""; + var vdc_id = $('#vdc_update_id',$update_vdc_dialog).val(); + var force = $('#vdc_update_force_hosts:checked',$update_vdc_dialog).length ? + true : false; + + var zone_id = req.request.data[0]; + var free,li; + + $.each(host_list_json,function(){ + //if mine, put in mine_list + if (isHostMine(this.HOST.ID,vdc_id)){ + list_mine+='
      • '+this.HOST.NAME+'
      • '; + return true; //continue + } + //otherwise, check if its free etc... + free = isHostFree(this.HOST.ID,zone_id); + + if (force || free){ + list+='
      • '+(free? this.HOST.NAME : this.HOST.NAME+'*')+'
      • '; + } + }); + + + + $('#vdc_update_available_hosts_list',$update_vdc_dialog).html(list); + $('#vdc_update_selected_hosts_list',$update_vdc_dialog).html(list_mine); + +} + function isHostFree(id,zone_id){//strings var data = dataTable_vdcs.fnGetData(); var result = true; @@ -326,8 +417,8 @@ function setupCreateVDCDialog(){ containment: dialog }); - $('input#vdc_force_hosts').change(function(){ - select = $('select#zoneid'); + $('input#vdc_force_hosts',dialog).change(function(){ + select = $('select#zoneid',$('#create_vdc_dialog')); if (select.val().length){ select.trigger("change"); } @@ -355,10 +446,10 @@ function setupCreateVDCDialog(){ var vdcadminname = $('#vdcadminname',$(this)).val(); var vdcadminpass = $('#vdcadminpass',$(this)).val(); var zoneid = $('select#zoneid',$(this)).val(); - var force = $('#vdc_force_hosts',$(this)).length ? "yes" : "please no"; + var force = $('#vdc_force_hosts:checked',$(this)).length ? "yes" : "please no"; if (!name.length || !vdcadminname.length || !vdcadminpass.length || !zoneid.length){ - notifyError("Name, administrator credentials or zones are missing"); + notifyError("Name, administrator credentials or zone are missing"); return false; } var hosts=""; @@ -396,6 +487,119 @@ function openCreateVDCDialog(){ dialog.dialog('open'); } +function setupUpdateVDCDialog(){ + $('div#dialogs').append('
        '); + $update_vdc_dialog=$('div#update_vdc_dialog',dialogs_context); + var dialog = $update_vdc_dialog; + dialog.html(update_vdc_tmpl); + dialog.dialog({ + autoOpen: false, + modal: true, + width: 500 + }); + + $('button',dialog).button(); + $('#vdc_update_available_hosts_list',dialog).sortable({ + connectWith : '#vdc_update_selected_hosts_list', + containment: dialog + }); + $('#vdc_update_selected_hosts_list',dialog).sortable({ + connectWith : '#vdc_update_available_hosts_list', + containment: dialog + }); + + $('#vdc_update_force_hosts',dialog).change(function(){ + select = $('select#vdc_update_id',$update_vdc_dialog); + if (select.val().length){ + select.trigger("change"); + } + }); + + $('select#vdc_update_id').change(function(){ + var id = $(this).val(); + var zone_id = $('option:selected',this).attr("zone_id"); + var av_hosts= + $('#vdc_update_available_hosts_list',$update_vdc_dialog); + var sel_hosts= + $('#vdc_update_selected_hosts_list',$update_vdc_dialog); + + if (!id || !id.length) { + av_hosts.empty(); + sel_hosts.empty(); + return true; + }; + //A VDC has been selected + //Fill in available hosts column + //move current hosts to current + av_hosts.html('
      • '+spinner+'
      • '); + sel_hosts.empty(); + Sunstone.runAction("VDC.update_zone_hosts",zone_id); + }); + + $('#update_vdc_form').submit(function(){ + var force = $('#vdc_update_force_hosts',this).length ? "yes" : "nein"; + var id = $('#vdc_update_id',this).val(); + + var hosts=""; + $('#vdc_update_selected_hosts_list li',this).each(function(){ + hosts+=$(this).attr("host_id")+','; + }); + if (hosts.length){ + hosts= hosts.slice(0,-1); + }; + + var vdc_json = { + "vdc" : { + "id": id, + "force": force, + "hosts": hosts + } + }; + + if (hosts.length){ + vdc_json["vdc"]["hosts"]=hosts; + }; + Sunstone.runAction("VDC.update",id,vdc_json); + dialog.dialog('close'); + return false; + }); + +} + +function openUpdateVDCDialog(){ + var selected_elems = getSelectedNodes(dataTable_vdcs); + //populate select + var dialog = $update_vdc_dialog; + var options = ""; + var vdcs = dataTable_vdcs.fnGetData(); + for (var i = 0; i < vdcs.length; i++){ + //if this VDC is among the selected + if ($.inArray(vdcs[i][1].toString(),selected_elems) >= 0){ + options += ''; + }; + }; + + $('#vdc_update_available_hosts_list',dialog).empty(); + $('#vdc_update_selected_hosts_list',dialog).empty(); + + $('select#vdc_update_id',dialog).html(options); + if (selected_elems.length == 1){ + $('select#vdc_update_id',dialog).html(options); + $('select#vdc_update_id option',dialog).attr("checked","checked"); + $('select#vdc_update_id').trigger("change"); + } else { + $('select#vdc_update_id',dialog).html(''+ + options); + }; + + dialog.dialog('open'); +} + function setVDCAutorefresh() { setInterval(function(){ var checked = $('input:checked',dataTable_zones.fnGetNodes()); @@ -426,6 +630,8 @@ $(document).ready(function(){ setupCreateVDCDialog(); setupTips($('#create_vdc_dialog')); + setupUpdateVDCDialog(); + setupTips($('#update_vdc_dialog')); setVDCAutorefresh(); initCheckAllBoxes(dataTable_vdcs); tableCheckboxesListener(dataTable_vdcs); From d40d29a46fdfda326752504a08a69e21d8416837 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Mon, 26 Sep 2011 18:21:45 +0200 Subject: [PATCH 03/28] Bring back lost change in VDC host uniqueness --- src/ozones/Server/models/OzonesServer.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/ozones/Server/models/OzonesServer.rb b/src/ozones/Server/models/OzonesServer.rb index d7623781ba..a11e8cc132 100644 --- a/src/ozones/Server/models/OzonesServer.rb +++ b/src/ozones/Server/models/OzonesServer.rb @@ -311,9 +311,8 @@ class OzonesServer "#{vdc.zones.id} not found, cannot update Vdc.") return [404, error.to_json] end - - if (!defined? vdc_data[:force] or - (defined? vdc_data[:force] and vdc_data[:force]!="yes")) and + + if (!vdc_data[:force] or vdc_data[:force].upcase!="YES") and !host_uniqueness?(zone, vdc_data[:hosts], vdc_id.to_i) return [403, OZones::Error.new( "Error: Couldn't update resource #{kind}. " + From 57685e1be83b8efe5cf6ff38322006b6fff5686c Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Tue, 27 Sep 2011 12:31:35 +0200 Subject: [PATCH 04/28] Remove debug data --- src/ozones/Server/models/OzonesServer.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/ozones/Server/models/OzonesServer.rb b/src/ozones/Server/models/OzonesServer.rb index a11e8cc132..0c38ff1a5a 100644 --- a/src/ozones/Server/models/OzonesServer.rb +++ b/src/ozones/Server/models/OzonesServer.rb @@ -278,8 +278,6 @@ class OzonesServer data = result if !OpenNebula.is_error?(result) end - puts data - resource = case kind when "vdc" then vdc_data=Hash.new From 5c788e6d467ab3943663b509c2039fdf147f4d09 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 20 Sep 2011 22:58:28 +0200 Subject: [PATCH 05/28] Change "ONE Auth" into "Oneadmin user" when creating zone (cherry picked from commit 4bf0da787fe0dcbca32c9a69a6c2ba401d9c1a48) --- src/ozones/Server/public/js/plugins/zones-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ozones/Server/public/js/plugins/zones-tab.js b/src/ozones/Server/public/js/plugins/zones-tab.js index ffdd2d0069..eb090916d3 100644 --- a/src/ozones/Server/public/js/plugins/zones-tab.js +++ b/src/ozones/Server/public/js/plugins/zones-tab.js @@ -41,7 +41,7 @@ var create_zone_tmpl =
        \ \
        \ - \ + \
        \ \ \ From 92443f762721194fafc5530bcd637a951ac0d8b4 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 20 Sep 2011 22:59:21 +0200 Subject: [PATCH 06/28] Log to stderr VNC proxy command when starting it (cherry picked from commit 8ff6baf1090c6a3696cf6d0cd2277e9e8538a15d) --- src/sunstone/models/SunstoneServer.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 02283816a4..03c73d4576 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -229,6 +229,8 @@ class SunstoneServer begin novnc_cmd = "#{config[:novnc_path]}/utils/wsproxy.py" + novnc_exec = "#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}" + $stderr.puts("Starting vnc proxy: #{novnc_exec}") pipe = IO.popen("#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}") rescue Exception => e error = Error.new(e.message) From 71160ee51c314717f150f6bcd47921ccd4efdc60 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 23 Sep 2011 20:21:24 +0200 Subject: [PATCH 07/28] Fix typo in oZones dashboard (cherry picked from commit a9535fa0f75da1c6d8b4d49abf6c02c662eb1b26) --- src/ozones/Server/public/js/plugins/dashboard-tab.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ozones/Server/public/js/plugins/dashboard-tab.js b/src/ozones/Server/public/js/plugins/dashboard-tab.js index a0b43908e1..1d9a663522 100644 --- a/src/ozones/Server/public/js/plugins/dashboard-tab.js +++ b/src/ozones/Server/public/js/plugins/dashboard-tab.js @@ -36,7 +36,7 @@ var dashboard_tab_content = \ \
        \ -

        Virtual Data Center\ +

        Virtual Data Centers\
        \ +\
        \ From 5b3350bfd6acb119ace3d27b4fbb17c5e43cfafb Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Fri, 23 Sep 2011 20:44:14 +0200 Subject: [PATCH 08/28] Ozones: Add Sunstone endpoint to zone creation dialog and info panel (cherry picked from commit a4154ebdff8c3c8f44c14b398355e6a952498899) --- src/ozones/Server/public/js/plugins/zones-tab.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ozones/Server/public/js/plugins/zones-tab.js b/src/ozones/Server/public/js/plugins/zones-tab.js index eb090916d3..80980d2945 100644 --- a/src/ozones/Server/public/js/plugins/zones-tab.js +++ b/src/ozones/Server/public/js/plugins/zones-tab.js @@ -45,6 +45,8 @@ var create_zone_tmpl =
        \ \ \ + \ +
        \

        \ \
        \ @@ -298,6 +300,10 @@ function updateZoneInfo(req,zone_json){ Endpoint\ '+zone.endpoint+'\ \ + \ + Sunstone endpoint\ + '+zone.sunsendpoint+'\ + \ \ #VDCs\ '+zone.vdcs.length+'\ @@ -544,6 +550,7 @@ function setupCreateZoneDialog(){ var endpoint = $('#endpoint',this).val(); var onename = $('#onename',this).val(); var onepass = $('#onepass',this).val(); + var sunsendpoint = $('#sunsendpoint',this).val(); if (!name.length || !endpoint.length || !onename.length || !onepass.length){ @@ -556,7 +563,8 @@ function setupCreateZoneDialog(){ "name": name, "endpoint": endpoint, "onename": onename, - "onepass": onepass + "onepass": onepass, + "sunsendpoint" : sunsendpoint } }; From 4a475ae7e534316213a02cbd2650a5b11340f392 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 26 Sep 2011 20:01:27 +0200 Subject: [PATCH 09/28] Small oZones fixes: Adjust zone name column with and hyperlink sunstone endpoint text. (cherry picked from commit 92fc3f539a55f927c369df2eb90777fc7b77b027) --- src/ozones/Server/public/js/plugins/zones-tab.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ozones/Server/public/js/plugins/zones-tab.js b/src/ozones/Server/public/js/plugins/zones-tab.js index 80980d2945..8f792209cd 100644 --- a/src/ozones/Server/public/js/plugins/zones-tab.js +++ b/src/ozones/Server/public/js/plugins/zones-tab.js @@ -302,7 +302,7 @@ function updateZoneInfo(req,zone_json){ \ \ Sunstone endpoint\ - '+zone.sunsendpoint+'\ + '+zone.sunsendpoint+'\ \ \ #VDCs\ @@ -597,7 +597,8 @@ $(document).ready(function(){ "sPaginationType": "full_numbers", "aoColumnDefs": [ { "bSortable": false, "aTargets": ["check"] }, - { "sWidth": "60px", "aTargets": [0,2] }, + { "sWidth": "60px", "aTargets": [0] }, + { "sWidth": "300px", "aTargets": [3] }, { "sWidth": "35px", "aTargets": [1] } ] }); From 5b3a0a6662bc888af6bfd71e1315ec7b2a8ef365 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Mon, 26 Sep 2011 20:05:32 +0200 Subject: [PATCH 10/28] Use the same string that was logged to launch the proxy (cherry picked from commit ab3da924718161be7b65007aeee32feadd8ecfec) --- src/sunstone/models/SunstoneServer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sunstone/models/SunstoneServer.rb b/src/sunstone/models/SunstoneServer.rb index 03c73d4576..297bd58425 100644 --- a/src/sunstone/models/SunstoneServer.rb +++ b/src/sunstone/models/SunstoneServer.rb @@ -231,7 +231,7 @@ class SunstoneServer novnc_cmd = "#{config[:novnc_path]}/utils/wsproxy.py" novnc_exec = "#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}" $stderr.puts("Starting vnc proxy: #{novnc_exec}") - pipe = IO.popen("#{novnc_cmd} #{proxy_port} #{host}:#{vnc_port}") + pipe = IO.popen(novnc_exec) rescue Exception => e error = Error.new(e.message) return [500, error.to_json] From 51fce30e2f819dfe251e215818ffe4c6a21eb608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 23 Sep 2011 16:56:55 +0200 Subject: [PATCH 11/28] onedb: add migrator from 2.9.85 to 2.9.90(cherry picked from commit d6621dc598585eeef67db167b3a0a52f5e5d1b9a) --- install.sh | 1 + src/onedb/2.9.85_to_2.9.90.rb | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 src/onedb/2.9.85_to_2.9.90.rb diff --git a/install.sh b/install.sh index 72fb72b1d7..ef9069846a 100755 --- a/install.sh +++ b/install.sh @@ -652,6 +652,7 @@ IMAGE_DRIVER_FS_SCRIPTS="src/image_mad/remotes/fs/cp \ #------------------------------------------------------------------------------- ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/2.9.80_to_2.9.85.rb \ + src/onedb/2.9.85_to_2.9.90.rb \ src/onedb/onedb.rb \ src/onedb/onedb_backend.rb" diff --git a/src/onedb/2.9.85_to_2.9.90.rb b/src/onedb/2.9.85_to_2.9.90.rb new file mode 100644 index 0000000000..53a7d084ae --- /dev/null +++ b/src/onedb/2.9.85_to_2.9.90.rb @@ -0,0 +1,31 @@ +# -------------------------------------------------------------------------- * +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# Licensed under the Apache License, Version 2.0 (the "License"); you may * +# not use this file except in compliance with the License. You may obtain * +# a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, software * +# distributed under the License is distributed on an "AS IS" BASIS, * +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +# See the License for the specific language governing permissions and * +# limitations under the License. * +# -------------------------------------------------------------------------- * + +require "rexml/document" +include REXML + +module Migrator + def db_version + "2.9.90" + end + + def one_version + "OpenNebula 2.9.90" + end + + def up + return true + end +end From a2ad103ad9375ac364b950fa13321952d5d78179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 26 Sep 2011 16:31:54 +0200 Subject: [PATCH 12/28] Bug #832: Restore src/cloud/common/Configuration.rb This reverts 7a530fb77c0334d36b4b2404fc09792e1444197b (cherry picked from commit 9fc7f582e238110e2153bc9083c4345e0cb0417b) --- install.sh | 3 +- src/cloud/common/Configuration.rb | 115 ++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 src/cloud/common/Configuration.rb diff --git a/install.sh b/install.sh index ef9069846a..d187f9b443 100755 --- a/install.sh +++ b/install.sh @@ -792,7 +792,8 @@ RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/OpenNebula/Host.rb \ COMMON_CLOUD_LIB_FILES="src/cloud/common/CloudServer.rb \ src/cloud/common/CloudClient.rb \ - src/cloud/common/CloudAuth.rb" + src/cloud/common/CloudAuth.rb \ + src/cloud/common/Configuration.rb" COMMON_CLOUD_CLIENT_LIB_FILES="src/cloud/common/CloudClient.rb" diff --git a/src/cloud/common/Configuration.rb b/src/cloud/common/Configuration.rb new file mode 100644 index 0000000000..2189e4ad1a --- /dev/null +++ b/src/cloud/common/Configuration.rb @@ -0,0 +1,115 @@ +# -------------------------------------------------------------------------- # +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +#--------------------------------------------------------------------------- # + +############################################################################### +# The Configuration Class represents a simple configuration file for the +# Cloud servers. It does not check syntax. +############################################################################### +class Configuration + + ########################################################################### + # Patterns to parse the Configuration File + ########################################################################### + + NAME_REG =/[\w\d_-]+/ + VARIABLE_REG =/\s*(#{NAME_REG})\s*=\s*/ + + SIMPLE_VARIABLE_REG =/#{VARIABLE_REG}([^\[]+?)(#.*)?/ + SINGLE_VARIABLE_REG =/^#{SIMPLE_VARIABLE_REG}$/ + ARRAY_VARIABLE_REG =/^#{VARIABLE_REG}\[(.*?)\]/m + + ########################################################################### + ########################################################################### + + def initialize(file) + @conf=parse_conf(file) + end + + def add_configuration_value(key,value) + add_value(@conf,key,value) + end + + def [](key) + @conf[key.to_s.upcase] + end + + ########################################################################### + ########################################################################### + +private + + # + # + # + def add_value(conf, key, value) + if conf[key] + if !conf[key].kind_of?(Array) + conf[key]=[conf[key]] + end + conf[key]< Date: Mon, 26 Sep 2011 17:00:08 +0200 Subject: [PATCH 13/28] onedb: Add 3.0 migrator. It changes the tm_nfs drivers to tm_shared(cherry picked from commit 980222f28eb335ef0c4d66613664f4a99d9148dc) --- install.sh | 1 + src/onedb/2.9.90_to_3.0.rb | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/onedb/2.9.90_to_3.0.rb diff --git a/install.sh b/install.sh index d187f9b443..e6cdb3ea0a 100755 --- a/install.sh +++ b/install.sh @@ -653,6 +653,7 @@ IMAGE_DRIVER_FS_SCRIPTS="src/image_mad/remotes/fs/cp \ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/2.9.80_to_2.9.85.rb \ src/onedb/2.9.85_to_2.9.90.rb \ + src/onedb/2.9.90_to_3.0.rb \ src/onedb/onedb.rb \ src/onedb/onedb_backend.rb" diff --git a/src/onedb/2.9.90_to_3.0.rb b/src/onedb/2.9.90_to_3.0.rb new file mode 100644 index 0000000000..8692af3bfe --- /dev/null +++ b/src/onedb/2.9.90_to_3.0.rb @@ -0,0 +1,48 @@ +# -------------------------------------------------------------------------- * +# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) # +# Licensed under the Apache License, Version 2.0 (the "License"); you may * +# not use this file except in compliance with the License. You may obtain * +# a copy of the License at * +# * +# http://www.apache.org/licenses/LICENSE-2.0 * +# * +# Unless required by applicable law or agreed to in writing, software * +# distributed under the License is distributed on an "AS IS" BASIS, * +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * +# See the License for the specific language governing permissions and * +# limitations under the License. * +# -------------------------------------------------------------------------- * + +require "rexml/document" +include REXML + +module Migrator + def db_version + "3.0" + end + + def one_version + "OpenNebula 3.0" + end + + def up + # The tm_nfs driver has been renamed to tm_shared + # CREATE TABLE host_pool (oid INTEGER PRIMARY KEY, name VARCHAR(256), body TEXT, state INTEGER, last_mon_time INTEGER, UNIQUE(name)); + + @db.fetch("SELECT * FROM host_pool") do |row| + doc = Document.new(row[:body]) + + source = nil + doc.root.each_element("TM_MAD") { |e| + if e.text.downcase == "tm_nfs" + e.text = "tm_shared" + + @db[:host_pool].filter(:oid => row[:oid]).update( + :body => doc.root.to_s) + end + } + end + + return true + end +end From 3a36b22644e4629ba617d19586abbacb123413e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 27 Sep 2011 11:41:55 +0200 Subject: [PATCH 14/28] Bug #832: Move Configuration.rb to onedb's lib location (cherry picked from commit fc6de1c4a02a3cf3dd7a1dbdbb1707dbbc141e73) --- install.sh | 6 +++--- src/{cloud/common => onedb}/Configuration.rb | 0 src/onedb/onedb.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) rename src/{cloud/common => onedb}/Configuration.rb (100%) diff --git a/install.sh b/install.sh index e6cdb3ea0a..23dc500a82 100755 --- a/install.sh +++ b/install.sh @@ -655,7 +655,8 @@ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \ src/onedb/2.9.85_to_2.9.90.rb \ src/onedb/2.9.90_to_3.0.rb \ src/onedb/onedb.rb \ - src/onedb/onedb_backend.rb" + src/onedb/onedb_backend.rb \ + src/onedb/Configuration.rb" #------------------------------------------------------------------------------- # Configuration files for OpenNebula, to be installed under $ETC_LOCATION @@ -793,8 +794,7 @@ RUBY_OPENNEBULA_LIB_FILES="src/oca/ruby/OpenNebula/Host.rb \ COMMON_CLOUD_LIB_FILES="src/cloud/common/CloudServer.rb \ src/cloud/common/CloudClient.rb \ - src/cloud/common/CloudAuth.rb \ - src/cloud/common/Configuration.rb" + src/cloud/common/CloudAuth.rb" COMMON_CLOUD_CLIENT_LIB_FILES="src/cloud/common/CloudClient.rb" diff --git a/src/cloud/common/Configuration.rb b/src/onedb/Configuration.rb similarity index 100% rename from src/cloud/common/Configuration.rb rename to src/onedb/Configuration.rb diff --git a/src/onedb/onedb.rb b/src/onedb/onedb.rb index 2d1210a55f..d528310b3b 100644 --- a/src/onedb/onedb.rb +++ b/src/onedb/onedb.rb @@ -14,7 +14,7 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'cloud/Configuration' +require 'Configuration' require 'onedb_backend' class OneDB From fcb98539ce99109c4af3527415abb680cdb3556b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 27 Sep 2011 12:32:08 +0200 Subject: [PATCH 15/28] Allow user passwords with ':' characters (cherry picked from commit 6c5e90eb844e70df23e5cb0f37782e8f4b272299) --- src/authm_mad/one_auth_mad.rb | 2 +- src/um/User.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authm_mad/one_auth_mad.rb b/src/authm_mad/one_auth_mad.rb index b1d40bcaf9..7f6a0b9f82 100755 --- a/src/authm_mad/one_auth_mad.rb +++ b/src/authm_mad/one_auth_mad.rb @@ -117,7 +117,7 @@ class AuthDriver < OpenNebulaDriver authN_path = File.join(@local_scripts_path, protocol) command = File.join(authN_path,ACTION[:authN].downcase) - command << ' ' << user << ' ' << password << ' ' << secret_attr.join(' ') + command << ' ' << user << ' ' << password << ' ' << secret_attr.join(':') local_action(command, request_id, ACTION[:authN]) end diff --git a/src/um/User.cc b/src/um/User.cc index 71b2d4cd28..c649eace68 100644 --- a/src/um/User.cc +++ b/src/um/User.cc @@ -27,7 +27,7 @@ #include "Group.h" -const string User::INVALID_CHARS = " :\t\n\v\f\r"; +const string User::INVALID_CHARS = " \t\n\v\f\r"; /* ************************************************************************** */ /* User :: Database Access Functions */ From 533539c93bf068af8f4750fe211b95be4a844bd6 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 28 Sep 2011 09:45:20 +0200 Subject: [PATCH 16/28] install_gems: Do not install xmlparser gem for ruby 1.9 --- share/install_gems/install_gems | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/install_gems/install_gems b/share/install_gems/install_gems index bbdf2c3a6e..f9dc603092 100755 --- a/share/install_gems/install_gems +++ b/share/install_gems/install_gems @@ -9,12 +9,16 @@ DEFAULT=%w{optional sunstone quota cloud ozones_server acct} if defined?(RUBY_VERSION) && RUBY_VERSION>="1.8.7" SQLITE='sqlite3' + + # xmlparser gem is not compatible with ruby 1.9 + OPTIONAL=%w{nokogiri} else SQLITE='sqlite3-ruby --version 1.2.0' + OPTIONAL=%w{nokogir xmlparser} end GROUPS={ - :optional => %w{nokogiri xmlparser}, + :optional => OPTIONAL, :quota => [SQLITE, 'sequel'], :sunstone => ['json', 'rack', 'sinatra', 'thin', 'sequel', SQLITE], :cloud => %w{amazon-ec2 rack sinatra thin uuid curb}, From 17509ee003be095fb4e5baa097145117b3ac7f58 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 28 Sep 2011 11:43:59 +0200 Subject: [PATCH 17/28] bug #670: let the user disable fs copy to context ISO (cherry picked from commit 291da9962c726e94dad9505606028fa09ca762d5) --- src/tm_mad/lvm/tm_context.sh | 9 ++++++++- src/tm_mad/shared/tm_context.sh | 10 ++++++++-- src/tm_mad/ssh/tm_context.sh | 10 ++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/tm_mad/lvm/tm_context.sh b/src/tm_mad/lvm/tm_context.sh index 6d6aea06ab..74061b6637 100755 --- a/src/tm_mad/lvm/tm_context.sh +++ b/src/tm_mad/lvm/tm_context.sh @@ -16,6 +16,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +CONTEXT_FILE=$1 + while (( "$#" )); do if [ "$#" == "1" ]; then DST=$1 @@ -56,7 +58,12 @@ for f in $SRC; do ;; *) - exec_and_log "cp -R $f $ISO_DIR" + if [ $SECURE_CONTEXT -eq 0 -o "$f" == "$CONTEXT_FILE" ]; then + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" + else + log "not copying potentialy dangerous file $f" + fi ;; esac done diff --git a/src/tm_mad/shared/tm_context.sh b/src/tm_mad/shared/tm_context.sh index db05f2dda0..fef2593fbe 100755 --- a/src/tm_mad/shared/tm_context.sh +++ b/src/tm_mad/shared/tm_context.sh @@ -16,6 +16,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +CONTEXT_FILE=$1 + while (( "$#" )); do if [ "$#" == "1" ]; then DST=$1 @@ -53,8 +55,12 @@ for f in $SRC; do ;; *) - exec_and_log "cp -R $f $ISO_DIR" \ - "Error copying $f to $ISO_DIR" + if [ $SECURE_CONTEXT -eq 0 -o "$f" == "$CONTEXT_FILE" ]; then + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" + else + log "not copying potentialy dangerous file $f" + fi ;; esac done diff --git a/src/tm_mad/ssh/tm_context.sh b/src/tm_mad/ssh/tm_context.sh index d5c16f6721..772b549e7f 100755 --- a/src/tm_mad/ssh/tm_context.sh +++ b/src/tm_mad/ssh/tm_context.sh @@ -16,6 +16,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +CONTEXT_FILE=$1 + while (( "$#" )); do if [ "$#" == "1" ]; then DST=$1 @@ -58,8 +60,12 @@ for f in $SRC; do ;; *) - exec_and_log "cp -R $f $ISO_DIR" \ - "Error copying $f to $ISO_DIR" + if [ $SECURE_CONTEXT -eq 0 -o "$f" == "$CONTEXT_FILE" ]; then + exec_and_log "cp -R $f $ISO_DIR" \ + "Error copying $f to $ISO_DIR" + else + log "not copying potentialy dangerous file $f" + fi ;; esac done From a10dd2f5dbc6fa9b6dc0e4c3ecc216a32aaa5578 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 28 Sep 2011 12:14:07 +0200 Subject: [PATCH 18/28] bug #670: Disable context security by default (cherry picked from commit 94b1707c423a38a8252505d70fdd71ea8c0222e9) --- src/tm_mad/lvm/tm_lvmrc | 3 +++ src/tm_mad/shared/tm_sharedrc | 4 ++++ src/tm_mad/ssh/tm_sshrc | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/src/tm_mad/lvm/tm_lvmrc b/src/tm_mad/lvm/tm_lvmrc index b3054c23e7..e01da3a0d5 100644 --- a/src/tm_mad/lvm/tm_lvmrc +++ b/src/tm_mad/lvm/tm_lvmrc @@ -22,6 +22,9 @@ VG_NAME= # Default size for logical volumes if not specified DEFAULT_LV_SIZE="1G" +# Set to 1 to disable adding files to context image other than context.sh +# itself or http url's +SECURE_CONTEXT=0 # -------------------------------------------------------------------------- # # Helper functions for the LVM plugin # diff --git a/src/tm_mad/shared/tm_sharedrc b/src/tm_mad/shared/tm_sharedrc index 52c0e6dab0..e1a1b9b0db 100644 --- a/src/tm_mad/shared/tm_sharedrc +++ b/src/tm_mad/shared/tm_sharedrc @@ -13,3 +13,7 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # + +# Set to 1 to disable adding files to context image other than context.sh +# itself or http url's +SECURE_CONTEXT=0 diff --git a/src/tm_mad/ssh/tm_sshrc b/src/tm_mad/ssh/tm_sshrc index 52c0e6dab0..e1a1b9b0db 100644 --- a/src/tm_mad/ssh/tm_sshrc +++ b/src/tm_mad/ssh/tm_sshrc @@ -13,3 +13,7 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # + +# Set to 1 to disable adding files to context image other than context.sh +# itself or http url's +SECURE_CONTEXT=0 From d07e4d42e93a92b769611dbb72a50b94c0eb6e9c Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Wed, 28 Sep 2011 12:19:05 +0200 Subject: [PATCH 19/28] Fix for wrong oZones reverse proxying for Sunstone --- src/ozones/Server/lib/OZones/ApacheWritter.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ozones/Server/lib/OZones/ApacheWritter.rb b/src/ozones/Server/lib/OZones/ApacheWritter.rb index 44119a6921..bd7c2c059f 100644 --- a/src/ozones/Server/lib/OZones/ApacheWritter.rb +++ b/src/ozones/Server/lib/OZones/ApacheWritter.rb @@ -29,8 +29,10 @@ module OZones htaccess << "RewriteRule ^#{vdc.name} " + "#{zone.endpoint} [P]\n" if zone.sunsendpoint != nil + htaccess << "RewriteRule ^sunstone_#{vdc.name}/(.+) " + + "#{zone.sunsendpoint}/$1 [P]\n" htaccess << "RewriteRule ^sunstone_#{vdc.name} " + - "#{zone.sunsendpoint} [P]\n" + "#{zone.sunsendpoint}/ [P]\n" end } } From 37618ecf45d2fdab166b4cd73a22e7adb7421323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 28 Sep 2011 12:40:40 +0200 Subject: [PATCH 20/28] Revert "Allow user passwords with ':' characters" This reverts commit fcb98539ce99109c4af3527415abb680cdb3556b. --- src/authm_mad/one_auth_mad.rb | 2 +- src/um/User.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/authm_mad/one_auth_mad.rb b/src/authm_mad/one_auth_mad.rb index 7f6a0b9f82..b1d40bcaf9 100755 --- a/src/authm_mad/one_auth_mad.rb +++ b/src/authm_mad/one_auth_mad.rb @@ -117,7 +117,7 @@ class AuthDriver < OpenNebulaDriver authN_path = File.join(@local_scripts_path, protocol) command = File.join(authN_path,ACTION[:authN].downcase) - command << ' ' << user << ' ' << password << ' ' << secret_attr.join(':') + command << ' ' << user << ' ' << password << ' ' << secret_attr.join(' ') local_action(command, request_id, ACTION[:authN]) end diff --git a/src/um/User.cc b/src/um/User.cc index c649eace68..71b2d4cd28 100644 --- a/src/um/User.cc +++ b/src/um/User.cc @@ -27,7 +27,7 @@ #include "Group.h" -const string User::INVALID_CHARS = " \t\n\v\f\r"; +const string User::INVALID_CHARS = " :\t\n\v\f\r"; /* ************************************************************************** */ /* User :: Database Access Functions */ From 69933ac673bb0b70fca2d7047b676eea1ee7a5e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 28 Sep 2011 12:34:05 +0200 Subject: [PATCH 21/28] Bug #839: Add support in scheduler for auth tokens with protocol (cherry picked from commit 2bb8ce1e88d0dc3a9a9eb9de2f9c3f81aec2b07b) --- src/scheduler/include/Client.h | 2 +- src/scheduler/src/client/Client.cc | 45 +++++++++++++++--------------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/src/scheduler/include/Client.h b/src/scheduler/include/Client.h index e82c10c9d8..276fd9cba2 100644 --- a/src/scheduler/include/Client.h +++ b/src/scheduler/include/Client.h @@ -96,7 +96,7 @@ private: int read_oneauth(string &secret); - int split_secret(const string secret, string& user, string& pass); + int split_secret(const string& secret); }; #endif /*ONECLIENT_H_*/ diff --git a/src/scheduler/src/client/Client.cc b/src/scheduler/src/client/Client.cc index b2bc97bc7a..5899ce9211 100644 --- a/src/scheduler/src/client/Client.cc +++ b/src/scheduler/src/client/Client.cc @@ -38,9 +38,6 @@ const int Client::MESSAGE_SIZE = 51200; void Client::set_one_auth(string secret) { - string user = ""; - string pass = ""; - int rc = 0; if( secret == "" ) @@ -50,18 +47,11 @@ void Client::set_one_auth(string secret) if ( rc == 0 ) { - rc = split_secret(secret, user, pass); + rc = split_secret(secret); - if( rc == 0 ) + if( rc != 0 ) { - string sha1_pass = SSLTools::sha1_digest(pass); - - one_auth = user + ":" + sha1_pass; - } - else - { - throw runtime_error("Wrong format for auth token, must " - "be :"); + throw runtime_error("Wrong format for auth token"); } } } @@ -132,23 +122,32 @@ int Client::read_oneauth(string &secret) return rc; } - -int Client::split_secret(const string secret, string& user, string& pass) +int Client::split_secret(const string& secret) { size_t pos; - int rc = -1; - pos=secret.find(":"); + pos = secret.find(":"); - if (pos != string::npos) + if ( pos == string::npos ) { - user = secret.substr(0,pos); - pass = secret.substr(pos+1); - - rc = 0; + return -1; } - return rc; + if ( secret.rfind(":") == pos ) + { + string user = secret.substr(0,pos); + string pass = secret.substr(pos+1); + + string sha1_pass = SSLTools::sha1_digest(pass); + + one_auth = user + ":" + sha1_pass; + } + else + { + one_auth = secret; + } + + return 0; } /* -------------------------------------------------------------------------- */ From 16f173fd44a17cdc2aba6721ee5f07f319e6badc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 28 Sep 2011 12:35:12 +0200 Subject: [PATCH 22/28] Bug #839: Add support in java oca for auth tokens with protocol (cherry picked from commit 9ee34a8b87938d440d110cfb58f3c094302093e9) --- .../src/org/opennebula/client/Client.java | 45 +++++++++++-------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/src/oca/java/src/org/opennebula/client/Client.java b/src/oca/java/src/org/opennebula/client/Client.java index 6c06e92cf4..4268373780 100644 --- a/src/oca/java/src/org/opennebula/client/Client.java +++ b/src/oca/java/src/org/opennebula/client/Client.java @@ -158,31 +158,38 @@ public class Client{ String[] token = oneSecret.split(":"); - if(token.length != 2 ) + if ( token.length > 2 ) + { + oneAuth = oneSecret; + } + else if ( token.lenght == 2 ) + { + MessageDigest md = MessageDigest.getInstance("SHA-1"); + byte[] digest = md.digest(token[1].getBytes()); + + String hash = ""; + + for(byte aux : digest) + { + int b = aux & 0xff; + + if (Integer.toHexString(b).length() == 1) + { + hash += "0"; + } + + hash += Integer.toHexString(b); + } + + oneAuth = token[0] + ":" + hash; + } + else { throw new ClientConfigurationException( "Wrong format for authorization string: " + oneSecret + "\nFormat expected is user:password"); } - MessageDigest md = MessageDigest.getInstance("SHA-1"); - byte[] digest = md.digest(token[1].getBytes()); - - String hash = ""; - - for(byte aux : digest) - { - int b = aux & 0xff; - - if (Integer.toHexString(b).length() == 1) - { - hash += "0"; - } - - hash += Integer.toHexString(b); - } - - oneAuth = token[0] + ":" + hash; } catch (FileNotFoundException e) { From 820a028c9b2824cb25fcc53677d8da3dcb5a5cf7 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Wed, 28 Sep 2011 13:08:12 +0200 Subject: [PATCH 23/28] Change host multiplacement legend to VDC host sharing (cherry picked from commit b195a553fc84a4f7dd26319180af13e25739ddeb) --- src/ozones/Server/public/js/plugins/vdcs-tab.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index db7e6fc211..aa35e31931 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -47,7 +47,7 @@ var create_vdc_tmpl =
        \
        \ - \ + \ \
        Allows hosts belonging to other VDCs to be re-added to this one. They will appear marked with * in the list.
        \
        \ @@ -75,7 +75,7 @@ var update_vdc_tmpl = \
        \ - \ + \ \
        Allows hosts belonging to other VDCs to be re-added to this one. They will appear marked with * in the list.
        \
        \ From ddc95acf54c7bc43801f1a9384c869d573716416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 28 Sep 2011 19:16:29 +0200 Subject: [PATCH 24/28] Bug #839: Fix typo in java OCA Client.java (cherry picked from commit 7b2414e07705a1b8417bd9aa4828a0f49424a5fd) --- src/oca/java/src/org/opennebula/client/Client.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oca/java/src/org/opennebula/client/Client.java b/src/oca/java/src/org/opennebula/client/Client.java index 4268373780..b5386efc19 100644 --- a/src/oca/java/src/org/opennebula/client/Client.java +++ b/src/oca/java/src/org/opennebula/client/Client.java @@ -162,7 +162,7 @@ public class Client{ { oneAuth = oneSecret; } - else if ( token.lenght == 2 ) + else if ( token.length == 2 ) { MessageDigest md = MessageDigest.getInstance("SHA-1"); byte[] digest = md.digest(token[1].getBytes()); From 5f8f679669d0e822e83595b842ab2cb124712d7e Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 28 Sep 2011 00:18:27 +0200 Subject: [PATCH 25/28] CLI one* man pages for 3.0.0 (cherry picked from commit 3a5763605b69fe90a8466e60c430be941760c7ab) --- share/man/oneacl.1 | 2 +- share/man/onegroup.1 | 2 +- share/man/onehost.1 | 2 +- share/man/oneimage.1 | 2 +- share/man/onetemplate.1 | 2 +- share/man/oneuser.1 | 2 +- share/man/onevdc.1 | 34 +++++++++++++++++++++++++++++++++- share/man/onevm.1 | 2 +- share/man/onevnet.1 | 2 +- share/man/onezone.1 | 2 +- 10 files changed, 42 insertions(+), 10 deletions(-) diff --git a/share/man/oneacl.1 b/share/man/oneacl.1 index 83ca8a8ec3..874513861c 100644 --- a/share/man/oneacl.1 +++ b/share/man/oneacl.1 @@ -128,7 +128,7 @@ Comma\-separated list of OpenNebula ACL names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onegroup.1 b/share/man/onegroup.1 index c7491abcfc..32bf32f9be 100644 --- a/share/man/onegroup.1 +++ b/share/man/onegroup.1 @@ -160,7 +160,7 @@ Comma\-separated list of OpenNebula GROUP names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onehost.1 b/share/man/onehost.1 index c5598b5d12..0082e1339f 100644 --- a/share/man/onehost.1 +++ b/share/man/onehost.1 @@ -234,7 +234,7 @@ Comma\-separated list of OpenNebula HOST names or ids .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneimage.1 b/share/man/oneimage.1 index d47d831509..b100089273 100644 --- a/share/man/oneimage.1 +++ b/share/man/oneimage.1 @@ -353,7 +353,7 @@ user IMAGE of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onetemplate.1 b/share/man/onetemplate.1 index a8f9cb2066..7a3f23139a 100644 --- a/share/man/onetemplate.1 +++ b/share/man/onetemplate.1 @@ -312,7 +312,7 @@ user VMTEMPLATE of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/oneuser.1 b/share/man/oneuser.1 index 8a327e1d63..8bed68c785 100644 --- a/share/man/oneuser.1 +++ b/share/man/oneuser.1 @@ -268,7 +268,7 @@ User password .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onevdc.1 b/share/man/onevdc.1 index 5ca56052f5..c6aa1c9e5a 100644 --- a/share/man/onevdc.1 +++ b/share/man/onevdc.1 @@ -13,6 +13,7 @@ . .nf + \-f, \-\-force Force the usage of Hosts in more than one VDC \-l, \-\-list x,y,z Selects columns to display with list command \-d, \-\-delay x Sets the delay in seconds for top command \-x, \-\-xml Show the resource in xml format @@ -34,6 +35,7 @@ create \fIfile\fR .nf Create a new VDC +valid options: force . .fi . @@ -82,6 +84,36 @@ Deletes a VDC . .IP "" 0 +. +.IP "\(bu" 4 +addhost \fIvdcid\fR \fIrange\fR +. +.IP "" 4 +. +.nf + +Adds the set of hosts to the VDC +valid options: force +. +.fi +. +.IP "" 0 + +. +.IP "\(bu" 4 +delhost \fIvdcid\fR \fIrange\fR +. +.IP "" 4 +. +.nf + +Deletes the set of hosts from the VDC +valid options: force +. +.fi +. +.IP "" 0 + . .IP "" 0 . @@ -146,7 +178,7 @@ VDC ID .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onevm.1 b/share/man/onevm.1 index 5b24c0f7ca..7ecebedb64 100644 --- a/share/man/onevm.1 +++ b/share/man/onevm.1 @@ -493,7 +493,7 @@ user VM of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onevnet.1 b/share/man/onevnet.1 index db089aae93..75844a4749 100644 --- a/share/man/onevnet.1 +++ b/share/man/onevnet.1 @@ -294,7 +294,7 @@ user VNET of the user identified by the username .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 diff --git a/share/man/onezone.1 b/share/man/onezone.1 index a25d516379..f6467d59fd 100644 --- a/share/man/onezone.1 +++ b/share/man/onezone.1 @@ -150,7 +150,7 @@ Zone ID .IP "" 0 . .SH "LICENSE" -OpenNebula 2\.9\.85 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) +OpenNebula 3\.0\.0 Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula\.org) . .P Licensed under the Apache License, Version 2\.0 (the "License"); you may not use this file except in compliance with the License\. You may obtain a copy of the License at http://www\.apache\.org/licenses/LICENSE\-2\.0 From c548c8478014cb860f59766eacbfffd8bc925f15 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Wed, 28 Sep 2011 00:27:00 +0200 Subject: [PATCH 26/28] Added man pages for econe/occi CLI 3.0.0 (cherry picked from commit 3df0c6dadc61f67c72c3ccc1539608cefcde5d79) --- share/man/econe-describe-images.1 | 39 +++++++++++++++ share/man/econe-describe-instances.1 | 39 +++++++++++++++ share/man/econe-register.1 | 43 +++++++++++++++++ share/man/econe-run-instances.1 | 51 ++++++++++++++++++++ share/man/econe-terminate-instances.1 | 38 +++++++++++++++ share/man/econe-upload.1 | 42 +++++++++++++++++ share/man/occi-compute.1 | 64 +++++++++++++++++++++++++ share/man/occi-network.1 | 68 +++++++++++++++++++++++++++ share/man/occi-storage.1 | 68 +++++++++++++++++++++++++++ 9 files changed, 452 insertions(+) diff --git a/share/man/econe-describe-images.1 b/share/man/econe-describe-images.1 index e69de29bb2..975ca7f8fd 100644 --- a/share/man/econe-describe-images.1 +++ b/share/man/econe-describe-images.1 @@ -0,0 +1,39 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula econe-describe-images +.SH SYNOPSIS +.B econe-describe-images +[\fIOPTIONS\fR] +.SH DESCRIPTION +econe\-describe\-images +.PP +List and describe previously uploaded images of a user to be +used with an OpenNebula Cloud. +.SH OPTIONS +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.HP +\fB\-\-access\-key\fR , \fB\-K\fR +.IP +The username of the user +.HP +\fB\-\-secret\-key\fR , \fB\-S\fR +.IP +The password of the user +.HP +\fB\-\-url\fR , \fB\-U\fR +.IP +Set url as the web service url to use +.HP +\fB\-\-headers\fR, \fB\-H\fR +.IP +Display column headers +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/econe-describe-instances.1 b/share/man/econe-describe-instances.1 index e69de29bb2..ec9e972991 100644 --- a/share/man/econe-describe-instances.1 +++ b/share/man/econe-describe-instances.1 @@ -0,0 +1,39 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula econe-describe-instances +.SH SYNOPSIS +.B econe-describe-instances +[\fIOPTIONS\fR] +.SH DESCRIPTION +econe\-describe\-instances +.PP +List and describe running instances +.SH OPTIONS + +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.HP +\fB\-\-access\-key\fR , \fB\-K\fR +.IP +The username of the user +.HP +\fB\-\-secret\-key\fR , \fB\-S\fR +.IP +The password of the user +.HP +\fB\-\-url\fR , \fB\-U\fR +.IP +Set url as the web service url to use +.HP +\fB\-\-headers\fR, \fB\-H\fR +.IP +Display column headers +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/econe-register.1 b/share/man/econe-register.1 index e69de29bb2..1db1a75d02 100644 --- a/share/man/econe-register.1 +++ b/share/man/econe-register.1 @@ -0,0 +1,43 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula econe-register +.SH SYNOPSIS +.B econe-register +[\fIOPTIONS\fR] \fIIMAGE-ID\fR +.SH DESCRIPTION +econe\-register +.PP +Register a previously uploaded image for use with an +OpenNebula Cloud. +.SH OPTIONS + +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.HP +\fB\-\-access\-key\fR , \fB\-K\fR +.IP +The username of the user +.HP +\fB\-\-secret\-key\fR , \fB\-S\fR +.IP +The password of the user +.HP +\fB\-\-url\fR , \fB\-U\fR +.IP +Set url as the web service url to use +.HP +\fB\-\-headers\fR, \fB\-H\fR +.IP +Display column headers +.PP +IMAGE\-ID: The image identification as returned by +the econe\-upload command +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/econe-run-instances.1 b/share/man/econe-run-instances.1 index e69de29bb2..92ab73a6d2 100644 --- a/share/man/econe-run-instances.1 +++ b/share/man/econe-run-instances.1 @@ -0,0 +1,51 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula econe-run-instances +.SH SYNOPSIS +.B econe-run-instances +[\fIOPTIONS\fR] \fIIMAGE-ID\fR +.SH DESCRIPTION +econe\-run\-instances +.PP +Runs an instance of a particular image +.SH OPTIONS + +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.HP +\fB\-\-access\-key\fR , \fB\-K\fR +.IP +The username of the user +.HP +\fB\-\-secret\-key\fR , \fB\-S\fR +.IP +The password of the user +.HP +\fB\-\-url\fR , \fB\-U\fR +.IP +Set url as the web service url to use +.HP +\fB\-\-type\fR , \fB\-t\fR +.IP +OpenNebula template in which is based this instance +.HP +\fB\-\-user\-data\fR, \fB\-d\fR +.IP +Specifies Base64\-encoded MIME user data to be made +available to the instance +.HP +\fB\-\-headers\fR, \fB\-H\fR +.IP +Display column headers +.PP +IMAGE\-ID: The image identification as returned by +the econe\-upload command +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/econe-terminate-instances.1 b/share/man/econe-terminate-instances.1 index e69de29bb2..f39fb6b867 100644 --- a/share/man/econe-terminate-instances.1 +++ b/share/man/econe-terminate-instances.1 @@ -0,0 +1,38 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula econe-terminate-instances +.SH SYNOPSIS +.B econe-register +[\fIOPTIONS\fR] \fIINSTANCE-ID\fR +.SH DESCRIPTION +econe\-terminate\-instances +.PP +Terminate the selected running instance +.SH OPTIONS + +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.HP +\fB\-\-access\-key\fR , \fB\-K\fR +.IP +The username of the user +.HP +\fB\-\-secret\-key\fR , \fB\-S\fR +.IP +The password of the user +.HP +\fB\-\-url\fR , \fB\-U\fR +.IP +Set url as the web service url to use +.PP +INSTANCE\-ID: The instance identification as returned by +the econe\-run\-instances command +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/econe-upload.1 b/share/man/econe-upload.1 index e69de29bb2..10239bc1d3 100644 --- a/share/man/econe-upload.1 +++ b/share/man/econe-upload.1 @@ -0,0 +1,42 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula econe-upload +.SH SYNOPSIS +.B econe-upload +[\fIOPTIONS\fR] \fIIMAGE-PATH\fR +.SH DESCRIPTION +econe\-upload +.PP +Uploads an image for use with an OpenNebula Cloud. This image should +be later register with econe\-register using the returned ImageId +.SH OPTIONS + +.HP +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.HP +\fB\-\-access\-key\fR , \fB\-K\fR +.IP +The username of the user +.HP +\fB\-\-secret\-key\fR , \fB\-S\fR +.IP +The password of the user +.HP +\fB\-\-url\fR , \fB\-U\fR +.IP +Set url as the web service url to use +.HP +\fB\-\-multipart\fR, \fB\-M\fR +.IP +Use 'multipart\-post' library instead of Curb/Curl +.PP +IMAGE\-PATH: Path to the image to upload +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/occi-compute.1 b/share/man/occi-compute.1 index e69de29bb2..7e2276bb51 100644 --- a/share/man/occi-compute.1 +++ b/share/man/occi-compute.1 @@ -0,0 +1,64 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula occi-compute +.SH SYNOPSIS +.B occi-compute +\fI \fR[\fIOPTIONS\fR] [\fIARGUMENTS\fR] +.SH DESCRIPTION +occi\-compute \- Manages compute resources +.SH OPTIONS + +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.PP +\fB\-\-username\fR , \fB\-U\fR +.IP +The username of the user +.PP +\fB\-\-password\fR , \fB\-P\fR +.IP +The password of the user +.PP +\fB\-\-url\fR , \fB\-R\fR +.IP +Set url as the web service url to use +.PP +\fB\-\-timeout\fR , \fB\-T\fR +.IP +Sets a timeout for the http connection +.PP +\fB\-\-debug\fR, \fB\-D\fR +.IP +Enables verbosity +.SH COMMANDS +.TP +\fBcreate\fR +.IP +creates a new compute resource described by the provided + +.TP +\fBlist\fR +.IP +lists available compute resources +.TP +\fBshow\fR +.IP +retrieves the OCCI XML representation of the compute resource +identified by +.TP +\fBupdate\fR +.IP +updates the representation of the compute resource represented by the +provided +.TP +\fBdelete\fR +.IP +deletes the compute resource idenfitied by +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/occi-network.1 b/share/man/occi-network.1 index e69de29bb2..21ae49696c 100644 --- a/share/man/occi-network.1 +++ b/share/man/occi-network.1 @@ -0,0 +1,68 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula occi-network +.SH SYNOPSIS +.B occi-network +\fI \fR[\fIOPTIONS\fR] [\fIARGUMENTS\fR] +.SH DESCRIPTION +occi\-network \- Manages virtual networks +.SH OPTIONS + +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.PP +\fB\-\-username\fR , \fB\-U\fR +.IP +The username of the user +.PP +\fB\-\-password\fR , \fB\-P\fR +.IP +The password of the user +.PP +\fB\-\-url\fR , \fB\-R\fR +.IP +Set url as the web service url to use +.PP +\fB\-\-timeout\fR , \fB\-T\fR +.IP +Sets a timeout for the http connection +.PP +\fB\-\-debug\fR, \fB\-D\fR +.IP +Enables verbosity +.PP +\fB\-\-multipart\fR, \fB\-M\fR +.IP +Use 'multipart\-post' library instead of Curb/Curl +.SH COMMANDS +.TP +\fBcreate\fR +.IP +creates a new virtual network described by the provided + +.TP +\fBlist\fR +.IP +lists available virtual networks +.TP +\fBshow\fR +.IP +retrieves the OCCI XML representation of the virtual network +identified by +.TP +\fBupdate\fR +.IP +updates the representation of the network resource represented by the +provided +.TP +\fBdelete\fR +.IP +deletes the virtual network idenfitied by +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 diff --git a/share/man/occi-storage.1 b/share/man/occi-storage.1 index e69de29bb2..e63697e535 100644 --- a/share/man/occi-storage.1 +++ b/share/man/occi-storage.1 @@ -0,0 +1,68 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.37.1. +.TH OPENNEBULA "1" "September 2011" "OpenNebula 3.0.0" "User Commands" +.SH NAME +OpenNebula \- OpenNebula occi-storage +.SH SYNOPSIS +.B occi-storage +\fI \fR[\fIOPTIONS\fR] [\fIPARAMETERS\fR] +.SH DESCRIPTION +occi\-storage \- Manages OCCI storage resource +.SH OPTIONS + +\fB\-\-help\fR, \fB\-h\fR +.IP +Show help +.PP +\fB\-\-username\fR , \fB\-U\fR +.IP +The username of the user +.PP +\fB\-\-password\fR , \fB\-P\fR +.IP +The password of the user +.PP +\fB\-\-url\fR , \fB\-R\fR +.IP +Set url as the web service url to use +.PP +\fB\-\-timeout\fR , \fB\-T\fR +.IP +Sets a timeout for the http connection +.PP +\fB\-\-debug\fR, \fB\-D\fR +.IP +Enables verbosity +.PP +\fB\-\-multipart\fR, \fB\-M\fR +.IP +Use 'multipart\-post' library instead of Curb/Curl +.SH COMMANDS +.TP +\fBcreate\fR +.IP +creates a new storage resource described by the provided + +.TP +\fBlist\fR +.IP +lists available storage resources +.TP +\fBshow\fR +.IP +retrieves the OCCI XML representation of the storage resource +identified by +.TP +\fBupdate\fR +.IP +updates the representation of the storage resource represented by the +provided +.TP +\fBdelete\fR +.IP +deletes the storage resource idenfitied by +.SH COPYRIGHT +Copyright 2002\-2011, OpenNebula Project Leads (OpenNebula.org) +.PP +Licensed under the Apache License, Version 2.0 (the "License"); you may +not use this file except in compliance with the License. You may obtain +a copy of the License at http://www.apache.org/licenses/LICENSE\-2.0 From 664f240060b03df99e25097b41df2b9b3e363c9d Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 29 Sep 2011 16:50:24 +0200 Subject: [PATCH 27/28] Changed README file to 3.0 (cherry picked from commit b11b7b5290ffe89bf3d7f477d34fea78aaa3114f) --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2480dac71f..7f0cc5b5f4 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ distributed data center infrastructures. Complete documentation can be found at - http://opennebula.org/documentation:rel2.4 + http://opennebula.org/documentation:rel3.0 ## INSTALLATION @@ -35,6 +35,14 @@ Additionally, to build OpenNebula from source you need: * **bison** >= 2.3 (optional, only needed to rebuild the parsers) * **libxml2-dev** +### RUBY LIBRARIES REQUIREMENTS + +A set of gem requirements are needed to make several components work. We +include a handy script to install them and the requirements. It is located at +`share/install_gems/install_gems` and you should use it to install the +required gems. You have more information at: + + http://opennebula.org/documentation:rel3.0:compile ### OPTIONAL PACKAGES @@ -104,6 +112,8 @@ where **install_options** can be one or more of: -d target installation directory. If defined, it will specified the path for the self-contained install. If not defined, the installation will be performed system wide + -c only install client utilities: OpenNebula cli, occi and ec2 + client files -r remove Opennebula, only useful if -d was not specified, otherwise rm -rf $ONE_LOCATION would do the job -h prints installer help @@ -111,7 +121,8 @@ where **install_options** can be one or more of: ## CONFIGURATION -Information on how to configure OpenNebula is located at http://opennebula.org/documentation:rel2.4 +Information on how to configure OpenNebula is located at +http://opennebula.org/documentation:rel3.0:cg ## CONTACT From 0ecdaf52580a15904c85b1c3aab4a1cbe246e714 Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Wed, 28 Sep 2011 17:38:43 +0200 Subject: [PATCH 28/28] oZones GUI: Replace * with grayed-out names for non unique hosts in VDC dialogs (cherry picked from commit 10eea8036aed7ab25d9b230e376046b060bfec1b) --- src/ozones/Server/public/js/plugins/vdcs-tab.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ozones/Server/public/js/plugins/vdcs-tab.js b/src/ozones/Server/public/js/plugins/vdcs-tab.js index aa35e31931..4564886c96 100644 --- a/src/ozones/Server/public/js/plugins/vdcs-tab.js +++ b/src/ozones/Server/public/js/plugins/vdcs-tab.js @@ -49,7 +49,7 @@ var create_vdc_tmpl =
        \ \ \ -
        Allows hosts belonging to other VDCs to be re-added to this one. They will appear marked with * in the list.
        \ +
        Allows hosts belonging to other VDCs to be re-added to this one. They will appear greyed-out in the lists.
        \
        \ \ \ @@ -77,7 +77,7 @@ var update_vdc_tmpl =
        \ \ \ -
        Allows hosts belonging to other VDCs to be re-added to this one. They will appear marked with * in the list.
        \ +
        Allows hosts belonging to other VDCs to be re-added to this one. They will appear greyed-out in the list.
        \
        \ \ \ @@ -326,7 +326,7 @@ function fillHostList(req, host_list_json){ free = isHostFree(this.HOST.ID,zone_id); if (force || free){ - list+='
      • '+(free? this.HOST.NAME : this.HOST.NAME+'*')+'
      • '; + list+='
      • '+(free? this.HOST.NAME : ''+this.HOST.NAME+'')+'
      • '; } }); $('div#create_vdc_dialog #vdc_available_hosts_list').html(list); @@ -367,7 +367,7 @@ function fillUpdateHostList(req, host_list_json){ free = isHostFree(this.HOST.ID,zone_id); if (force || free){ - list+='
      • '+(free? this.HOST.NAME : this.HOST.NAME+'*')+'
      • '; + list+='
      • '+(free? this.HOST.NAME : ''+this.HOST.NAME+'')+'
      • '; } }); @@ -404,7 +404,7 @@ function setupCreateVDCDialog(){ dialog.dialog({ autoOpen: false, modal: true, - width: 500 + width: 420 }); $('button',dialog).button(); @@ -495,7 +495,7 @@ function setupUpdateVDCDialog(){ dialog.dialog({ autoOpen: false, modal: true, - width: 500 + width: 420 }); $('button',dialog).button();