opennebula-cli 4.0.0 → 4.0.1

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 (2) hide show
  1. data/bin/onevm +44 -1
  2. metadata +7 -7
data/bin/onevm CHANGED
@@ -79,6 +79,18 @@ cmd=CommandParser::CmdParser.new(ARGV) do
79
79
  :description => "Enforce that the host capacity is not exceeded"
80
80
  }
81
81
 
82
+ SUCCESS={
83
+ :name => "success",
84
+ :large => "--success",
85
+ :description => "Recover a VM by succeeding the pending action"
86
+ }
87
+
88
+ FAILURE={
89
+ :name => "failure",
90
+ :large => "--failure",
91
+ :description => "Recover a VM by failing the pending action"
92
+ }
93
+
82
94
  ########################################################################
83
95
  # Global Options
84
96
  ########################################################################
@@ -501,6 +513,37 @@ cmd=CommandParser::CmdParser.new(ARGV) do
501
513
  end
502
514
  end
503
515
 
516
+ recover_desc = <<-EOT.unindent
517
+ Recovers a stuck VM that is waiting for a driver operation. The recovery
518
+ may be done by failing or succeeding the pending operation. YOU NEED
519
+ TO MANUALLY CHECK THE VM STATUS ON THE HOST, to decide if the operation
520
+ was successful or not.
521
+
522
+ Example: A VM is stuck in "migrate" because of a hardware failure. You
523
+ need to check if the VM is running in the new host or not to recover
524
+ the vm with --success or --failure, respectively.
525
+
526
+ States: Any ACTIVE state.
527
+ EOT
528
+
529
+ command :recover, recover_desc, [:range,:vmid_list],
530
+ :options => [SUCCESS, FAILURE] do
531
+ if !options[:success].nil?
532
+ result = true
533
+ elsif !options[:failure].nil?
534
+ result = false
535
+ else
536
+ STDERR.puts "Need to specify the result of the pending action."
537
+ STDERR.puts "\t--success recover the VM by succeeding the missing action."
538
+ STDERR.puts "\t--failure recover the VM by failing the missing action."
539
+ exit -1
540
+ end
541
+
542
+ helper.perform_actions(args[0], options, "recovering") do |vm|
543
+ vm.recover(result)
544
+ end
545
+ end
546
+
504
547
  disk_attach_desc = <<-EOT.unindent
505
548
  Attaches a disk to a running VM
506
549
 
@@ -783,5 +826,5 @@ cmd=CommandParser::CmdParser.new(ARGV) do
783
826
  deprecated_command(:cancel, 'shutdown --hard')
784
827
  deprecated_command(:reset, 'reboot --hard')
785
828
  deprecated_command(:restart, 'boot')
786
- deprecated_command(:resubmit, 'destroy --recreate')
829
+ deprecated_command(:resubmit, 'delete --recreate')
787
830
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opennebula-cli
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
8
  - 0
9
- - 0
10
- version: 4.0.0
9
+ - 1
10
+ version: 4.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - OpenNebula
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-05-07 00:00:00 Z
18
+ date: 2013-05-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: opennebula
@@ -25,12 +25,12 @@ dependencies:
25
25
  requirements:
26
26
  - - "="
27
27
  - !ruby/object:Gem::Version
28
- hash: 63
28
+ hash: 61
29
29
  segments:
30
30
  - 4
31
31
  - 0
32
- - 0
33
- version: 4.0.0
32
+ - 1
33
+ version: 4.0.1
34
34
  type: :runtime
35
35
  version_requirements: *id001
36
36
  description: Commands used to talk to OpenNebula