Added VM migration using the nova API in case of an underload

This commit is contained in:
Anton Beloglazov 2012-10-05 16:58:07 +10:00
parent f88cc129cb
commit 717512f5ad

View File

@ -337,6 +337,9 @@ def execute_underload(config, state, host):
if log.isEnabledFor(logging.INFO):
log.info('Underload: obtained a new placement %s', str(placement))
for vm, host in placement.items():
state['nova'].servers.live_migrate(vm, host, False, False)
log.info('Started migration of VM %s to %s', vm, host)
# TODO: initiate VM migrations according to the obtained placement
# Switch of the underloaded host when the migrations are completed