opennebula-cli 6.6.1 → 6.6.3
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.
- checksums.yaml +4 -4
- data/bin/oneacl +1 -1
- data/bin/onecluster +1 -1
- data/bin/onedatastore +1 -1
- data/bin/oneflow-template +10 -5
- data/bin/onegroup +1 -1
- data/bin/onehook +1 -1
- data/bin/onehost +1 -1
- data/bin/oneimage +1 -1
- data/bin/onemarket +1 -1
- data/bin/onemarketapp +1 -1
- data/bin/onesecgroup +1 -1
- data/bin/onetemplate +1 -1
- data/bin/oneuser +1 -1
- data/bin/onevdc +1 -1
- data/bin/onevm +24 -8
- data/bin/onevmgroup +1 -1
- data/bin/onevnet +1 -1
- data/bin/onevntemplate +1 -1
- data/bin/onevrouter +1 -1
- data/bin/onezone +1 -1
- data/lib/one_helper/oneflowtemplate_helper.rb +29 -0
- data/lib/one_helper/onetemplate_helper.rb +1 -0
- data/lib/one_helper/onevm_helper.rb +50 -57
- data/lib/one_helper.rb +321 -325
- data/share/schemas/xsd/vm_pool.xsd +1 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e74dc25cf00cc6c901701dcfef74bb0d5f34145ca4ce12d3a2aae23f4f0ce83
|
4
|
+
data.tar.gz: fabdc4659737fb9adc7219d04b0057034ad04503f1c28e68912c748f02405952
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2cd0831f008fb2b52ea545c2d1615a8cc0e31e376199e6b52dab49553b1677e6628dbafd0fde22544562d4c8bea00572ce1b20e353dc45e096e5f721d5a35c9
|
7
|
+
data.tar.gz: 10d16e841304506cb3978fd67d8349e7f7684bbe70fc2f7351a2fcc1129f41af9a626a8580099f24415d879d280b1e085ce7b29ff523e35b13e6c04d66e0a71d
|
data/bin/oneacl
CHANGED
data/bin/onecluster
CHANGED
data/bin/onedatastore
CHANGED
@@ -163,7 +163,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
163
163
|
end
|
164
164
|
|
165
165
|
list_desc = <<-EOT.unindent
|
166
|
-
Lists Datastores in the pool
|
166
|
+
Lists Datastores in the pool. #{OneDatastoreHelper.list_layout_help}
|
167
167
|
EOT
|
168
168
|
|
169
169
|
command :list, list_desc, :options => list_options do
|
data/bin/oneflow-template
CHANGED
@@ -61,6 +61,7 @@ require 'command_parser'
|
|
61
61
|
require 'opennebula/oneflow_client'
|
62
62
|
require 'cli_helper'
|
63
63
|
require 'one_helper/oneflowtemplate_helper'
|
64
|
+
require 'one_helper/onetemplate_helper'
|
64
65
|
|
65
66
|
USER_AGENT = 'CLI'
|
66
67
|
|
@@ -78,7 +79,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
78
79
|
|
79
80
|
RECURSIVE = {
|
80
81
|
:name => 'recursive',
|
81
|
-
:short => '-
|
82
|
+
:short => '-R',
|
82
83
|
:large => '--recursive',
|
83
84
|
:description => 'Clone the template recursively (templates and images)'
|
84
85
|
}
|
@@ -253,14 +254,18 @@ CommandParser::CmdParser.new(ARGV) do
|
|
253
254
|
break
|
254
255
|
end
|
255
256
|
|
257
|
+
params['merge_template'] = {}
|
256
258
|
body = JSON.parse(response.body)['DOCUMENT']['TEMPLATE']['BODY']
|
257
259
|
|
258
|
-
|
259
|
-
|
260
|
-
)
|
260
|
+
# Check global custom attributes
|
261
|
+
custom_attrs = helper.custom_attrs(body['custom_attrs'])
|
262
|
+
params['merge_template'].merge!(custom_attrs) unless custom_attrs.nil?
|
261
263
|
|
262
|
-
|
264
|
+
# Check role level custom attributes
|
265
|
+
custom_role_attrs = helper.custom_role_attrs(body['roles'])
|
266
|
+
params['merge_template'].merge!(custom_role_attrs) unless custom_role_attrs.nil?
|
263
267
|
|
268
|
+
# Check vnets attributes
|
264
269
|
vnets = helper.networks(body['networks'])
|
265
270
|
params['merge_template'].merge!(vnets) unless vnets.nil?
|
266
271
|
end
|
data/bin/onegroup
CHANGED
data/bin/onehook
CHANGED
@@ -229,7 +229,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
229
229
|
end
|
230
230
|
|
231
231
|
list_desc = <<-EOT.unindent
|
232
|
-
Lists Hooks in the pool
|
232
|
+
Lists Hooks in the pool. #{OneHookHelper.list_layout_help}
|
233
233
|
EOT
|
234
234
|
|
235
235
|
command :list, list_desc, [:filterflag, nil], :options => list_options do
|
data/bin/onehost
CHANGED
data/bin/oneimage
CHANGED
@@ -478,7 +478,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
478
478
|
end
|
479
479
|
|
480
480
|
list_desc = <<-EOT.unindent
|
481
|
-
Lists Images in the pool
|
481
|
+
Lists Images in the pool. #{OneImageHelper.list_layout_help}
|
482
482
|
EOT
|
483
483
|
|
484
484
|
command :list, list_desc, [:filterflag, nil], :options => list_options do
|
data/bin/onemarket
CHANGED
data/bin/onemarketapp
CHANGED
@@ -403,7 +403,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
403
403
|
end
|
404
404
|
|
405
405
|
list_desc = <<-EOT.unindent
|
406
|
-
Lists marketplace apps
|
406
|
+
Lists marketplace apps. #{OneMarketPlaceAppHelper.list_layout_help}
|
407
407
|
EOT
|
408
408
|
|
409
409
|
command :list, list_desc, [:filterflag, nil], :options => list_options do
|
data/bin/onesecgroup
CHANGED
@@ -224,7 +224,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
224
224
|
end
|
225
225
|
|
226
226
|
list_desc = <<-EOT.unindent
|
227
|
-
Lists Security Group in the pool
|
227
|
+
Lists Security Group in the pool. #{OneSecurityGroupHelper.list_layout_help}
|
228
228
|
EOT
|
229
229
|
|
230
230
|
command :list, list_desc, [:filterflag, nil], :options => list_options do
|
data/bin/onetemplate
CHANGED
data/bin/oneuser
CHANGED
data/bin/onevdc
CHANGED
data/bin/onevm
CHANGED
@@ -1278,7 +1278,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1278
1278
|
end
|
1279
1279
|
|
1280
1280
|
list_desc = <<-EOT.unindent
|
1281
|
-
Lists VMs in the pool
|
1281
|
+
Lists VMs in the pool. #{OneVMHelper.list_layout_help}
|
1282
1282
|
EOT
|
1283
1283
|
|
1284
1284
|
command :list, list_desc, [:filterflag, nil],
|
@@ -1485,11 +1485,11 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1485
1485
|
create_chart_desc = <<-EOT.unindent
|
1486
1486
|
Adds a charter to the VM, these are some consecutive scheduled actions
|
1487
1487
|
|
1488
|
-
You can configure the actions in
|
1488
|
+
You can configure the actions in #{OneVMHelper.conf_file}
|
1489
1489
|
EOT
|
1490
1490
|
|
1491
1491
|
command :'create-chart', create_chart_desc, :vmid do
|
1492
|
-
charters = helper.
|
1492
|
+
charters = helper.charters
|
1493
1493
|
|
1494
1494
|
if charters.nil?
|
1495
1495
|
STDERR.puts 'No charters found on configuration file'
|
@@ -1512,10 +1512,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1512
1512
|
action.to_s,
|
1513
1513
|
time[:warning][:time] + acc_w)
|
1514
1514
|
|
1515
|
-
if
|
1516
|
-
STDERR.puts rc.message
|
1517
|
-
exit(-1)
|
1518
|
-
end
|
1515
|
+
exit(-1) if rc < 0
|
1519
1516
|
|
1520
1517
|
acc_t += time[:time].to_i
|
1521
1518
|
acc_w += time[:warning][:time].to_i
|
@@ -1578,7 +1575,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1578
1575
|
reset = options[:reset] == true
|
1579
1576
|
|
1580
1577
|
if !options[:schedule].nil?
|
1581
|
-
options[:args] = options[:datastore]
|
1578
|
+
options[:args] = "#{options[:datastore]},#{reset ? 1 : 0}"
|
1582
1579
|
|
1583
1580
|
helper.schedule_actions([args[0]], options, @comm_name)
|
1584
1581
|
else
|
@@ -1594,6 +1591,25 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1594
1591
|
end
|
1595
1592
|
end
|
1596
1593
|
|
1594
|
+
backup_cancel_desc = <<-EOT.unindent
|
1595
|
+
Cancels an active VM backup operation
|
1596
|
+
|
1597
|
+
States: RUNNING, POWEROFF
|
1598
|
+
EOT
|
1599
|
+
|
1600
|
+
command :'backup-cancel',
|
1601
|
+
backup_cancel_desc,
|
1602
|
+
:vmid do
|
1603
|
+
helper.perform_action(args[0], options, 'Canceling backup') do |vm|
|
1604
|
+
rc = vm.backup_cancel
|
1605
|
+
|
1606
|
+
if OpenNebula.is_error?(rc)
|
1607
|
+
STDERR.puts "Error canceling VM backup: #{rc.message}"
|
1608
|
+
exit(-1)
|
1609
|
+
end
|
1610
|
+
end
|
1611
|
+
end
|
1612
|
+
|
1597
1613
|
ssh_desc = <<-EOT.unindent
|
1598
1614
|
SSH into VM
|
1599
1615
|
|
data/bin/onevmgroup
CHANGED
@@ -151,7 +151,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
151
151
|
end
|
152
152
|
|
153
153
|
list_desc = <<-EOT.unindent
|
154
|
-
Lists VM Group in the pool
|
154
|
+
Lists VM Group in the pool. #{OneVMGroupHelper.list_layout_help}
|
155
155
|
EOT
|
156
156
|
|
157
157
|
command :list, list_desc, [:filterflag, nil], :options => list_options do
|
data/bin/onevnet
CHANGED
@@ -347,7 +347,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
347
347
|
end
|
348
348
|
|
349
349
|
list_desc = <<-EOT.unindent
|
350
|
-
Lists Virtual Networks in the pool
|
350
|
+
Lists Virtual Networks in the pool. #{OneVNetHelper.list_layout_help}
|
351
351
|
EOT
|
352
352
|
|
353
353
|
command :list, list_desc, [:filterflag, nil],
|
data/bin/onevntemplate
CHANGED
data/bin/onevrouter
CHANGED
@@ -341,7 +341,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
341
341
|
end
|
342
342
|
|
343
343
|
list_desc = <<-EOT.unindent
|
344
|
-
Lists the Virtual Routers in the pool
|
344
|
+
Lists the Virtual Routers in the pool. #{OneVirtualRouterHelper.list_layout_help}
|
345
345
|
EOT
|
346
346
|
|
347
347
|
command :list, list_desc, [:filterflag, nil], :options => list_options do
|
data/bin/onezone
CHANGED
@@ -193,6 +193,35 @@ class OneFlowTemplateHelper < OpenNebulaHelper::OneHelper
|
|
193
193
|
ret
|
194
194
|
end
|
195
195
|
|
196
|
+
# Get custom role attributes values from user
|
197
|
+
#
|
198
|
+
# @param role [Hash] Service role with custom attributes
|
199
|
+
#
|
200
|
+
# @return [Hash] Role with custom attributes values
|
201
|
+
def custom_role_attrs(roles)
|
202
|
+
return if roles.nil? || roles.empty?
|
203
|
+
|
204
|
+
ret = {}
|
205
|
+
role_with_custom_attrs = false
|
206
|
+
|
207
|
+
roles.each do |role|
|
208
|
+
next unless role.key?('custom_attrs')
|
209
|
+
|
210
|
+
####################################################################
|
211
|
+
# Display Role Information
|
212
|
+
####################################################################
|
213
|
+
header = "> Please insert the user inputs for the role \"#{role['name']}\""
|
214
|
+
puts header
|
215
|
+
|
216
|
+
role.merge!(custom_attrs(role['custom_attrs']))
|
217
|
+
role_with_custom_attrs = true
|
218
|
+
end
|
219
|
+
|
220
|
+
ret['roles'] = roles if role_with_custom_attrs
|
221
|
+
|
222
|
+
ret
|
223
|
+
end
|
224
|
+
|
196
225
|
def networks(vnets)
|
197
226
|
return unless vnets
|
198
227
|
|