Skip to content

migration: Update tcp connections #6406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
action_during_do_mig = '[{"func": "libvirt_network.setup_firewall_rule", "func_param": "params", "need_sleep_time": "10"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "90"}]'
action_during_do_mig = '[{"func": "libvirt_network.setup_firewall_rule", "func_param": "params", "need_sleep_time": "10"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "10"}]'
status_error_during_mig = "no"
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
- pause_by_proxy_issue:
action_during_do_mig = '[{"func": "clear_pmsocat", "func_param": "params", "need_sleep_time": "5"}, {"func": "base_steps.recreate_conn_objs", "func_param": "params", "need_sleep_time": "10"}]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "90"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "5"}, {"func": "resume_migration_again", "func_param": "params", "need_sleep_time": "5"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "15"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "5"}, {"func": "resume_migration_again", "func_param": "params", "need_sleep_time": "5"}]'
migrate_desturi_port = "16509"
migrate_desturi_type = "tcp"
virsh_migrate_desturi = "qemu+tcp://${migrate_dest_host}/system"
err_msg_during_mig = "unable to connect to server at.*: Connection timed out"
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
- proxy_issue:
transport_type = "unix_proxy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@
expected_event_src = ["event 'lifecycle' for domain .*: Suspended Post-copy"]
expected_event_src_2 = ["event 'lifecycle' for domain .*: Stopped Migrated", "event 'job-completed' for domain"]
expected_event_target = ["event 'lifecycle' for domain.*: Resumed Post-copy", "event 'lifecycle' for domain.*: Resumed Migrated"]
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "check_event_before_unattended", "func_param": "params"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params"}, {"func": "do_common_check", "func_param": "params", "need_sleep_time": "90"}, {"func": "wait_for_unattended_mig", "func_param": "params"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "check_event_before_unattended", "func_param": "params"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params"}, {"func": "do_common_check", "func_param": "params", "need_sleep_time": "15"}, {"func": "wait_for_unattended_mig", "func_param": "params"}]'
variants migration_options:
- with_undefinesource_persistent:
virsh_migrate_extra = "--undefinesource --persistent"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "libvirt_service.kill_service", "func_param": "params"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params", "need_sleep_time": "5"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "90"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "10"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "libvirt_service.kill_service", "func_param": "params"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params", "need_sleep_time": "5"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "10"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "10"}]'
status_error = "no"
status_error_during_mig = "no"
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
action_during_do_mig = '[{"func": "set_migrate_speed_to_high", "before_pause": "yes", "func_param": "params"}]'
- pause_by_proxy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setup_pause_by_network():
"""
test.log.info("Setup for pause_by_network")
tcp_config_list = eval(params.get("tcp_config_list"))
libvirt_network.change_tcp_config(tcp_config_list)
libvirt_network.change_tcp_config(tcp_config_list, params)
migration_obj.setup_connection()

def cleanup_pause_by_network():
Expand All @@ -31,7 +31,7 @@ def cleanup_pause_by_network():
"""
test.log.info("Cleanup for pause_by_network")
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
libvirt_network.change_tcp_config(recover_tcp_config_list)
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
migration_obj.cleanup_connection()

libvirt_version.is_libvirt_feature_supported(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def setup_network_issue():
"""
test.log.info("Setup for network issue")
tcp_config_list = eval(params.get("tcp_config_list"))
libvirt_network.change_tcp_config(tcp_config_list)
libvirt_network.change_tcp_config(tcp_config_list, params)
migration_obj.setup_connection()

def cleanup_network_issue():
Expand All @@ -31,7 +31,7 @@ def cleanup_network_issue():
"""
test.log.info("Cleanup for network issue")
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
libvirt_network.change_tcp_config(recover_tcp_config_list)
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
migration_obj.cleanup_connection()

libvirt_version.is_libvirt_feature_supported(params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def setup_network_issue_libvirt_layer():
"""
test.log.info("Setup for network_issue_libvirt_layer.")
tcp_config_list = eval(params.get("tcp_config_list"))
libvirt_network.change_tcp_config(tcp_config_list)
libvirt_network.change_tcp_config(tcp_config_list, params)
migration_obj.setup_connection()

def verify_test():
Expand All @@ -51,6 +51,9 @@ def verify_test():
dominfo_check = params.get("dominfo_check")
migration_options = params.get("migration_options")

if make_unattended == "network_issue_libvirt_layer":
libvirt_network.cleanup_firewall_rule(params)
remote_firewall_rule = True
# check domain persistence
if dominfo_check:
dominfo = virsh.dominfo(vm_name, ignore_status=True, debug=True, uri=dest_uri)
Expand All @@ -61,7 +64,8 @@ def verify_test():
func_returns = dict(migration_obj.migration_test.func_ret)
migration_obj.migration_test.func_ret.clear()
test.log.debug("Migration returns function results:%s", func_returns)
if not libvirt.check_vm_state(vm_name, virsh_migrate_src_state, uri=migration_obj.src_uri):
if not libvirt.check_vm_state(vm_name, virsh_migrate_src_state,
uri=migration_obj.src_uri, debug=True):
test.fail("Migrated VMs failed to be in %s state at source" % virsh_migrate_src_state)
if int(migration_obj.migration_test.ret.exit_status) == 0:
migration_obj.migration_test.post_migration_check([vm], params,
Expand All @@ -76,13 +80,16 @@ def cleanup_network_issue_libvirt_layer():
"""
test.log.info("Cleanup for network_issue_libvirt_layer")
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
libvirt_network.change_tcp_config(recover_tcp_config_list)
if not remote_firewall_rule:
libvirt_network.cleanup_firewall_rule(params)
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
migration_obj.cleanup_connection()

libvirt_version.is_libvirt_feature_supported(params)

vm_name = params.get("migrate_main_vm")
make_unattended = params.get("make_unattended")
remote_firewall_rule = False

virsh_session = None
remote_virsh_session = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setup_pause_by_network():
"""
test.log.info("Setup for pause_by_network.")
tcp_config_list = eval(params.get("tcp_config_list"))
libvirt_network.change_tcp_config(tcp_config_list)
libvirt_network.change_tcp_config(tcp_config_list, params)
migration_obj.setup_connection()

def cleanup_pause_by_network():
Expand All @@ -32,7 +32,7 @@ def cleanup_pause_by_network():
"""
test.log.info("Cleanup for pause_by_network")
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
libvirt_network.change_tcp_config(recover_tcp_config_list)
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
migration_obj.cleanup_connection()

libvirt_version.is_libvirt_feature_supported(params)
Expand Down