opennebula 5.4.15 → 5.5.80.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/NOTICE +1 -1
  3. data/lib/ActionManager.rb +1 -1
  4. data/lib/CommandManager.rb +82 -59
  5. data/lib/DriverExecHelper.rb +1 -1
  6. data/lib/OpenNebulaDriver.rb +1 -1
  7. data/lib/VirtualMachineDriver.rb +1 -1
  8. data/lib/cloud/CloudClient.rb +3 -3
  9. data/lib/opennebula.rb +2 -2
  10. data/lib/opennebula/acl.rb +1 -1
  11. data/lib/opennebula/acl_pool.rb +1 -1
  12. data/lib/opennebula/client.rb +1 -1
  13. data/lib/opennebula/cluster.rb +1 -1
  14. data/lib/opennebula/cluster_pool.rb +1 -1
  15. data/lib/opennebula/datastore.rb +1 -1
  16. data/lib/opennebula/datastore_pool.rb +1 -1
  17. data/lib/opennebula/document.rb +1 -1
  18. data/lib/opennebula/document_json.rb +1 -1
  19. data/lib/opennebula/document_pool.rb +1 -1
  20. data/lib/opennebula/document_pool_json.rb +1 -1
  21. data/lib/opennebula/error.rb +1 -1
  22. data/lib/opennebula/group.rb +1 -1
  23. data/lib/opennebula/group_pool.rb +1 -1
  24. data/lib/opennebula/host.rb +1 -1
  25. data/lib/opennebula/host_pool.rb +1 -1
  26. data/lib/opennebula/image.rb +12 -2
  27. data/lib/opennebula/image_pool.rb +1 -1
  28. data/lib/opennebula/ldap_auth.rb +15 -20
  29. data/lib/opennebula/ldap_auth_spec.rb +1 -1
  30. data/lib/opennebula/marketplace.rb +1 -1
  31. data/lib/opennebula/marketplace_pool.rb +1 -1
  32. data/lib/opennebula/marketplaceapp.rb +14 -2
  33. data/lib/opennebula/marketplaceapp_pool.rb +1 -1
  34. data/lib/opennebula/oneflow_client.rb +1 -1
  35. data/lib/opennebula/pool.rb +1 -1
  36. data/lib/opennebula/pool_element.rb +24 -3
  37. data/lib/opennebula/security_group.rb +1 -1
  38. data/lib/opennebula/security_group_pool.rb +1 -1
  39. data/lib/opennebula/server_cipher_auth.rb +1 -1
  40. data/lib/opennebula/server_x509_auth.rb +1 -1
  41. data/lib/opennebula/ssh_auth.rb +1 -1
  42. data/lib/opennebula/system.rb +1 -1
  43. data/lib/opennebula/template.rb +14 -2
  44. data/lib/opennebula/template_pool.rb +1 -1
  45. data/lib/opennebula/user.rb +1 -1
  46. data/lib/opennebula/user_pool.rb +1 -1
  47. data/lib/opennebula/utils.rb +20 -1
  48. data/lib/opennebula/vdc.rb +1 -1
  49. data/lib/opennebula/vdc_pool.rb +1 -1
  50. data/lib/opennebula/virtual_machine.rb +19 -4
  51. data/lib/opennebula/virtual_machine_pool.rb +1 -1
  52. data/lib/opennebula/virtual_network.rb +12 -2
  53. data/lib/opennebula/virtual_network_pool.rb +1 -1
  54. data/lib/opennebula/virtual_router.rb +13 -1
  55. data/lib/opennebula/virtual_router_pool.rb +1 -1
  56. data/lib/opennebula/vm_group.rb +14 -2
  57. data/lib/opennebula/vm_group_pool.rb +1 -1
  58. data/lib/opennebula/x509_auth.rb +1 -1
  59. data/lib/opennebula/xml_element.rb +10 -1
  60. data/lib/opennebula/xml_pool.rb +1 -1
  61. data/lib/opennebula/xml_utils.rb +1 -1
  62. data/lib/opennebula/zone.rb +67 -1
  63. data/lib/opennebula/zone_pool.rb +1 -1
  64. data/lib/vcenter_driver.rb +17 -1
  65. metadata +4 -4
@@ -1,5 +1,5 @@
1
1
  # ---------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -131,31 +131,26 @@ class OpenNebula::LdapAuth
131
131
  end
132
132
 
133
133
  def find_user(name)
134
- begin
135
- filter = Net::LDAP::Filter.eq(@options[:user_field], escape(name))
134
+ filter = Net::LDAP::Filter.eq(@options[:user_field], escape(name))
136
135
 
137
- result = @ldap.search(
138
- :base => @options[:base],
139
- :attributes => @options[:attributes],
140
- :filter => filter
141
- )
136
+ result = @ldap.search(
137
+ :base => @options[:base],
138
+ :attributes => @options[:attributes],
139
+ :filter => filter
140
+ )
141
+
142
+ if result && result.first
143
+ @user = result.first
144
+ [@user.dn, @user[@options[:user_group_field]]]
145
+ else
146
+ result=@ldap.search(:base => name)
142
147
 
