Revision ddb8fc19
share/etc/oned.conf | ||
---|---|---|
423 | 423 |
# This hook is used to perform recovery actions when a host fails. |
424 | 424 |
# Script to implement host failure tolerance |
425 | 425 |
# It can be set to |
426 |
# -r resubmit VMs running in the host
|
|
426 |
# -r recreate VMs running in the host
|
|
427 | 427 |
# -d delete VMs running in the host |
428 | 428 |
# Additional flags |
429 | 429 |
# -f force resubmission of suspended VMs |
... | ... | |
449 | 449 |
#VM_HOOK = [ |
450 | 450 |
# name = "on_failure_delete", |
451 | 451 |
# on = "FAILED", |
452 |
# command = "/usr/bin/env onevm delete",
|
|
452 |
# command = "/usr/bin/env onevm destroy",
|
|
453 | 453 |
# arguments = "$ID" ] |
454 | 454 |
# |
455 | 455 |
#VM_HOOK = [ |
456 |
# name = "on_failure_resubmit",
|
|
456 |
# name = "on_failure_recreate",
|
|
457 | 457 |
# on = "FAILED", |
458 |
# command = "/usr/bin/env onevm resubmit",
|
|
458 |
# command = "/usr/bin/env onevm destroy --recreate",
|
|
459 | 459 |
# arguments = "$ID" ] |
460 | 460 |
#------------------------------------------------------------------------------- |
461 | 461 |
|
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 |
src/cli/onevm | ||
---|---|---|
268 | 268 |
Sets the specified VM disk to be saved in a new Image. The Image is |
269 | 269 |
created immediately, but the contents are saved only if the VM is |
270 | 270 |
shut down gracefully (i.e., using 'onevm shutdown' and not |
271 |
'onevm delete')
|
|
271 |
'onevm destroy')
|
|
272 | 272 |
|
273 | 273 |
If '--live' is specified, the Image will be saved immediately. |
274 | 274 |
|
... | ... | |
321 | 321 |
|
322 | 322 |
poweroff_desc = <<-EOT.unindent |
323 | 323 |
Powers off the given VM. The VM will remain in the poweroff state, and |
324 |
can be powered on with the 'onevm restart' command.
|
|
324 |
can be powered on with the 'onevm boot' command.
|
|
325 | 325 |
|
326 | 326 |
States: RUNNING |
327 | 327 |
EOT |
Also available in: Unified diff