Browse Source

MP2P migration: no retry & long wait for rollbacks

Change-Id: I23d9c92492193dee35371124cf1fc4250426b90a
changes/78/764678/1
asarfaty 10 months ago
committed by Adit Sarfaty
parent
commit
4dcbab843d
  1. 9
      vmware_nsx/shell/admin/plugins/nsxv3/resources/migration.py

9
vmware_nsx/shell/admin/plugins/nsxv3/resources/migration.py

@ -113,9 +113,12 @@ def send_migration_request(nsxlib, body):
return nsxlib.client.url_post("migration/mp-to-policy", body)
def send_rollback_request(nsxlib, body):
def send_rollback_request(body):
#TODO(asarfaty): Rollback can take very long, especially for firewall
# sections. In this case backup-restore might be better
# Using a new nsxlib instance to avoid retries, and add a long timeout
nsxlib = _get_nsxlib_from_config(verbose=True, for_end_api=True)
return nsxlib.client.url_post("migration/mp-to-policy/rollback", body)
@ -1273,8 +1276,8 @@ def migrate_t_resources_2_p(nsxlib, nsxpolicy, plugin):
global ROLLBACK_DATA
if ROLLBACK_DATA:
LOG.info("Rolling migration back %s", ROLLBACK_DATA)
send_rollback_request(nsxlib,
{'migration_data': ROLLBACK_DATA})
send_rollback_request({'migration_data': ROLLBACK_DATA})
LOG.info("Roll back done.")
# Finalize the migration (Also needed after rollback)
end_migration_process()
# Stop the migration service

Loading…
Cancel
Save