143
148
  if result && result.first
144
149
  @user = result.first
145
- [@user.dn, @user[@options[:user_group_field]]]
150
+ [name, @user[@options[:user_group_field]]]
146
151
  else
147
- result=@ldap.search(:base => name)
148
-
149
- if result && result.first
150
- @user = result.first
151
- [name, @user[@options[:user_group_field]]]
152
- else
153
- [nil, nil]
154
- end
152
+ [nil, nil]
155
153
  end
156
- rescue Exception => e
157
- STDERR.puts e.message
158
- [nil, nil]
159
154
  end
160
155
  end
161
156
 
@@ -1,5 +1,5 @@
1
1
  # ---------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -30,7 +30,9 @@ module OpenNebula
30
30
  :chown => "marketapp.chown",
31
31
  :chmod => "marketapp.chmod",
32
32
  :rename => "marketapp.rename",
33
- :enable => "marketapp.enable"
33
+ :enable => "marketapp.enable",
34
+ :lock => "marketapp.lock",
35
+ :unlock => "marketapp.unlock"
34
36
  }
35
37
 
36
38
  MARKETPLACEAPP_STATES=%w{INIT READY LOCKED ERROR DISABLED}
@@ -263,5 +265,15 @@ module OpenNebula
263
265
  def short_state_str
264
266
  SHORT_MARKETPLACEAPP_STATES[state_str]
265
267
  end
268
+
269
+ #Locked a MarketplaceApp
270
+ def lock(level)
271
+ return call(MARKETPLACEAPP_METHODS[:lock], @pe_id, level)
272
+ end
273
+
274
+ #Unlocked a MarketplaceApp
275
+ def unlock()
276
+ return call(MARKETPLACEAPP_METHODS[:unlock], @pe_id)
277
+ end
266
278
  end
267
279
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -110,7 +110,9 @@ module OpenNebula
110
110
  # @return [nil, OpenNebula::Error] nil in case of success, Error
111
111
  # otherwise
112
112
  def update(xml_method, new_template, *args)
113
- new_template ||= template_xml
113
+ if new_template.nil?
114
+ return Error.new("Wrong argument", Error::EXML_RPC_CALL)
115
+ end
114
116
 
115
117
  return call(xml_method, @pe_id, new_template, *args)
116
118
  end
@@ -234,6 +236,26 @@ module OpenNebula
234
236
 
235
237
  return str
236
238
  end
239
+
240
+ # Replace the xml pointed by xpath using a Hash object
241
+ # one object will be modified taking hash object pairs
242
+ #
243
+ # @param [String] xpath
244
+ # @param [Hash] options object containing pair key-value
245
+ #
246
+ # @returns the new xml representation
247
+ def replace(opts, xpath = "TEMPLATE")
248
+ if self[xpath]
249
+ opts.each do |att, value|
250
+ xpath_u = xpath+"/#{att}"
251
+ docs = retrieve_xmlelements(xpath_u)
252
+ if docs.size == 1
253
+ docs[0].set_content(value)
254
+ end
255
+ end
256
+ update(template_like_str(xpath))
257
+ end
258
+ end
237
259
  end
238
260
 
239
261
  # Processes the monitoring data in XML returned by OpenNebula
@@ -265,7 +287,6 @@ module OpenNebula
265
287
  return hash
266
288
  end
267
289
 
268
-
269
290
  # Alternative method with better performance for huge number of timestamps.
270
291
  # For reasonable amounts of data, the current method is quicker
271
292
  =begin
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -33,7 +33,9 @@ module OpenNebula
33
33
  :chown => "template.chown",
34
34
  :chmod => "template.chmod",
35
35
  :clone => "template.clone",
36
- :rename => "template.rename"
36
+ :rename => "template.rename",
37
+ :lock => "template.lock",
38
+ :unlock => "template.unlock"
37
39
  }
38
40
 
39
41
  # Creates a Template description with just its identifier
@@ -241,6 +243,16 @@ module OpenNebula
241
243
  self['UID'].to_i
242
244
  end
243
245
 
246
+ # Lock a Template
247
+ def lock(level)
248
+ return call(TEMPLATE_METHODS[:lock], @pe_id, level)
249
+ end
250
+
251
+ # Unlock a Template
252
+ def unlock()
253
+ return call(TEMPLATE_METHODS[:unlock], @pe_id)
254
+ end
255
+
244
256
  def public?
245
257
  if self['PERMISSIONS/GROUP_U'] == "1" || self['PERMISSIONS/OTHER_U'] == "1"
246
258
  true
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -47,4 +47,23 @@ module OpenNebula
47
47
  return opts
48
48
  end
49
49
 
