MP2P: Reduce max polling time for migrator to 2 secs
Also enable exponential backoff with intervals starting at 0.1 seconds. Change-Id: I8f2358a4c8334f5df4b5cd29396a7ca77305a6d5
This commit is contained in:
parent
9059e7e4a0
commit
6184264d39
|
@ -214,6 +214,8 @@ def verify_component_status(nsxlib, component_number):
|
||||||
|
|
||||||
|
|
||||||
def wait_for_component_success(nsxlib, component_number):
|
def wait_for_component_success(nsxlib, component_number):
|
||||||
|
delay = 0.1
|
||||||
|
max_delay = 2.0
|
||||||
while True:
|
while True:
|
||||||
status = get_migration_status(nsxlib)
|
status = get_migration_status(nsxlib)
|
||||||
try:
|
try:
|
||||||
|
@ -224,19 +226,25 @@ def wait_for_component_success(nsxlib, component_number):
|
||||||
component_number, status)
|
component_number, status)
|
||||||
if component_status == POLICY_API_STATUS_SUCCESS:
|
if component_status == POLICY_API_STATUS_SUCCESS:
|
||||||
return
|
return
|
||||||
LOG.debug("Component #%d status is %s. Waiting 5 seconds",
|
LOG.debug("Component #%d status is %s. Waiting 1 second",
|
||||||
component_number, component_status)
|
component_number, component_status)
|
||||||
time.sleep(5)
|
time.sleep(delay)
|
||||||
|
delay = min(delay * 2, max_delay)
|
||||||
|
|
||||||
|
|
||||||
def wait_on_overall_migration_status_to_pause(nsxlib):
|
def wait_on_overall_migration_status_to_pause(nsxlib):
|
||||||
|
delay = 0.1
|
||||||
|
max_delay = 2.0
|
||||||
while True:
|
while True:
|
||||||
status = get_migration_status(nsxlib)
|
status = get_migration_status(nsxlib)
|
||||||
migration_status = status.get('overall_migration_status')
|
migration_status = status.get('overall_migration_status')
|
||||||
if (migration_status == POLICY_API_STATUS_PAUSED or
|
if (migration_status == POLICY_API_STATUS_PAUSED or
|
||||||
migration_status == POLICY_API_STATUS_SUCCESS):
|
migration_status == POLICY_API_STATUS_SUCCESS):
|
||||||
break
|
break
|
||||||
time.sleep(5)
|
LOG.debug("Overall migration status is %s. Waiting 1 second.",
|
||||||
|
migration_status)
|
||||||
|
time.sleep(delay)
|
||||||
|
delay = min(delay * 2, max_delay)
|
||||||
|
|
||||||
|
|
||||||
def printable_resource_name(resource):
|
def printable_resource_name(resource):
|
||||||
|
|
Loading…
Reference in New Issue