326 |
326 |
action('unresched')
|
327 |
327 |
end
|
328 |
328 |
|
329 |
|
# Saves a running VM and starts it again in the specified host
|
|
329 |
# Moves a running VM to the specified host. With live=true the
|
|
330 |
# migration is done withdout downtime.
|
330 |
331 |
#
|
331 |
332 |
# @param host_id [Interger] The host id (hid) of the target host where
|
332 |
333 |
# the VM will be migrated.
|
|
334 |
# @param live [true|false] If true the migration is done without
|
|
335 |
# downtime. Defaults to false
|
333 |
336 |
# @param enforce [true|false] If it is set to true, the host capacity
|
334 |
337 |
# will be checked, and the deployment will fail if the host is
|
335 |
338 |
# overcommited. Defaults to false
|
336 |
339 |
#
|
337 |
340 |
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
338 |
341 |
# otherwise
|
339 |
|
def migrate(host_id, enforce=false)
|
340 |
|
return call(VM_METHODS[:migrate], @pe_id, host_id.to_i, false, enforce)
|
|
342 |
def migrate(host_id, live=false, enforce=false)
|
|
343 |
call(VM_METHODS[:migrate], @pe_id, host_id.to_i, live==true,
|
|
344 |
enforce)
|
341 |
345 |
end
|
342 |
346 |
|
343 |
|
# Migrates a running VM to another host without downtime
|
344 |
|
#
|
345 |
|
# @param host_id [Interger] The host id (hid) of the target host where
|
346 |
|
# the VM will be migrated.
|
347 |
|
# @param enforce [true|false] If it is set to true, the host capacity
|
348 |
|
# will be checked, and the deployment will fail if the host is
|
349 |
|
# overcommited. Defaults to false
|
350 |
|
#
|
351 |
|
# @return [nil, OpenNebula::Error] nil in case of success, Error
|
352 |
|
# otherwise
|
|
347 |
# @deprecated use {#migrate} instead
|
353 |
348 |
def live_migrate(host_id, enforce=false)
|
354 |
|
return call(VM_METHODS[:migrate], @pe_id, host_id.to_i, true, enforce)
|
|
349 |
migrate(host_id, true, enforce)
|
355 |
350 |
end
|
356 |
351 |
|
357 |
352 |
# Set the specified vm's disk to be saved in a new image
|