From 1a8b2ef6a487e7542a03a03eb29987d46b27b921 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Wed, 7 Dec 2011 19:01:41 +0100 Subject: [PATCH 01/25] feature #863: fix tests --- src/vnm_mad/remotes/test/OpenNebulaNetwork_spec.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/vnm_mad/remotes/test/OpenNebulaNetwork_spec.rb b/src/vnm_mad/remotes/test/OpenNebulaNetwork_spec.rb index cfbfe8cf89..f451b53c3e 100644 --- a/src/vnm_mad/remotes/test/OpenNebulaNetwork_spec.rb +++ b/src/vnm_mad/remotes/test/OpenNebulaNetwork_spec.rb @@ -43,7 +43,7 @@ describe 'networking' do $capture_commands = { /virsh.*dumpxml/ => OUTPUT[:virsh_dumpxml] } - onevlan = OpenNebulaNetwork.new(OUTPUT[:onevm_show],"TEMPLATE/NIC","kvm") + onevlan = OpenNebulaNetwork.new(OUTPUT[:onevm_show],"TEMPLATE/NIC",nil,"kvm") nics_expected = [{:bridge=>"br0", :ip=>"172.16.0.100", :mac=>"02:00:ac:10:00:64", @@ -76,7 +76,7 @@ describe 'ebtables' do /virsh.*dumpxml/ => OUTPUT[:virsh_dumpxml], /ebtables/ => nil } - onevlan = EbtablesVLAN.new(OUTPUT[:onevm_show],"kvm") + onevlan = EbtablesVLAN.new(OUTPUT[:onevm_show],nil,"kvm") onevlan.activate ebtables_cmds = [ "sudo /sbin/ebtables -A FORWARD -s ! 02:00:ac:10:00:00/ff:ff:ff:ff:ff:00 -o vnet0 -j DROP", @@ -98,7 +98,7 @@ describe 'openvswitch' do /virsh.*dumpxml/ => OUTPUT[:virsh_dumpxml], /ovs-vsctl/ => nil } - onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show],"kvm") + onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show],nil,"kvm") onevlan.activate openvswitch_tags = [ "sudo /usr/local/bin/ovs-vsctl set Port vnet0 tag=2", @@ -117,7 +117,7 @@ describe 'openvswitch' do /brctl show/ => OUTPUT[:brctl_show], /ovs-vsctl/ => nil } - onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show_vlan_id_kvm],"kvm") + onevlan = OpenvSwitchVLAN.new(OUTPUT[:onevm_show_vlan_id_kvm],nil,"kvm") onevlan.activate onevlan_rules = ["sudo /usr/local/bin/ovs-vsctl set Port vnet0 tag=6", @@ -166,7 +166,7 @@ describe 'host-managed' do /ip link set/ => nil, /ip link show/ => [nil,255] } - hm = OpenNebulaHM.new(OUTPUT[:onevm_show_phydev_kvm],"kvm") + hm = OpenNebulaHM.new(OUTPUT[:onevm_show_phydev_kvm],nil,"kvm") hm.activate hm_activate_rules = ["sudo /sbin/brctl addbr onebr6", @@ -189,7 +189,7 @@ describe 'host-managed' do /ip link set/ => nil, /ip link show/ => [nil,255] } - hm = OpenNebulaHM.new(OUTPUT[:onevm_show_vlan_id_kvm],"kvm") + hm = OpenNebulaHM.new(OUTPUT[:onevm_show_vlan_id_kvm],nil,"kvm") hm.activate hm_vlan_id = ["sudo /sbin/brctl addbr onebr10", @@ -222,7 +222,7 @@ describe 'host-managed' do - hm = OpenNebulaHM.new(OUTPUT[:onevm_show_mixed],"kvm") + hm = OpenNebulaHM.new(OUTPUT[:onevm_show_mixed],nil,"kvm") hm.activate hm_vlan_tag = [ "sudo /sbin/brctl show", From 966db944785aa6e899d352d947e04f5cdcc1d839 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Wed, 7 Dec 2011 19:03:41 +0100 Subject: [PATCH 02/25] Do not show FSTYPE in OCCI if type OS --- src/cloud/occi/lib/ImageOCCI.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud/occi/lib/ImageOCCI.rb b/src/cloud/occi/lib/ImageOCCI.rb index cd573554c3..50a12133f5 100755 --- a/src/cloud/occi/lib/ImageOCCI.rb +++ b/src/cloud/occi/lib/ImageOCCI.rb @@ -30,7 +30,7 @@ class ImageOCCI < Image <%= self['TEMPLATE/DESCRIPTION'] %> <% end %> <%= self['SIZE'] %> - <% if self['FSTYPE'] != nil %> + <% if self['FSTYPE'] != nil and !self['FSTYPE'].empty? %> <%= self['FSTYPE'] %> <% end %> <%= self['PUBLIC'] == "0" ? "NO" : "YES"%> From 6d0b58da21363b1c091a74ccc1a268f37a48342b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 7 Dec 2011 19:18:38 +0100 Subject: [PATCH 03/25] onedb migrator to 3.1.80: Improvements, better handling of new VLAN attribute for VNETs --- src/onedb/3.1.0_to_3.1.80.rb | 110 +++++++++++++++++++++++++++++++---- 1 file changed, 99 insertions(+), 11 deletions(-) diff --git a/src/onedb/3.1.0_to_3.1.80.rb b/src/onedb/3.1.0_to_3.1.80.rb index 5a27679015..5644157197 100644 --- a/src/onedb/3.1.0_to_3.1.80.rb +++ b/src/onedb/3.1.0_to_3.1.80.rb @@ -28,13 +28,42 @@ module Migrator end def up - puts " > Networking isolation hooks have been moved to Host drivers.\n"<< - " If you were using a networking hook, enter its name, or press enter\n"<< - " to use the default dummy vn_mad driver.\n\n" - print " Driver name (802.1Q, dummy, ebtables, ovswitch): " - vn_mad = gets.chomp + puts " > Networking isolation hooks have been moved to Host drivers.\n"<< + " If you were using a networking hook, enter its name, or press enter\n"<< + " to use the default dummy vn_mad driver.\n\n" - vn_mad = "dummy" if vn_mad.empty? + vn_mad = "" + + while !( ["802.1Q", "dummy", "ebtables", "ovswitch"].include?(vn_mad) ) do + print " Driver name (802.1Q, dummy, ebtables, ovswitch): " + vn_mad = gets.chomp + vn_mad = "dummy" if vn_mad.empty? + end + + # 0 = all, 1 = none, 2 = interactive + vlan_option = 1 + + if ( vn_mad == "ebtables" || vn_mad == "ovswitch" ) + puts + puts " > A new attribute, VLAN = YES/NO will be added to each VNET.\n"<< + " For driver '#{vn_mad}', please choose if you want to isolate all networks (all),\n"<< + " none (none), or be asked individually for each VNET (interactive)\n" + + vlan = "" + while !( ["all", "none", "interactive"].include?(vlan) ) do + print " Isolate VNETs (all, none, interactive): " + vlan = gets.chomp + end + + case vlan + when "all" + vlan_option = 0 + when "none" + vlan_option = 1 + when "interactive" + vlan_option = 2 + end + end # New VN_MAD element for hosts @@ -80,7 +109,19 @@ module Migrator net_address = e.text } - net_address = IPAddr.new(net_address, Socket::AF_INET) + net_valid = false + while !net_valid do + begin + net_address = IPAddr.new(net_address, Socket::AF_INET) + net_valid = true + rescue ArgumentError + puts + puts " > Error processing VNET ##{row[:oid]} '#{row[:name]}'\n"<< + " This network address is invalid: '#{net_address}'\n" + print " Please enter a valid network address: " + net_address = gets.chomp + end + end st_size = "" @@ -98,18 +139,44 @@ module Migrator size = st_size.to_i host_bits = (Math.log(size+2)/Math.log(2)).ceil end - + net_mask = 0xFFFFFFFF << host_bits net_address = net_address.to_i & net_mask - ip_start_elem.text = IPAddr.new((ip_start = net_address + 1), Socket::AF_INET).to_s + ip_start_elem.text = IPAddr.new((net_address + 1), Socket::AF_INET).to_s ip_end_elem.text = IPAddr.new((net_address + (1 << host_bits) - 2), Socket::AF_INET).to_s end - # TODO: Set vlan = 1 if PHYDEV is set + phydev_present = false + doc.root.each_element("PHYDEV") { |e| + phydev_present = true + } + vlan_elem = doc.root.add_element("VLAN") - vlan_elem.text = "0" + + if phydev_present + vlan_elem.text = "1" + else + case vlan_option + when 0 + vlan_elem.text = "1" + when 1 + vlan_elem.text = "0" + when 2 + vlan = "" + while !( ["y", "n"].include?(vlan) ) do + print " > Isolate VNET ##{row[:oid]} '#{row[:name]}'? (y/n) : " + vlan = gets.chomp + end + + if ( vlan == "y" ) + vlan_elem.text = "1" + else + vlan_elem.text = "0" + end + end + end @db[:network_pool].insert( :oid => row[:oid], @@ -122,6 +189,27 @@ module Migrator @db.run "DROP TABLE old_network_pool;" + # Add empty HISTORY_RECORDS element to VMs without any records + @db.run "ALTER TABLE vm_pool RENAME TO old_vm_pool;" + @db.run "CREATE TABLE vm_pool (oid INTEGER PRIMARY KEY, name VARCHAR(128), body TEXT, uid INTEGER, gid INTEGER, last_poll INTEGER, state INTEGER, lcm_state INTEGER);" + @db.run "INSERT INTO vm_pool SELECT * FROM old_vm_pool;" + + @db.fetch("SELECT * FROM old_vm_pool") do |row| + doc = Document.new(row[:body]) + + found = false + doc.root.each_element("HISTORY_RECORDS") { |e| + found = true + } + + if !found + doc.root.add_element("HISTORY_RECORDS") + end + end + + @db.run "DROP TABLE old_vm_pool;" + + return true end end From 10e52c413c7c94533669c48fc93d1b9a9eef8696 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 8 Dec 2011 00:08:18 +0100 Subject: [PATCH 04/25] Add network.erb for OCCI --- src/cloud/occi/etc/templates/network.erb | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/cloud/occi/etc/templates/network.erb diff --git a/src/cloud/occi/etc/templates/network.erb b/src/cloud/occi/etc/templates/network.erb new file mode 100644 index 0000000000..6dfb23079a --- /dev/null +++ b/src/cloud/occi/etc/templates/network.erb @@ -0,0 +1,25 @@ +# +# This template is processed by the OCCI Server to include specific data for +# the VNET, you should not need to modify the ruby code. +# You can add common attributes for your VNET templates (e.g. VLAN, PHYDEV) +# + +NAME = "<%= @vnet_info['NAME'] %>" +TYPE = RANGED + +NETWORK_ADDRESS = <%= @vnet_info['ADDRESS'] %> +<% if @vnet_info['SIZE'] != nil %> +NETWORK_SIZE = <%= @vnet_info['SIZE']%> +<% end %> + +<% if @vnet_info['DESCRIPTION'] != nil %> +DESCRIPTION = "<%= @vnet_info['DESCRIPTION'] %>" +<% end %> + +<% if @vnet_info['PUBLIC'] != nil %> +PUBLIC = "<%= @vnet_info['PUBLIC'] %>" +<% end %> + +#BRIDGE = NAME_OF_DEFAULT_BRIDGE +#PHYDEV = NAME_OF_PHYSICAL_DEVICE +#VLAN = YES|NO From dca599c5dc54bcbb51e1852543f496f063eef8e8 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 8 Dec 2011 00:29:05 +0100 Subject: [PATCH 05/25] feature #863: Make use of action_info to pass extra parameters to net drivers --- src/vmm_mad/exec/one_vmm_exec.rb | 14 +++++--------- src/vnm_mad/one_vnm.rb | 10 ++++++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index ffd1bd6069..960d877065 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -72,16 +72,14 @@ class VmmAction @vnm_src = VirtualNetworkDriver.new(@data[:net_drv], :local_actions => @vmm.options[:local_actions], :message => @xml_data, - :ssh_stream => @ssh_src, - :extra_data => @data) + :ssh_stream => @ssh_src) if @data[:dest_host] and !@data[:dest_host].empty? @ssh_dst = @vmm.get_ssh_stream(@data[:dest_host], @id) @vnm_dst = VirtualNetworkDriver.new(@data[:dest_driver], :local_actions => @vmm.options[:local_actions], :message => @xml_data, - :ssh_stream => @ssh_dst, - :extra_data => @data) + :ssh_stream => @ssh_dst) end end @@ -149,7 +147,8 @@ class VmmAction vnm = @vnm_src end - result, info = vnm.do_action(@id, step[:action]) + result, info = vnm.do_action(@id, step[:action], + :parameters => get_parameters(step[:parameters])) else result = DriverExecHelper.const_get(:RESULT)[:failure] info = "No driver in #{step[:action]}" @@ -157,7 +156,6 @@ class VmmAction # Save the step info @data["#{step[:action]}_info".to_sym] = info - @data[step[:save_info_as]] = info if step[:save_info_as] # Roll back steps, store failed info and break steps if DriverExecHelper.failed?(result) @@ -280,12 +278,12 @@ class ExecDriver < VirtualMachineDriver :action => :deploy, :parameters => [dfile, :host], :stdin => domain, - :save_info_as => :deploy_id }, # Execute post-boot networking setup { :driver => :vnm, :action => :post, + :parameters => [:deploy_info] :fail_actions => [ { :driver => :vmm, @@ -496,5 +494,3 @@ exec_driver = ExecDriver.new(hypervisor, :local_actions => local_actions) exec_driver.start_driver - - diff --git a/src/vnm_mad/one_vnm.rb b/src/vnm_mad/one_vnm.rb index 23dba5a34e..30c886e97a 100644 --- a/src/vnm_mad/one_vnm.rb +++ b/src/vnm_mad/one_vnm.rb @@ -31,7 +31,6 @@ class VirtualNetworkDriver @options = options @ssh_stream = options[:ssh_stream] @message = options[:message] - @extra_data = options[:extra_data] @vm_encoded = Base64.encode64(@message.elements['VM'].to_s).delete("\n") @@ -45,14 +44,17 @@ class VirtualNetworkDriver # @param [String, Symbol] aname name of the action # @param [Hash] ops extra options for the command # @option ops [String] :stdin text to be writen to stdin + # @option ops [String] :parameters additional parameters for vnm action def do_action(id, aname, ops = {}) options={ - :stdin => nil, + :stdin => nil, + :parameters => nil }.merge(ops) - deploy_id=@extra_data[:deploy_id] || '-' + cmd_params = "#{@vm_encoded}" + cmd_params << " #{options[:parameters]}" if options[:parameters] - cmd = action_command_line(aname, "#{@vm_encoded} #{deploy_id}") + cmd = action_command_line(aname, cmd_params) if action_is_local?(aname) execution = LocalCommand.run(cmd, log_method(id)) From 9bbbd291f6fb945d40c1f4f90f8e21659ade5aae Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 8 Dec 2011 03:39:52 +0100 Subject: [PATCH 06/25] Add network.erb to install.sh --- install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/install.sh b/install.sh index 1e75815fd8..3d4e4e933d 100755 --- a/install.sh +++ b/install.sh @@ -959,6 +959,7 @@ OCCI_ETC_TEMPLATE_FILES="src/cloud/occi/etc/templates/common.erb \ src/cloud/occi/etc/templates/custom.erb \ src/cloud/occi/etc/templates/small.erb \ src/cloud/occi/etc/templates/medium.erb \ + src/cloud/occi/etc/templates/network.erb \ src/cloud/occi/etc/templates/large.erb" #----------------------------------------------------------------------------- From 1da7f8be130b041d5c771c24173301ae43298c26 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 8 Dec 2011 22:49:05 +0100 Subject: [PATCH 07/25] add net-ldap to install_gems, needed by ldap auth --- share/install_gems/install_gems | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/share/install_gems/install_gems b/share/install_gems/install_gems index e2c37f9ccf..3b85b5069c 100755 --- a/share/install_gems/install_gems +++ b/share/install_gems/install_gems @@ -2,7 +2,7 @@ require 'pp' -DEFAULT=%w{optional sunstone quota cloud ozones_server acct} +DEFAULT=%w{optional sunstone quota cloud ozones_server acct auth_ldap} if defined?(RUBY_VERSION) && RUBY_VERSION>="1.8.7" SQLITE='sqlite3' @@ -31,7 +31,8 @@ GROUPS={ :ozones_server_mysql => %w{json data_mapper dm-mysql-adapter mysql}, :acct => ['sequel', SQLITE, 'mysql'], :acct_sqlite => ['sequel', SQLITE], - :acct_mysql => ['sequel', 'mysql'] + :acct_mysql => ['sequel', 'mysql'], + :auth_ldap => 'net-ldap' } PACKAGES=GROUPS.keys From 67a594474e574519faa5946acd6893417bee7984 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 9 Dec 2011 16:51:56 +0100 Subject: [PATCH 08/25] feature #863: fixes bug --- src/vmm_mad/exec/one_vmm_exec.rb | 2 +- src/vnm_mad/remotes/test/output/onevm_show_xen | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 960d877065..324542ac89 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -283,7 +283,7 @@ class ExecDriver < VirtualMachineDriver { :driver => :vnm, :action => :post, - :parameters => [:deploy_info] + :parameters => [:deploy_info], :fail_actions => [ { :driver => :vmm, diff --git a/src/vnm_mad/remotes/test/output/onevm_show_xen b/src/vnm_mad/remotes/test/output/onevm_show_xen index 9f0685ad44..4952762493 100644 --- a/src/vnm_mad/remotes/test/output/onevm_show_xen +++ b/src/vnm_mad/remotes/test/output/onevm_show_xen @@ -34,7 +34,7 @@ - + From bcd9281b638c7f1a5c813d9b64d66c1a6ca7432b Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Sat, 10 Dec 2011 21:08:03 +0100 Subject: [PATCH 09/25] bug: solve reference by name in CONTEXT attribute for name and virtual network --- src/vm/vm_var_syntax.cc | 42 +++++++++++++++++++---------------------- src/vm/vm_var_syntax.h | 2 +- src/vm/vm_var_syntax.y | 20 ++++++++------------ 3 files changed, 28 insertions(+), 36 deletions(-) diff --git a/src/vm/vm_var_syntax.cc b/src/vm/vm_var_syntax.cc index 6a75d06320..a8b665169b 100644 --- a/src/vm/vm_var_syntax.cc +++ b/src/vm/vm_var_syntax.cc @@ -146,7 +146,6 @@ void get_image_attribute(VirtualMachine * vm, ImagePool * ipool = nd.get_ipool(); Image * img; int iid = -1; - string iid_str; int num; vector attrs; @@ -154,7 +153,7 @@ void get_image_attribute(VirtualMachine * vm, attr_value.clear(); - if (img_name.empty() || img_name != "IMAGE_ID") + if ( img_name.empty() || (img_name!="IMAGE" && img_name!="IMAGE_ID") ) { return; } @@ -174,11 +173,10 @@ void get_image_attribute(VirtualMachine * vm, continue; } - iid_str = disk->vector_value("IMAGE_ID"); - - if ( iid_str == img_value ) + if ( disk->vector_value(img_name.c_str()) == img_value ) { - istringstream iss(img_value); + string iid_str = disk->vector_value("IMAGE_ID"); + istringstream iss(iid_str); iss >> iid; @@ -232,7 +230,6 @@ void get_network_attribute(VirtualMachine * vm, VirtualNetworkPool * vnpool = nd.get_vnpool(); VirtualNetwork * vn; int vnet_id = -1; - string vnet_id_str; int num; vector attrs; @@ -240,7 +237,7 @@ void get_network_attribute(VirtualMachine * vm, attr_value.clear(); - if (net_name.empty() || net_name != "NETWORK_ID") + if ( net_name.empty() || (net_name!="NETWORK" && net_name!="NETWORK_ID") ) { return; } @@ -260,11 +257,10 @@ void get_network_attribute(VirtualMachine * vm, continue; } - vnet_id_str = net->vector_value("NETWORK_ID"); - - if ( vnet_id_str == net_value ) + if ( net->vector_value(net_name.c_str()) == net_value ) { - istringstream iss(net_value); + string vnet_id_str = net->vector_value("NETWORK_ID"); + istringstream iss(vnet_id_str); iss >> vnet_id; @@ -460,7 +456,7 @@ void insert_vector(VirtualMachine * vm, /* Line 268 of yacc.c */ -#line 464 "vm_var_syntax.cc" +#line 460 "vm_var_syntax.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -506,7 +502,7 @@ typedef union YYSTYPE { /* Line 293 of yacc.c */ -#line 408 "vm_var_syntax.y" +#line 404 "vm_var_syntax.y" char * val_str; int val_int; @@ -515,7 +511,7 @@ typedef union YYSTYPE /* Line 293 of yacc.c */ -#line 519 "vm_var_syntax.cc" +#line 515 "vm_var_syntax.cc" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -540,7 +536,7 @@ typedef struct YYLTYPE /* Line 343 of yacc.c */ -#line 544 "vm_var_syntax.cc" +#line 540 "vm_var_syntax.cc" #ifdef short # undef short @@ -830,7 +826,7 @@ static const yytype_int8 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 432, 432, 433, 436, 440, 453, 468 + 0, 428, 428, 429, 432, 436, 449, 464 }; #endif @@ -1831,7 +1827,7 @@ yyreduce: case 4: /* Line 1806 of yacc.c */ -#line 437 "vm_var_syntax.y" +#line 433 "vm_var_syntax.y" { (*parsed) << (yyvsp[(1) - (1)].val_str); } @@ -1840,7 +1836,7 @@ yyreduce: case 5: /* Line 1806 of yacc.c */ -#line 441 "vm_var_syntax.y" +#line 437 "vm_var_syntax.y" { string name((yyvsp[(1) - (2)].val_str)); @@ -1858,7 +1854,7 @@ yyreduce: case 6: /* Line 1806 of yacc.c */ -#line 454 "vm_var_syntax.y" +#line 450 "vm_var_syntax.y" { string name((yyvsp[(1) - (5)].val_str)); string vname((yyvsp[(3) - (5)].val_str)); @@ -1878,7 +1874,7 @@ yyreduce: case 7: /* Line 1806 of yacc.c */ -#line 469 "vm_var_syntax.y" +#line 465 "vm_var_syntax.y" { string name((yyvsp[(1) - (9)].val_str)); string vname((yyvsp[(3) - (9)].val_str)); @@ -1901,7 +1897,7 @@ yyreduce: /* Line 1806 of yacc.c */ -#line 1905 "vm_var_syntax.cc" +#line 1901 "vm_var_syntax.cc" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -2139,7 +2135,7 @@ yyreturn: /* Line 2067 of yacc.c */ -#line 487 "vm_var_syntax.y" +#line 483 "vm_var_syntax.y" extern "C" void vm_var__error( diff --git a/src/vm/vm_var_syntax.h b/src/vm/vm_var_syntax.h index d40f8d1d51..337bb45d68 100644 --- a/src/vm/vm_var_syntax.h +++ b/src/vm/vm_var_syntax.h @@ -56,7 +56,7 @@ typedef union YYSTYPE { /* Line 2068 of yacc.c */ -#line 408 "vm_var_syntax.y" +#line 404 "vm_var_syntax.y" char * val_str; int val_int; diff --git a/src/vm/vm_var_syntax.y b/src/vm/vm_var_syntax.y index bd75e41a02..027dade20e 100644 --- a/src/vm/vm_var_syntax.y +++ b/src/vm/vm_var_syntax.y @@ -85,7 +85,6 @@ void get_image_attribute(VirtualMachine * vm, ImagePool * ipool = nd.get_ipool(); Image * img; int iid = -1; - string iid_str; int num; vector attrs; @@ -93,7 +92,7 @@ void get_image_attribute(VirtualMachine * vm, attr_value.clear(); - if (img_name.empty() || img_name != "IMAGE_ID") + if ( img_name.empty() || (img_name!="IMAGE" && img_name!="IMAGE_ID") ) { return; } @@ -113,11 +112,10 @@ void get_image_attribute(VirtualMachine * vm, continue; } - iid_str = disk->vector_value("IMAGE_ID"); - - if ( iid_str == img_value ) + if ( disk->vector_value(img_name.c_str()) == img_value ) { - istringstream iss(img_value); + string iid_str = disk->vector_value("IMAGE_ID"); + istringstream iss(iid_str); iss >> iid; @@ -171,7 +169,6 @@ void get_network_attribute(VirtualMachine * vm, VirtualNetworkPool * vnpool = nd.get_vnpool(); VirtualNetwork * vn; int vnet_id = -1; - string vnet_id_str; int num; vector attrs; @@ -179,7 +176,7 @@ void get_network_attribute(VirtualMachine * vm, attr_value.clear(); - if (net_name.empty() || net_name != "NETWORK_ID") + if ( net_name.empty() || (net_name!="NETWORK" && net_name!="NETWORK_ID") ) { return; } @@ -199,11 +196,10 @@ void get_network_attribute(VirtualMachine * vm, continue; } - vnet_id_str = net->vector_value("NETWORK_ID"); - - if ( vnet_id_str == net_value ) + if ( net->vector_value(net_name.c_str()) == net_value ) { - istringstream iss(net_value); + string vnet_id_str = net->vector_value("NETWORK_ID"); + istringstream iss(vnet_id_str); iss >> vnet_id; From e30782e5e2c4413cc35456e7fb757c60ef2973e7 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 12 Dec 2011 13:34:37 +0100 Subject: [PATCH 10/25] feature #863: Add missing parameters for post actions --- src/vmm_mad/exec/one_vmm_exec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 324542ac89..100c9cdecd 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -389,6 +389,7 @@ class ExecDriver < VirtualMachineDriver { :driver => :vnm, :action => :post, + :parameters => [:deploy_id], :fail_actions => [ { :driver => :vmm, @@ -430,6 +431,7 @@ class ExecDriver < VirtualMachineDriver { :driver => :vnm, :action => :post, + :parameters => [:deploy_id], :destination => :true #TODO :fail_action what to do here? cancel VM? }, From 8cbc0aeab7bf3147f0e1b6ed950df76ce29cb27d Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 12 Dec 2011 14:23:39 +0100 Subject: [PATCH 11/25] fix deployment for new versions of xen --- share/install_gems/install_gems | 4 ++++ src/vmm_mad/remotes/xen/deploy | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/share/install_gems/install_gems b/share/install_gems/install_gems index 3b85b5069c..465dd33f2f 100755 --- a/share/install_gems/install_gems +++ b/share/install_gems/install_gems @@ -37,6 +37,10 @@ GROUPS={ PACKAGES=GROUPS.keys +GEM_TEST={ + 'net-ldap' => 'net/ldap' +} + DISTRIBUTIONS={ :debian => { :id => ['Ubuntu', 'Debian'], diff --git a/src/vmm_mad/remotes/xen/deploy b/src/vmm_mad/remotes/xen/deploy index b91569c1cc..c48816a0be 100755 --- a/src/vmm_mad/remotes/xen/deploy +++ b/src/vmm_mad/remotes/xen/deploy @@ -46,7 +46,7 @@ if [ "x$?" = "x0" ]; then log_debug "Credits set to $credits" - name=`grep -e '^name =' < $domain | cut -d= -f2 | tr -d ' ' | tr -d "\'"` + name=`grep -e '^name =' < $domain | cut -d= -f2 | tr -d ' ' | tr -d "\'" | cut -d' ' -f1` $XM_CREDITS -d $name -w $credits From b5ab3059b2af858a37e87332818fb45d7a7a0d1a Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Mon, 12 Dec 2011 18:43:06 +0100 Subject: [PATCH 12/25] add special cases to install_gems check functionality --- share/install_gems/install_gems | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/install_gems/install_gems b/share/install_gems/install_gems index 465dd33f2f..9b1da6f65d 100755 --- a/share/install_gems/install_gems +++ b/share/install_gems/install_gems @@ -100,8 +100,14 @@ def installed_gems end def try_library(name, error_message) + if GEM_TEST[name.to_s] + lib_test=GEM_TEST[name.to_s] + else + lib_test=name.to_s + end + begin - require name.to_s + require lib_test rescue LoadError, Exception STDERR.puts error_message exit(-1) From 9e2779831ee76eecedba64b76db904d58cd984f9 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 12 Dec 2011 21:54:16 +0100 Subject: [PATCH 13/25] feature #863: fix action name for POLL action --- src/vmm_mad/exec/one_vmm_exec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 100c9cdecd..499f174e7d 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -448,7 +448,7 @@ class ExecDriver < VirtualMachineDriver host = data.elements['HOST'].text deploy_id = data.elements['DEPLOY_ID'].text - do_action("#{deploy_id} #{host}", id, host, :poll) + do_action("#{deploy_id} #{host}", id, host, ACTION[:poll]) end end From 85e3bb3eebe7b6eb564baeb724446d8b10f17be4 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Mon, 12 Dec 2011 22:21:43 +0100 Subject: [PATCH 14/25] feature #863: Better parsing of domainname output for Xen --- src/vmm_mad/remotes/xen/deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm_mad/remotes/xen/deploy b/src/vmm_mad/remotes/xen/deploy index c48816a0be..36d7738f94 100755 --- a/src/vmm_mad/remotes/xen/deploy +++ b/src/vmm_mad/remotes/xen/deploy @@ -37,7 +37,7 @@ output=`$XM_CREATE $domain` error_exit $? "Unable to create domain" -domain_name=`echo $output | grep 'Started domain' | sed 's/^.*Started domain //' | tr -d '\n'` +domain_name=`echo $output | grep 'Started domain' | cut -d' ' -f3` out=`grep -e '^\#O CPU_CREDITS =' < $domain` From b2bc457842bf20137d9d798a936c2bd7a3b3a887 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 13 Dec 2011 10:18:58 +0100 Subject: [PATCH 15/25] feature #863: Fix Xen domain-id parser --- src/vmm_mad/remotes/xen/deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm_mad/remotes/xen/deploy b/src/vmm_mad/remotes/xen/deploy index 36d7738f94..b1257de2ae 100755 --- a/src/vmm_mad/remotes/xen/deploy +++ b/src/vmm_mad/remotes/xen/deploy @@ -37,7 +37,7 @@ output=`$XM_CREATE $domain` error_exit $? "Unable to create domain" -domain_name=`echo $output | grep 'Started domain' | cut -d' ' -f3` +domain_name=`echo $output | grep 'Started domain' | sed 's/^.*Started domain //' | tr -d '\n' | cut -d' ' -f3` out=`grep -e '^\#O CPU_CREDITS =' < $domain` From 2187851bbc3693d8dc14789b4b5f48ab8a2c3e1a Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 13 Dec 2011 10:34:04 +0100 Subject: [PATCH 16/25] feature #863: Right version for patch in b2bc457842bf20137d9d798a936c2bd7a3b3a887 --- src/vmm_mad/remotes/xen/deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm_mad/remotes/xen/deploy b/src/vmm_mad/remotes/xen/deploy index b1257de2ae..bae1ea0ba8 100755 --- a/src/vmm_mad/remotes/xen/deploy +++ b/src/vmm_mad/remotes/xen/deploy @@ -37,7 +37,7 @@ output=`$XM_CREATE $domain` error_exit $? "Unable to create domain" -domain_name=`echo $output | grep 'Started domain' | sed 's/^.*Started domain //' | tr -d '\n' | cut -d' ' -f3` +domain_name=`echo $output | grep 'Started domain' | sed 's/^.*Started domain //' | tr -d '\n' | cut -d' ' -f1` out=`grep -e '^\#O CPU_CREDITS =' < $domain` From 8e49edff323f4f236273d91812cda8dc4b9dbb25 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 13 Dec 2011 12:55:17 +0100 Subject: [PATCH 17/25] Fix image size calculation in quotas --- src/authm_mad/remotes/quota/quota.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/authm_mad/remotes/quota/quota.rb b/src/authm_mad/remotes/quota/quota.rb index b9b29393bb..2303233433 100644 --- a/src/authm_mad/remotes/quota/quota.rb +++ b/src/authm_mad/remotes/quota/quota.rb @@ -82,7 +82,7 @@ class Quota if template['TYPE'] == 'DATABLOCK' template['SIZE'].to_i elsif template['PATH'] - File.size(template['PATH']) + (File.size(template['PATH']).to_f / 2**20).round(2) elsif template['SAVED_VM_ID'] vm_id = template['SAVED_VM_ID'].to_i disk_id = template['SAVED_DISK_ID'].to_i From fe2e33c4884e09b74bede235250271ef176cf207 Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Tue, 13 Dec 2011 16:04:37 +0100 Subject: [PATCH 18/25] Successfully fix typo --- src/vmm_mad/exec/one_vmm_exec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index 499f174e7d..f4627c31b3 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -168,7 +168,7 @@ class VmmAction break else @vmm.log(@id, - "Sussecfully execute #{DRIVER_NAMES[step[:driver]]} " \ + "Successfully execute #{DRIVER_NAMES[step[:driver]]} " \ "operation: #{step[:action]}.") end end From 3bce21e03a53a4bdae843d56f0add99c9f21a6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 13 Dec 2011 17:35:17 +0100 Subject: [PATCH 19/25] Modify one.host.allocate signature, to match changes of commit:665036ef --- include/RequestManagerAllocate.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/RequestManagerAllocate.h b/include/RequestManagerAllocate.h index e2561eb4d9..c9921b39d0 100644 --- a/include/RequestManagerAllocate.h +++ b/include/RequestManagerAllocate.h @@ -210,7 +210,7 @@ public: HostAllocate(): RequestManagerAllocate("HostAllocate", "Allocates a new host", - "A:sssss", + "A:ssssss", false) { Nebula& nd = Nebula::instance(); From 60fe076f85d427325e44b0d9762030974986f8cf Mon Sep 17 00:00:00 2001 From: Hector Sanjuan Date: Tue, 13 Dec 2011 14:34:58 +0100 Subject: [PATCH 20/25] Sunstone's multiple VM instantation should act as CLI's when naming the new VMs (cherry picked from commit be1cea51b1d8d376ee3d34a9ac88ea0b578193af) --- src/sunstone/public/js/plugins/vms-tab.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index bdf52bc315..fcb660d857 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -750,20 +750,17 @@ function setupCreateVMDialog(){ if (!template_id.length){ notifyError("You have not selected a template"); return false; - } + }; if (n_times.length){ n_times_int=parseInt(n_times,10); - } + }; - if (n_times_int>1){ - if (!vm_name.length){ - vm_name = $('#template_id option:selected',this).text(); - } - for (var i=0; i< n_times_int; i++){ - Sunstone.runAction("Template.instantiate",template_id,vm_name+"_"+i); - }; - } else { + if (!vm_name.length){ + vm_name = $('#template_id option:selected',this).text(); + }; + + for (var i=0; i< n_times_int; i++){ Sunstone.runAction("Template.instantiate",template_id,vm_name); }; From 395850c6c34581490422750c51f16f3f8453b0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 15 Dec 2011 18:12:16 +0100 Subject: [PATCH 21/25] Include 'fw' network driver in onedb migrator 3.1.0_to_3.1.80.rb --- src/onedb/3.1.0_to_3.1.80.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/onedb/3.1.0_to_3.1.80.rb b/src/onedb/3.1.0_to_3.1.80.rb index 5644157197..022e096dfd 100644 --- a/src/onedb/3.1.0_to_3.1.80.rb +++ b/src/onedb/3.1.0_to_3.1.80.rb @@ -34,8 +34,8 @@ module Migrator vn_mad = "" - while !( ["802.1Q", "dummy", "ebtables", "ovswitch"].include?(vn_mad) ) do - print " Driver name (802.1Q, dummy, ebtables, ovswitch): " + while !( ["802.1Q", "dummy", "ebtables", "ovswitch", "fw"].include?(vn_mad) ) do + print " Driver name (802.1Q, dummy, ebtables, ovswitch, fw): " vn_mad = gets.chomp vn_mad = "dummy" if vn_mad.empty? end From 004b1ab8f5448503ef86825c191931ebb4dd545f Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Fri, 16 Dec 2011 17:59:04 +0100 Subject: [PATCH 22/25] bug fix drivers for local actions. --- src/mad/ruby/DriverExecHelper.rb | 11 +++++++++++ src/mad/ruby/OpenNebulaDriver.rb | 12 ++---------- src/vmm_mad/exec/one_vmm_exec.rb | 2 +- src/vmm_mad/exec/one_vmm_sh | 2 +- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/mad/ruby/DriverExecHelper.rb b/src/mad/ruby/DriverExecHelper.rb index d6b632b7e0..bb4b86d71b 100644 --- a/src/mad/ruby/DriverExecHelper.rb +++ b/src/mad/ruby/DriverExecHelper.rb @@ -44,6 +44,9 @@ module DriverExecHelper # dummy paths @remote_scripts_path = File.join(@remote_scripts_base_path, directory) @local_scripts_path = File.join(@local_scripts_base_path, directory) + + # mutex for logging + @send_mutex = Mutex.new end # @@ -94,6 +97,14 @@ module DriverExecHelper # # METHODS FOR LOGS & COMMAND OUTPUT # + # Sends a message to the OpenNebula core through stdout + def send_message(action="-", result=RESULT[:failure], id="-", info="-") + @send_mutex.synchronize { + STDOUT.puts "#{action} #{result} #{id} #{info}" + STDOUT.flush + } + end + # Sends a log message to ONE. The +message+ can be multiline, it will # be automatically splitted by lines. def log(number, message) diff --git a/src/mad/ruby/OpenNebulaDriver.rb b/src/mad/ruby/OpenNebulaDriver.rb index 758750aa75..18561f1fc7 100644 --- a/src/mad/ruby/OpenNebulaDriver.rb +++ b/src/mad/ruby/OpenNebulaDriver.rb @@ -57,23 +57,15 @@ class OpenNebulaDriver < ActionManager super(@options[:concurrency], @options[:threaded]) - @retries = @options[:retries] + @retries = @options[:retries] - @send_mutex = Mutex.new - #Set default values initialize_helper(directory, @options) register_action(:INIT, method("init")) end - # Sends a message to the OpenNebula core through stdout - def send_message(action="-", result=RESULT[:failure], id="-", info="-") - @send_mutex.synchronize { - STDOUT.puts "#{action} #{result} #{id} #{info}" - STDOUT.flush - } - end + # Calls remotes or local action checking the action name and # @local_actions. Optional arguments can be specified as a hash diff --git a/src/vmm_mad/exec/one_vmm_exec.rb b/src/vmm_mad/exec/one_vmm_exec.rb index f4627c31b3..a17b02b4c6 100755 --- a/src/vmm_mad/exec/one_vmm_exec.rb +++ b/src/vmm_mad/exec/one_vmm_exec.rb @@ -155,7 +155,7 @@ class VmmAction end # Save the step info - @data["#{step[:action]}_info".to_sym] = info + @data["#{step[:action]}_info".to_sym] = info.strip # Roll back steps, store failed info and break steps if DriverExecHelper.failed?(result) diff --git a/src/vmm_mad/exec/one_vmm_sh b/src/vmm_mad/exec/one_vmm_sh index 77aed093fe..6db516936c 100755 --- a/src/vmm_mad/exec/one_vmm_sh +++ b/src/vmm_mad/exec/one_vmm_sh @@ -22,4 +22,4 @@ else MAD_LOCATION=$ONE_LOCATION/lib/mads fi -exec $MAD_LOCATION/one_vmm_exec -l deploy,shutdown,cancel,save,restore,migrate,poll $* +exec $MAD_LOCATION/one_vmm_exec -l deploy,shutdown,cancel,save,restore,migrate,poll,pre,post,clean $* From beaa71c4f2689236b7ee15506f3f903cc042a972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Fri, 16 Dec 2011 09:49:47 -0800 Subject: [PATCH 23/25] Add XML Schemas (xsd) documentation --- share/doc/xsd/README.txt | 9 ++ share/doc/xsd/group.xsd | 19 +++ share/doc/xsd/group_pool.xsd | 12 ++ share/doc/xsd/host.xsd | 37 +++++ share/doc/xsd/host_pool.xsd | 12 ++ share/doc/xsd/image.xsd | 26 ++++ share/doc/xsd/image_pool.xsd | 12 ++ share/doc/xsd/samples/group/1.xml | 12 ++ share/doc/xsd/samples/group/2.xml | 7 + share/doc/xsd/samples/group_pool/1.xml | 37 +++++ share/doc/xsd/samples/host/1.xml | 27 ++++ share/doc/xsd/samples/host/2.xml | 27 ++++ share/doc/xsd/samples/host/3.xml | 38 +++++ share/doc/xsd/samples/host_pool/1.xml | 41 ++++++ share/doc/xsd/samples/host_pool/2.xml | 67 +++++++++ share/doc/xsd/samples/host_pool/3.xml | 3 + share/doc/xsd/samples/image/1.xml | 23 ++++ share/doc/xsd/samples/image/2.xml | 22 +++ share/doc/xsd/samples/image_pool/1.xml | 3 + share/doc/xsd/samples/image_pool/2.xml | 47 +++++++ share/doc/xsd/samples/image_pool/3.xml | 25 ++++ share/doc/xsd/samples/template/1.xml | 16 +++ share/doc/xsd/samples/template/2.xml | 16 +++ share/doc/xsd/samples/template/3.xml | 13 ++ share/doc/xsd/samples/template_pool/1.xml | 35 +++++ share/doc/xsd/samples/template_pool/2.xml | 3 + share/doc/xsd/samples/user/1.xml | 12 ++ share/doc/xsd/samples/user/2.xml | 12 ++ share/doc/xsd/samples/user/3.xml | 21 +++ share/doc/xsd/samples/user_pool/1.xml | 53 +++++++ share/doc/xsd/samples/vm/1.xml | 26 ++++ share/doc/xsd/samples/vm/2.xml | 81 +++++++++++ share/doc/xsd/samples/vm/3.xml | 81 +++++++++++ share/doc/xsd/samples/vm_pool/1.xml | 161 ++++++++++++++++++++++ share/doc/xsd/samples/vm_pool/2.xml | 3 + share/doc/xsd/samples/vnet/1.xml | 48 +++++++ share/doc/xsd/samples/vnet/2.xml | 26 ++++ share/doc/xsd/samples/vnet/3.xml | 23 ++++ share/doc/xsd/samples/vnet_pool/1.xml | 3 + share/doc/xsd/samples/vnet_pool/2.xml | 63 +++++++++ share/doc/xsd/template.xsd | 18 +++ share/doc/xsd/template_pool.xsd | 12 ++ share/doc/xsd/test.sh | 5 + share/doc/xsd/user.xsd | 18 +++ share/doc/xsd/user_pool.xsd | 12 ++ share/doc/xsd/vm.xsd | 55 ++++++++ share/doc/xsd/vm_pool.xsd | 12 ++ share/doc/xsd/vnet.xsd | 48 +++++++ share/doc/xsd/vnet_pool.xsd | 12 ++ 49 files changed, 1394 insertions(+) create mode 100644 share/doc/xsd/README.txt create mode 100644 share/doc/xsd/group.xsd create mode 100644 share/doc/xsd/group_pool.xsd create mode 100644 share/doc/xsd/host.xsd create mode 100644 share/doc/xsd/host_pool.xsd create mode 100644 share/doc/xsd/image.xsd create mode 100644 share/doc/xsd/image_pool.xsd create mode 100644 share/doc/xsd/samples/group/1.xml create mode 100644 share/doc/xsd/samples/group/2.xml create mode 100644 share/doc/xsd/samples/group_pool/1.xml create mode 100644 share/doc/xsd/samples/host/1.xml create mode 100644 share/doc/xsd/samples/host/2.xml create mode 100644 share/doc/xsd/samples/host/3.xml create mode 100644 share/doc/xsd/samples/host_pool/1.xml create mode 100644 share/doc/xsd/samples/host_pool/2.xml create mode 100644 share/doc/xsd/samples/host_pool/3.xml create mode 100644 share/doc/xsd/samples/image/1.xml create mode 100644 share/doc/xsd/samples/image/2.xml create mode 100644 share/doc/xsd/samples/image_pool/1.xml create mode 100644 share/doc/xsd/samples/image_pool/2.xml create mode 100644 share/doc/xsd/samples/image_pool/3.xml create mode 100644 share/doc/xsd/samples/template/1.xml create mode 100644 share/doc/xsd/samples/template/2.xml create mode 100644 share/doc/xsd/samples/template/3.xml create mode 100644 share/doc/xsd/samples/template_pool/1.xml create mode 100644 share/doc/xsd/samples/template_pool/2.xml create mode 100644 share/doc/xsd/samples/user/1.xml create mode 100644 share/doc/xsd/samples/user/2.xml create mode 100644 share/doc/xsd/samples/user/3.xml create mode 100644 share/doc/xsd/samples/user_pool/1.xml create mode 100644 share/doc/xsd/samples/vm/1.xml create mode 100644 share/doc/xsd/samples/vm/2.xml create mode 100644 share/doc/xsd/samples/vm/3.xml create mode 100644 share/doc/xsd/samples/vm_pool/1.xml create mode 100644 share/doc/xsd/samples/vm_pool/2.xml create mode 100644 share/doc/xsd/samples/vnet/1.xml create mode 100644 share/doc/xsd/samples/vnet/2.xml create mode 100644 share/doc/xsd/samples/vnet/3.xml create mode 100644 share/doc/xsd/samples/vnet_pool/1.xml create mode 100644 share/doc/xsd/samples/vnet_pool/2.xml create mode 100644 share/doc/xsd/template.xsd create mode 100644 share/doc/xsd/template_pool.xsd create mode 100755 share/doc/xsd/test.sh create mode 100644 share/doc/xsd/user.xsd create mode 100644 share/doc/xsd/user_pool.xsd create mode 100644 share/doc/xsd/vm.xsd create mode 100644 share/doc/xsd/vm_pool.xsd create mode 100644 share/doc/xsd/vnet.xsd create mode 100644 share/doc/xsd/vnet_pool.xsd diff --git a/share/doc/xsd/README.txt b/share/doc/xsd/README.txt new file mode 100644 index 0000000000..00d6a90185 --- /dev/null +++ b/share/doc/xsd/README.txt @@ -0,0 +1,9 @@ +These XML Schemas define the XMLs returned by OpenNebula's XML-RPC API. + +The included XML samples are not actual responses from OpenNebula, as it does +not include the headers (namespace, schema location). + + +To learn more, please read the API reference documentation at +http://opennebula.org/documentation:documentation:api + diff --git a/share/doc/xsd/group.xsd b/share/doc/xsd/group.xsd new file mode 100644 index 0000000000..eb36432fff --- /dev/null +++ b/share/doc/xsd/group.xsd @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff --git a/share/doc/xsd/group_pool.xsd b/share/doc/xsd/group_pool.xsd new file mode 100644 index 0000000000..c8dc69c06b --- /dev/null +++ b/share/doc/xsd/group_pool.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/share/doc/xsd/host.xsd b/share/doc/xsd/host.xsd new file mode 100644 index 0000000000..58fa4d8bbe --- /dev/null +++ b/share/doc/xsd/host.xsd @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/doc/xsd/host_pool.xsd b/share/doc/xsd/host_pool.xsd new file mode 100644 index 0000000000..5d797d3cbb --- /dev/null +++ b/share/doc/xsd/host_pool.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/share/doc/xsd/image.xsd b/share/doc/xsd/image.xsd new file mode 100644 index 0000000000..207cee1bd0 --- /dev/null +++ b/share/doc/xsd/image.xsd @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/share/doc/xsd/image_pool.xsd b/share/doc/xsd/image_pool.xsd new file mode 100644 index 0000000000..6e39f45267 --- /dev/null +++ b/share/doc/xsd/image_pool.xsd @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/share/doc/xsd/samples/group/1.xml b/share/doc/xsd/samples/group/1.xml new file mode 100644 index 0000000000..35813b2430 --- /dev/null +++ b/share/doc/xsd/samples/group/1.xml @@ -0,0 +1,12 @@ + + 1 + users + + 2 + 3 + 4 + 5 + + \ No newline at end of file diff --git a/share/doc/xsd/samples/group/2.xml b/share/doc/xsd/samples/group/2.xml new file mode 100644 index 0000000000..83ec0ed02b --- /dev/null +++ b/share/doc/xsd/samples/group/2.xml @@ -0,0 +1,7 @@ + + 100 + new + + \ No newline at end of file diff --git a/share/doc/xsd/samples/group_pool/1.xml b/share/doc/xsd/samples/group_pool/1.xml new file mode 100644 index 0000000000..4c99b3289c --- /dev/null +++ b/share/doc/xsd/samples/group_pool/1.xml @@ -0,0 +1,37 @@ + + + 0 + oneadmin + + 0 + 1 + + + + 1 + users + + 2 + 3 + 4 + 5 + + + + 100 + new + + + + 101 + test + + + + 102 + abc + + + \ No newline at end of file diff --git a/share/doc/xsd/samples/host/1.xml b/share/doc/xsd/samples/host/1.xml new file mode 100644 index 0000000000..400cdf25f7 --- /dev/null +++ b/share/doc/xsd/samples/host/1.xml @@ -0,0 +1,27 @@ + + 0 + localhost + 3 + im_dummy + vmm_dummy + fw + tm_shared + 0 + + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + +