Revision ddb8fc19 share/hooks/host_error.rb

View differences:

share/hooks/host_error.rb
19 19
####################################################
20 20
# Script to implement host failure tolerance
21 21
#   It can be set to
22
#           -r resubmit VMs running in the host
22
#           -r recreate VMs running in the host
23 23
#           -d delete VMs running in the host
24 24
#   Additional flags
25 25
#           -f force resubmission of suspended VMs
......
50 50
    exit -1
51 51
end
52 52

  
53
mode   = "-r" # By default, resubmit VMs
54
force  = "n"  # By default, don't resubmit/finalize suspended VMs
53
mode   = "-r" # By default, recreate VMs
54
force  = "n"  # By default, don't recreate/destroy suspended VMs
55 55
repeat = nil  # By default, don't wait fo monitorization cycles"
56 56

  
57 57
opts = GetoptLong.new(
58 58
            ['--delete',   '-d',GetoptLong::NO_ARGUMENT],
59
            ['--resubmit', '-r',GetoptLong::NO_ARGUMENT],
59
            ['--recreate', '-r',GetoptLong::NO_ARGUMENT],
60 60
            ['--force',    '-f',GetoptLong::NO_ARGUMENT],
61 61
            ['--pause',    '-p',GetoptLong::REQUIRED_ARGUMENT]
62 62
        )
......
66 66
        case opt
67 67
            when '--delete'
68 68
                mode="-d"
69
            when '--resubmit'
69
            when '--recreate'
70 70
                mode="-r"
71 71
            when '--force'
72 72
                force  = "y"
......
121 121
        vm.info
122 122

  
123 123
        if mode == "-r"
124
            vm.resubmit
124
            vm.destroy(true)
125 125
        elsif mode == "-d"
126
            vm.finalize
126
            vm.destroy
127 127
        end
128 128
    end
129 129
end

Also available in: Unified diff