opennebula-cli 6.4.3 → 6.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.
- checksums.yaml +4 -4
- data/bin/oneacct +1 -1
- data/bin/oneacl +1 -1
- data/bin/onecluster +1 -1
- data/bin/onedatastore +1 -1
- data/bin/oneflow +1 -1
- data/bin/oneflow-template +1 -1
- data/bin/onegroup +1 -1
- data/bin/onehook +1 -1
- data/bin/onehost +1 -1
- data/bin/oneimage +52 -3
- data/bin/oneirb +1 -1
- data/bin/onelog +1 -1
- data/bin/onemarket +1 -1
- data/bin/onemarketapp +1 -1
- data/bin/onesecgroup +1 -1
- data/bin/oneshowback +1 -1
- data/bin/onetemplate +1 -1
- data/bin/oneuser +2 -2
- data/bin/onevcenter +1 -1
- data/bin/onevdc +1 -1
- data/bin/onevm +137 -147
- data/bin/onevmgroup +1 -1
- data/bin/onevnet +16 -4
- data/bin/onevntemplate +1 -1
- data/bin/onevrouter +1 -1
- data/bin/onezone +1 -1
- data/lib/cli_helper.rb +1 -1
- data/lib/command_parser.rb +1 -1
- data/lib/one_helper/oneacct_helper.rb +1 -1
- data/lib/one_helper/oneacl_helper.rb +1 -1
- data/lib/one_helper/onecluster_helper.rb +1 -1
- data/lib/one_helper/onedatastore_helper.rb +1 -1
- data/lib/one_helper/oneflow_helper.rb +1 -1
- data/lib/one_helper/oneflowtemplate_helper.rb +1 -1
- data/lib/one_helper/onegroup_helper.rb +1 -1
- data/lib/one_helper/onehook_helper.rb +1 -1
- data/lib/one_helper/onehost_helper.rb +13 -56
- data/lib/one_helper/oneimage_helper.rb +70 -9
- data/lib/one_helper/onemarket_helper.rb +1 -1
- data/lib/one_helper/onemarketapp_helper.rb +1 -1
- data/lib/one_helper/onequota_helper.rb +1 -1
- data/lib/one_helper/onesecgroup_helper.rb +1 -1
- data/lib/one_helper/onetemplate_helper.rb +1 -1
- data/lib/one_helper/oneuser_helper.rb +1 -1
- data/lib/one_helper/onevcenter_helper.rb +1 -1
- data/lib/one_helper/onevdc_helper.rb +1 -1
- data/lib/one_helper/onevm_helper.rb +67 -51
- data/lib/one_helper/onevmgroup_helper.rb +1 -1
- data/lib/one_helper/onevnet_helper.rb +36 -2
- data/lib/one_helper/onevntemplate_helper.rb +1 -1
- data/lib/one_helper/onevrouter_helper.rb +1 -1
- data/lib/one_helper/onezone_helper.rb +1 -1
- data/lib/one_helper.rb +3 -3
- data/share/schemas/xsd/acct.xsd +28 -0
- data/share/schemas/xsd/hook_message_state.xsd +5 -1
- data/share/schemas/xsd/host.xsd +3 -23
- data/share/schemas/xsd/image.xsd +18 -0
- data/share/schemas/xsd/opennebula_configuration.xsd +2 -0
- data/share/schemas/xsd/vm.xsd +30 -0
- data/share/schemas/xsd/vnet.xsd +28 -0
- data/share/schemas/xsd/vnet_pool.xsd +28 -0
- metadata +6 -6
data/bin/onevm
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
5
|
# #
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
|
@@ -195,32 +195,6 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
195
195
|
:description => 'lock all actions'
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
LOGGER = {
|
|
199
|
-
:name => 'logger',
|
|
200
|
-
:large => '--logger logger',
|
|
201
|
-
:format => String,
|
|
202
|
-
:description => 'Set logger to STDOUT or FILE'
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
KEEP = {
|
|
206
|
-
:name => 'keep',
|
|
207
|
-
:large => '--keep-backup',
|
|
208
|
-
:description => 'Keep previous backup when creating a new one'
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
ONESHOT = {
|
|
212
|
-
:name => 'oneshot',
|
|
213
|
-
:large => '--oneshot',
|
|
214
|
-
:description => 'Take an snapshot of the VM without saving backup info'
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
MARKET = {
|
|
218
|
-
:name => 'market',
|
|
219
|
-
:large => '--market market_id',
|
|
220
|
-
:format => Integer,
|
|
221
|
-
:description => 'Market to save oneshot'
|
|
222
|
-
}
|
|
223
|
-
|
|
224
198
|
NIC_ID = {
|
|
225
199
|
:name => 'nic_id',
|
|
226
200
|
:large => '--nic-id nic_id',
|
|
@@ -249,6 +223,40 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
249
223
|
:description => 'VNC client to use'
|
|
250
224
|
}
|
|
251
225
|
|
|
226
|
+
PCI = {
|
|
227
|
+
:name => 'pci',
|
|
228
|
+
:large => '--pci short_address',
|
|
229
|
+
:format => String,
|
|
230
|
+
:description => 'Select PCI device by its short address'
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
PCI_DEVICE = {
|
|
234
|
+
:name => 'pci_device',
|
|
235
|
+
:large => '--pci_device device ID',
|
|
236
|
+
:format => String,
|
|
237
|
+
:description => 'Select PCI device by its device ID'
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
PCI_VENDOR = {
|
|
241
|
+
:name => 'pci_vendor',
|
|
242
|
+
:large => '--pci_vendor vendor ID',
|
|
243
|
+
:format => String,
|
|
244
|
+
:description => 'Select PCI device by its vendor ID'
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
PCI_CLASS = {
|
|
248
|
+
:name => 'pci_class',
|
|
249
|
+
:large => '--pci_class class ID',
|
|
250
|
+
:format => String,
|
|
251
|
+
:description => 'Select PCI device by its class ID'
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
RESET_BACKUP = {
|
|
255
|
+
:name => 'reset',
|
|
256
|
+
:large => '--reset',
|
|
257
|
+
:description => 'Creates a new backup image, from a new full backup (only for incremental)'
|
|
258
|
+
}
|
|
259
|
+
|
|
252
260
|
OpenNebulaHelper::TEMPLATE_OPTIONS_VM.delete_if do |v|
|
|
253
261
|
%w[as_gid as_uid].include?(v[:name])
|
|
254
262
|
end
|
|
@@ -853,8 +861,11 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
853
861
|
end
|
|
854
862
|
|
|
855
863
|
nic_attach_desc = <<-EOT.unindent
|
|
856
|
-
Attaches a NIC to a
|
|
857
|
-
|
|
864
|
+
Attaches a NIC to a VM. When using --file add only one NIC instance.
|
|
865
|
+
|
|
866
|
+
To hotplug a PCI device and use it as a NIC interface in the VM select
|
|
867
|
+
it with --pci (short_address) or --pci_device (device ID),
|
|
868
|
+
--pci_class (class ID) and/or --pci_vendor (vendor ID).
|
|
858
869
|
|
|
859
870
|
To attach a nic alias, use --file or --alias option.
|
|
860
871
|
|
|
@@ -866,7 +877,11 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
866
877
|
OneVMHelper::NETWORK,
|
|
867
878
|
OneVMHelper::IP,
|
|
868
879
|
OneVMHelper::ALIAS,
|
|
869
|
-
OneVMHelper::NIC_NAME
|
|
880
|
+
OneVMHelper::NIC_NAME,
|
|
881
|
+
PCI,
|
|
882
|
+
PCI_CLASS,
|
|
883
|
+
PCI_VENDOR,
|
|
884
|
+
PCI_DEVICE] do
|
|
870
885
|
if options[:file].nil? && options[:network].nil?
|
|
871
886
|
STDERR.puts 'Provide a template file or a network:'
|
|
872
887
|
STDERR.puts "\t--file <file>"
|
|
@@ -878,36 +893,36 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
878
893
|
template = File.read(options[:file])
|
|
879
894
|
else
|
|
880
895
|
network_id = options[:network]
|
|
881
|
-
ip
|
|
882
|
-
nic_alias
|
|
883
|
-
nic_name
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
896
|
+
ip = options[:ip]
|
|
897
|
+
nic_alias = options[:alias]
|
|
898
|
+
nic_name = options[:nic_name]
|
|
899
|
+
|
|
900
|
+
is_pci = [:pci, :pci_device, :pci_vendor, :pci_class].any? do |o|
|
|
901
|
+
!options[o].nil?
|
|
902
|
+
end
|
|
903
|
+
|
|
904
|
+
if is_pci
|
|
905
|
+
pcia = options[:pci]
|
|
906
|
+
pcid = options[:pci_device]
|
|
907
|
+
pcic = options[:pci_class]
|
|
908
|
+
pciv = options[:pci_vendor]
|
|
909
|
+
|
|
910
|
+
template = 'PCI = [ TYPE = NIC'
|
|
911
|
+
template << ", NETWORK_ID = #{network_id}"
|
|
912
|
+
template << ", SHORT_ADDRESS = \"#{pcia}\"" if pcia
|
|
913
|
+
template << ", DEVICE = \"#{pcid}\"" if pcid
|
|
914
|
+
template << ", CLASS = \"#{pcic}\"" if pcic
|
|
915
|
+
template << ", VENDOR = \"#{pciv}\"" if pciv
|
|
916
|
+
elsif nic_alias
|
|
917
|
+
template = "NIC_ALIAS = [ PARENT = #{nic_alias}"
|
|
918
|
+
template << ", NETWORK_ID = #{network_id}"
|
|
899
919
|
else
|
|
900
|
-
|
|
901
|
-
template = "NIC = [ NETWORK_ID = #{network_id} ]"
|
|
902
|
-
elsif !nic_alias && nic_name
|
|
903
|
-
template = "NIC = [ NETWORK_ID = #{network_id},
|
|
904
|
-
NAME = #{nic_name} ]"
|
|
905
|
-
else
|
|
906
|
-
template = "NIC_ALIAS = \
|
|
907
|
-
[ NETWORK_ID = #{network_id},\
|
|
908
|
-
PARENT = #{nic_alias} ]"
|
|
909
|
-
end
|
|
920
|
+
template = "NIC = [ NETWORK_ID = #{network_id}"
|
|
910
921
|
end
|
|
922
|
+
|
|
923
|
+
template << ", IP = #{ip}" if ip
|
|
924
|
+
template << ", NAME = #{nic_name}" if nic_name
|
|
925
|
+
template << ']'
|
|
911
926
|
end
|
|
912
927
|
|
|
913
928
|
helper.perform_action(args[0], options, 'Attaching NIC') do |vm|
|
|
@@ -929,6 +944,40 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
929
944
|
end
|
|
930
945
|
end
|
|
931
946
|
|
|
947
|
+
nic_update_desc = <<-EOT.unindent
|
|
948
|
+
Updates a NIC for a VM. In case the VM is running, trigger NIC update on the host.
|
|
949
|
+
|
|
950
|
+
States: Almost all, except BOOT*, MIGRATE and HOTPLUG-NIC
|
|
951
|
+
EOT
|
|
952
|
+
|
|
953
|
+
command :"nic-update", nic_update_desc, :vmid, :nicid,
|
|
954
|
+
[:file, nil], :options => OpenNebulaHelper::APPEND do
|
|
955
|
+
vm_id = args[0].to_i
|
|
956
|
+
nic_id = args[1].to_i
|
|
957
|
+
file = args[2]
|
|
958
|
+
helper.perform_action(vm_id, options, 'Updating VM NIC') do |obj|
|
|
959
|
+
if options[:append]
|
|
960
|
+
str = OpenNebulaHelper
|
|
961
|
+
.append_template(vm_id, obj, file,
|
|
962
|
+
"TEMPLATE/NIC[NIC_ID=#{nic_id}]")
|
|
963
|
+
else
|
|
964
|
+
str = OpenNebulaHelper
|
|
965
|
+
.update_template(vm_id, obj, file,
|
|
966
|
+
"TEMPLATE/NIC[NIC_ID=#{nic_id}]")
|
|
967
|
+
end
|
|
968
|
+
|
|
969
|
+
# Ensure the updated attributes are in NIC section
|
|
970
|
+
unless str.gsub(' ', '').match(/NIC=\[/)
|
|
971
|
+
str = "NIC=[\n#{str.split("\n").join(",\n")}]"
|
|
972
|
+
end
|
|
973
|
+
|
|
974
|
+
helper.set_client(options)
|
|
975
|
+
obj = helper.retrieve_resource(obj.id)
|
|
976
|
+
|
|
977
|
+
obj.nic_update(nic_id, str, options[:append])
|
|
978
|
+
end
|
|
979
|
+
end
|
|
980
|
+
|
|
932
981
|
sg_attach_desc = <<-EOT.unindent
|
|
933
982
|
Attaches a Security Group to a VM.
|
|
934
983
|
|
|
@@ -1340,8 +1389,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
1340
1389
|
updateconf_desc = <<-EOT.unindent
|
|
1341
1390
|
Updates the configuration of a VM. Valid states are: running, pending,
|
|
1342
1391
|
failure, poweroff, undeploy, hold or cloning.
|
|
1343
|
-
In running state only changes in CONTEXT take effect
|
|
1344
|
-
other values may need a VM restart.
|
|
1392
|
+
In running state only changes in CONTEXT and BACKUP_CONFIG take effect
|
|
1393
|
+
immediately, other values may need a VM restart.
|
|
1345
1394
|
|
|
1346
1395
|
This command accepts a template file or opens an editor, the full list of
|
|
1347
1396
|
configuration attributes are:
|
|
@@ -1352,6 +1401,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
1352
1401
|
GRAPHICS = ["TYPE", "LISTEN", "PASSWD", "KEYMAP" ]
|
|
1353
1402
|
RAW = ["DATA", "DATA_VMX", "TYPE", "VALIDATE"]
|
|
1354
1403
|
CPU_MODEL = ["MODEL"]
|
|
1404
|
+
BACKUP_CONFIG = ["FS_FREEZE", "KEEP_LAST", "BACKUP_VOLATILE", "MODE"]
|
|
1355
1405
|
CONTEXT (any value, **variable substitution will be made**)
|
|
1356
1406
|
EOT
|
|
1357
1407
|
|
|
@@ -1376,10 +1426,15 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
1376
1426
|
exit(-1)
|
|
1377
1427
|
end
|
|
1378
1428
|
|
|
1429
|
+
backup = vm.template_like_str('BACKUPS', true,
|
|
1430
|
+
'BACKUP_CONFIG')
|
|
1379
1431
|
template = vm.template_like_str('TEMPLATE', true,
|
|
1380
1432
|
'OS | FEATURES | INPUT | '\
|
|
1381
1433
|
'GRAPHICS | RAW | CONTEXT | '\
|
|
1382
1434
|
'CPU_MODEL')
|
|
1435
|
+
|
|
1436
|
+
template << "\n" << backup
|
|
1437
|
+
|
|
1383
1438
|
template = OpenNebulaHelper.editor_input(template)
|
|
1384
1439
|
end
|
|
1385
1440
|
|
|
@@ -1497,108 +1552,43 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
1497
1552
|
end
|
|
1498
1553
|
|
|
1499
1554
|
backup_vm_desc = <<-EOT.unindent
|
|
1500
|
-
Creates a VM backup
|
|
1555
|
+
Creates a VM backup on the given datastore
|
|
1556
|
+
|
|
1557
|
+
States: RUNNING, POWEROFF
|
|
1501
1558
|
EOT
|
|
1502
1559
|
|
|
1503
1560
|
command :backup,
|
|
1504
1561
|
backup_vm_desc,
|
|
1505
1562
|
:vmid,
|
|
1506
|
-
:options => [
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
# Read user options
|
|
1518
|
-
if options[:verbose]
|
|
1519
|
-
log_to = STDOUT
|
|
1520
|
-
elsif !options[:logger].nil?
|
|
1521
|
-
log_to = options[:logger]
|
|
1522
|
-
end
|
|
1523
|
-
|
|
1524
|
-
keep = options.key?(:keep)
|
|
1525
|
-
|
|
1526
|
-
if log_to
|
|
1527
|
-
logger = Logger.new(log_to)
|
|
1528
|
-
format = '%Y-%m-%d %H:%M:%S'
|
|
1529
|
-
|
|
1530
|
-
logger.formatter = proc do |severity, datetime, _p, msg|
|
|
1531
|
-
"#{datetime.strftime(format)} " \
|
|
1532
|
-
"#{severity.ljust(5)} : #{msg}\n"
|
|
1533
|
-
end
|
|
1534
|
-
end
|
|
1535
|
-
|
|
1536
|
-
binfo = {}
|
|
1537
|
-
binfo[:market] = options[:market]
|
|
1538
|
-
|
|
1539
|
-
if options.key?(:oneshot)
|
|
1540
|
-
binfo[:name] = "VM #{vm.id} BACKUP - " \
|
|
1541
|
-
"#{Time.now.strftime('%Y%m%d_%k%M')}"
|
|
1542
|
-
binfo[:freq] = 1
|
|
1543
|
-
binfo[:last] = Time.now.to_i - 100
|
|
1544
|
-
end
|
|
1545
|
-
|
|
1546
|
-
begin
|
|
1547
|
-
rc = vm.backup(keep, logger, binfo)
|
|
1548
|
-
|
|
1549
|
-
if OpenNebula.is_error?(rc)
|
|
1550
|
-
STDERR.puts rc.message
|
|
1551
|
-
exit(-1)
|
|
1552
|
-
else
|
|
1553
|
-
0
|
|
1554
|
-
end
|
|
1555
|
-
rescue StandardError => e
|
|
1556
|
-
STDERR.puts e
|
|
1557
|
-
exit(-1)
|
|
1558
|
-
end
|
|
1559
|
-
end
|
|
1560
|
-
end
|
|
1561
|
-
|
|
1562
|
-
restore_vm_desc = <<-EOT.unindent
|
|
1563
|
-
Restores a VM from a previous backup
|
|
1564
|
-
EOT
|
|
1565
|
-
|
|
1566
|
-
command :restore,
|
|
1567
|
-
restore_vm_desc,
|
|
1568
|
-
:vmid,
|
|
1569
|
-
:options => [OneDatastoreHelper::DATASTORE, LOGGER] do
|
|
1570
|
-
require 'logger'
|
|
1571
|
-
|
|
1572
|
-
unless options[:datastore]
|
|
1573
|
-
STDERR.puts 'ERROR: no datastore given'
|
|
1563
|
+
:options => [RESET_BACKUP,
|
|
1564
|
+
OneDatastoreHelper::DATASTORE,
|
|
1565
|
+
OneVMHelper::SCHEDULE,
|
|
1566
|
+
OneVMHelper::WEEKLY,
|
|
1567
|
+
OneVMHelper::MONTHLY,
|
|
1568
|
+
OneVMHelper::YEARLY,
|
|
1569
|
+
OneVMHelper::HOURLY,
|
|
1570
|
+
OneVMHelper::END_TIME] do
|
|
1571
|
+
if options[:datastore].nil?
|
|
1572
|
+
STDERR.puts 'Datastore to save the backup is mandatory: '
|
|
1573
|
+
STDERR.puts "\t -d datastore_id | name"
|
|
1574
1574
|
exit(-1)
|
|
1575
1575
|
end
|
|
1576
1576
|
|
|
1577
|
-
|
|
1578
|
-
vm.extend(OpenNebula::VirtualMachineExt)
|
|
1577
|
+
reset = options[:reset] == true
|
|
1579
1578
|
|
|
1580
|
-
|
|
1581
|
-
options[:
|
|
1582
|
-
logger = Logger.new(log_to)
|
|
1583
|
-
format = '%Y-%m-%d %H:%M:%S'
|
|
1579
|
+
if !options[:schedule].nil?
|
|
1580
|
+
options[:args] = options[:datastore]
|
|
1584
1581
|
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
end
|
|
1582
|
+
helper.schedule_actions([args[0]], options, @comm_name)
|
|
1583
|
+
else
|
|
1588
1584
|
|
|
1589
|
-
|
|
1590
|
-
rc = vm.
|
|
1585
|
+
helper.perform_action(args[0], options, 'Backup') do |vm|
|
|
1586
|
+
rc = vm.backup(options[:datastore], reset)
|
|
1591
1587
|
|
|
1592
1588
|
if OpenNebula.is_error?(rc)
|
|
1593
|
-
STDERR.puts rc.message
|
|
1589
|
+
STDERR.puts "Error creating VM backup: #{rc.message}"
|
|
1594
1590
|
exit(-1)
|
|
1595
|
-
else
|
|
1596
|
-
puts "ID: #{rc}"
|
|
1597
|
-
0
|
|
1598
1591
|
end
|
|
1599
|
-
rescue StandardError => e
|
|
1600
|
-
STDERR.puts e
|
|
1601
|
-
exit(-1)
|
|
1602
1592
|
end
|
|
1603
1593
|
end
|
|
1604
1594
|
end
|
data/bin/onevmgroup
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
5
|
# #
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
data/bin/onevnet
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
5
|
# #
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
|
@@ -114,6 +114,13 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
114
114
|
:description => 'No recover action possible, delete the Virtual Network'
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
RETRY = {
|
|
118
|
+
:name => 'retry',
|
|
119
|
+
:large => '--retry',
|
|
120
|
+
:description => 'Recover a Virtual Network by retrying the last ' \
|
|
121
|
+
'failed action'
|
|
122
|
+
}
|
|
123
|
+
|
|
117
124
|
########################################################################
|
|
118
125
|
# Global Options
|
|
119
126
|
########################################################################
|
|
@@ -363,6 +370,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
363
370
|
update_desc = <<-EOT.unindent
|
|
364
371
|
Update the template contents. If a path is not provided the editor will
|
|
365
372
|
be launched to modify the current content.
|
|
373
|
+
|
|
374
|
+
Note: Triggers Virtual Machine updates for used leases.
|
|
366
375
|
EOT
|
|
367
376
|
|
|
368
377
|
command :update, update_desc, :vnetid, [:file, nil],
|
|
@@ -456,19 +465,22 @@ CommandParser::CmdParser.new(ARGV) do
|
|
|
456
465
|
YOU NEED TO MANUALLY CHECK THE VN STATUS, to decide if the
|
|
457
466
|
operation was successful or not, or if it can be retried.
|
|
458
467
|
|
|
459
|
-
States for success
|
|
460
|
-
States for
|
|
468
|
+
States for success recovers: LOCK_CREATE, LOCK_DELETE, UPDATE_FAILURE state.
|
|
469
|
+
States for failure recovers: LOCK_CREATE, LOCK_DELETE state.
|
|
470
|
+
States for a retry recover: UPDATE_FAILURE
|
|
461
471
|
States for delete: Any but READY
|
|
462
472
|
EOT
|
|
463
473
|
|
|
464
474
|
command :recover, recover_desc, [:range, :vmid_list],
|
|
465
|
-
:options => [SUCCESS, FAILURE, DELETE] do
|
|
475
|
+
:options => [SUCCESS, FAILURE, DELETE, RETRY] do
|
|
466
476
|
if !options[:success].nil?
|
|
467
477
|
result = 1
|
|
468
478
|
elsif !options[:failure].nil?
|
|
469
479
|
result = 0
|
|
470
480
|
elsif !options[:delete].nil?
|
|
471
481
|
result = 2
|
|
482
|
+
elsif !options[:retry].nil?
|
|
483
|
+
result = 3
|
|
472
484
|
else
|
|
473
485
|
error_message = <<-EOT.unindent
|
|
474
486
|
Need to specify the result of the pending action.
|
data/bin/onevntemplate
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
5
|
# #
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
data/bin/onevrouter
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
5
|
# #
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
data/bin/onezone
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
|
|
3
3
|
# -------------------------------------------------------------------------- #
|
|
4
|
-
# Copyright 2002-
|
|
4
|
+
# Copyright 2002-2022, OpenNebula Project, OpenNebula Systems #
|
|
5
5
|
# #
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
|
7
7
|
# not use this file except in compliance with the License. You may obtain #
|
data/lib/cli_helper.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|
data/lib/command_parser.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# -------------------------------------------------------------------------- #
|
|
2
|
-
# Copyright 2002-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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-
|
|
2
|
+
# Copyright 2002-2022, 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 #
|