Added a check for non-empty list of VMs to migrate in the global manager

This commit is contained in:
Anton Beloglazov 2015-04-20 21:55:16 +10:00
parent fd889d1e7f
commit caf8c4dc68

View File

@ -383,6 +383,10 @@ def execute_underload(config, state, host):
if not vm in vms_ram:
del vms_to_migrate[i]
if not vms_to_migrate:
log.info('No VMs to migrate - completed the underload request')
return state
for vm in vms_cpu.keys():
if not vm in vms_ram:
del vms_cpu[vm]
@ -545,6 +549,10 @@ def execute_overload(config, state, host, vm_uuids):
if not vm in vms_ram:
del vms_to_migrate[i]
if not vms_to_migrate:
log.info('No VMs to migrate - completed the overload request')
return state
for vm in vms_cpu.keys():
if not vm in vms_ram:
del vms_cpu[vm]