50
+ # >> /var/log/one/oned.log
51
+ def self.handle_driver_exception(action, ex, host, did = nil, id = nil, file = nil)
52
+
53
+ file ||= ""
54
+ id ||= ""
55
+ did ||= ""
56
+ OpenNebula::log_error(action + " of VM #{id} #{did} on host #{host} #{file} "+
57
+ "due to \"#{ex.message}\"" +
58
+ "\n********* STACK TRACE *********\n" +
59
+ "\t#{ex.backtrace.join("\n\t")}" +
60
+ "\n*******************************\n")
61
+
62
+ OpenNebula.error_message("There is a problem: #{ex.message}")
63
+ exit (-1)
64
+ end
65
+
66
+
67
+
68
+
50
69
  end
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -47,7 +47,9 @@ module OpenNebula
47
47
  :disksnapshotrevert => "vm.disksnapshotrevert",
48
48
  :disksnapshotdelete => "vm.disksnapshotdelete",
49
49
  :diskresize => "vm.diskresize",
50
- :updateconf => "vm.updateconf"
50
+ :updateconf => "vm.updateconf",
51
+ :lock => "vm.lock",
52
+ :unlock => "vm.unlock"
51
53
  }
52
54
 
53
55
  VM_STATE=%w{INIT PENDING HOLD ACTIVE STOPPED SUSPENDED DONE FAILED
@@ -323,6 +325,9 @@ module OpenNebula
323
325
  end
324
326
  end
325
327
 
328
+ def replace(opts = {})
329
+ super(opts, "USER_TEMPLATE")
330
+ end
326
331
 
327
332
  # Initiates the instance of the VM on the target host.
328
333
  #
@@ -686,7 +691,17 @@ module OpenNebula
686
691
  # otherwise
687
692
  def updateconf(new_conf)
688
693
  return call(VM_METHODS[:updateconf], @pe_id, new_conf)
689
- end
694
+ end
695
+
696
+ # Lock a VM
697
+ def lock(level)
698
+ return call(VM_METHODS[:lock], @pe_id, level)
699
+ end
700
+
701
+ # Unlock a VM
702
+ def unlock()
703
+ return call(VM_METHODS[:unlock], @pe_id)
704
+ end
690
705
 
691
706
  ########################################################################
692
707
  # Helpers to get VirtualMachine information
@@ -853,7 +868,7 @@ module OpenNebula
853
868
  REMOVE_VNET_ATTRS.each do |attr|
854
869
  nic.delete_element(attr)
855
870
  end
856
-
871
+
857
872
  replace << "NIC = [ " << nic.template_like_str(".").tr("\n", ",\n") << " ] \n"
858
873
  end
859
874
 
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -38,7 +38,9 @@ module OpenNebula
38
38
  :release => "vn.release",
39
39
  :rename => "vn.rename",
40
40
  :reserve => "vn.reserve",
41
- :free_ar => "vn.free_ar"
41
+ :free_ar => "vn.free_ar",
42
+ :lock => "vn.lock",
43
+ :unlock => "vn.unlock"
42
44
  }
43
45
 
44
46
  # Creates a VirtualNetwork description with just its identifier
@@ -330,6 +332,14 @@ module OpenNebula
330
332
  return array
331
333
  end
332
334
 
335
+ def lock(level)
336
+ return call(VN_METHODS[:lock], @pe_id, level)
337
+ end
338
+
339
+ def unlock()
340
+ return call(VN_METHODS[:unlock], @pe_id)
341
+ end
342
+
333
343
  private
334
344
  def set_publish(published)
335
345
  group_u = published ? 1 : 0
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -1,5 +1,5 @@
1
1
  # -------------------------------------------------------------------------- #
2
- # Copyright 2002-2017, OpenNebula Project, OpenNebula Systems #
2
+ # Copyright 2002-2018, OpenNebula Project, OpenNebula Systems #
3
3
  # #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you may #
5
5
  # not use this file except in compliance with the License. You may obtain #
@@ -34,6 +34,8 @@ module OpenNebula
34
34
  :rename => "vrouter.rename",
35
35
  :attachnic => "vrouter.attachnic",
36
36
  :detachnic => "vrouter.detachnic",
37
+ :lock => "vrouter.lock",
38
+ :unlock => "vrouter.unlock"
37
39
  }
38
40
 
39
41
  # Creates a VirtualRouter description with just its identifier
@@ -175,6 +177,16 @@ module OpenNebula
175
177
  return call(VIRTUAL_ROUTER_METHODS[:detachnic], @pe_id, nic_id)
176
178
  end
177
179
 
180
+ # Lock a VRouter
181
+ def lock(level)
182
+ return call(VIRTUAL_ROUTER_METHODS[:lock], @pe_id, level)
183
+ end
184
+
185
+ # Unlock a VRouter
186
+ def unlock()
187
+ return call(VIRTUAL_ROUTER_METHODS[:unlock], @pe_id)
188
+ end
189
+
178
190
  #######################################################################
179
191
  # Helpers to get VirtualRouter information
180
192
  #######################################################################