Skip to content
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

migration: Add 4 cases about keepalive #5919

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 @@ -48,6 +48,7 @@
client_cn = "ENTER.YOUR.EXAMPLE.CLIENT_CN"
set_remote_libvirtd_log = "yes"
libvirtd_file_type = "virtqemud"
remote_file_type = "virtqemud"
libvirtd_debug_level = "1"
libvirtd_debug_filters = "1:*"
check_str_local_log = '['"dir":"/etc/pki/qemu","endpoint":"client","verify-peer":true']'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
check_str_remote_log = "migration release-lock-outgoing,incoming"
set_remote_libvirtd_log = "yes"
libvirtd_file_type = "virtqemud"
remote_file_type = "virtqemud"
libvirtd_debug_level = "1"
libvirtd_debug_filters = "1:*"
libvirtd_debug_file = '/var/log/libvirt/virtqemud.log'
Expand Down
75 changes: 75 additions & 0 deletions libvirt/tests/cfg/migration/p2p_keepalive/customized_keepalive.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
- migration.p2p_keepalive.customized_keepalive:
type = p2p_keepalive
migration_setup = 'yes'
storage_type = 'nfs'
setup_local_nfs = 'yes'
disk_type = "file"
disk_source_protocol = "netfs"
mnt_path_name = ${nfs_mount_dir}
# Console output can only be monitored via virsh console output
only_pty = True
take_regular_screendumps = no
# Extra options to pass after <domain> <desturi>
virsh_migrate_extra = ''
# SSH connection time out
ssh_timeout = 60
# Local URI
virsh_migrate_connect_uri = 'qemu:///system'
image_convert = 'no'
server_ip = "${migrate_dest_host}"
server_user = "root"
server_pwd = "${migrate_dest_pwd}"
client_ip = "${migrate_source_host}"
client_user = "root"
client_pwd = "${migrate_source_pwd}"
libvirtd_file_type = "virtqemud"
libvirtd_debug_level = "1"
libvirtd_debug_filters = "1:*"
set_remote_libvirtd_log = "yes"
virsh_migrate_options = "--live --p2p --timeout 2 --timeout-suspend --verbose"
virsh_migrate_extra = "--bandwidth 10"
virsh_migrate_dest_state = "running"
virsh_migrate_src_state = "shut off"
variants:
- with_precopy:
variants:
- desturi_ssh:
migrate_desturi_type = "ssh"
new_ssh_port = "6666"
migrate_desturi_port = "${new_ssh_port}"
conf_on_src = '{"keepalive_interval": "3", "keepalive_count": "3"}'
src_conf_type = "qemu"
conf_on_target = '{r".*keepalive_interval\s*=.*": "keepalive_interval = 2", r".*keepalive_count\s*=.*": "keepalive_count = 4"}'
target_conf_type = "virtqemud"
remote_file_type = "virtqemud"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}:${new_ssh_port}/system"
- desturi_tcp:
migrate_desturi_port = "16509"
migrate_desturi_type = "tcp"
conf_on_src = '{"keepalive_interval": "3", "keepalive_count": "3"}'
src_conf_type = "qemu"
conf_on_target = '{r".*keepalive_interval\s*=.*": "keepalive_interval = 2", r".*keepalive_count\s*=.*": "keepalive_count = 4"}'
target_conf_type = "virtproxyd"
remote_file_type = "virtproxyd"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}/system"
variants test_case:
- after_keepalive_timeout:
status_error = "yes"
migrate_again = "yes"
expected_event_src = ["lifecycle.*Suspended Migrated", "lifecycle.*Resumed Migrated"]
expected_event_target = ["lifecycle.*: Stopped Destroyed|lifecycle.*: Stopped Failed"]
check_str_local_log = '["countToDeath=3 idle=3", "countToDeath=2 idle=6", "countToDeath=1 idle=9", "countToDeath=0 idle=12", "No response from client.*after 4 keepalive messages in 12 seconds", "internal error: connection closed due to keepalive timeout"]'
check_str_remote_log = '["countToDeath=4 idle=2", "countToDeath=3 idle=4", "countToDeath=2 idle=6", "countToDeath=1 idle=8", "countToDeath=0 idle=10", "No response from client.*after 5 keepalive messages in 10 seconds", "internal error: connection closed due to keepalive timeout"]'
migrate_src_state = "running"
migrate_dest_state = "nonexist"
virsh_migrate_extra_mig_again = " "
action_during_mig = '[{"func": "libvirt_network.setup_firewall_rule", "after_event": "iteration: '1'", "func_param": "params", "need_sleep_time": "4"}]'
- before_keepalive_timeout:
status_error = "no"
check_str_local_log = '["client=.* countToDeath=3 idle=3", "client=.* countToDeath=2 idle=6", "client=.* countToDeath=3 idle=3", "client=.* countToDeath=3 idle=3"]'
check_str_remote_log = '["client=.* countToDeath=4 idle=2", "client=.* countToDeath=3 idle=4", "client=.* countToDeath=4 idle=2", "client=.* countToDeath=4 idle=2"]'
action_during_mig = [{"func": "libvirt_network.setup_firewall_rule", "after_event": "iteration: '1'", "func_param": "params"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "3"}]
76 changes: 76 additions & 0 deletions libvirt/tests/cfg/migration/p2p_keepalive/default_keepalive.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
- migration.p2p_keepalive.default_keepalive:
type = p2p_keepalive
migration_setup = 'yes'
storage_type = 'nfs'
setup_local_nfs = 'yes'
disk_type = "file"
disk_source_protocol = "netfs"
mnt_path_name = ${nfs_mount_dir}
# Console output can only be monitored via virsh console output
only_pty = True
take_regular_screendumps = no
# Extra options to pass after <domain> <desturi>
virsh_migrate_extra = ''
# SSH connection time out
ssh_timeout = 60
# Local URI
virsh_migrate_connect_uri = 'qemu:///system'
image_convert = 'no'
server_ip = "${migrate_dest_host}"
server_user = "root"
server_pwd = "${migrate_dest_pwd}"
client_ip = "${migrate_source_host}"
client_user = "root"
client_pwd = "${migrate_source_pwd}"
libvirtd_file_type = "virtqemud"
libvirtd_debug_level = "1"
libvirtd_debug_filters = "1:*"
set_remote_libvirtd_log = "yes"
virsh_migrate_options = "--live --p2p --timeout 2 --timeout-suspend --verbose"
virsh_migrate_extra = "--bandwidth 10"
virsh_migrate_dest_state = "running"
virsh_migrate_src_state = "shut off"
variants:
- with_precopy:
variants:
- desturi_ssh:
migrate_desturi_type = "ssh"
new_ssh_port = "6666"
migrate_desturi_port = ${new_ssh_port}
default_conf_on_src = ["keepalive_interval", "keepalive_count"]
src_conf_type = "qemu"
default_conf_on_target = ["keepalive_interval", "keepalive_count"]
target_conf_type = "virtqemud"
remote_file_type = "virtqemud"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}:${migrate_desturi_port}/system"
- desturi_tcp:
migrate_desturi_port = "16509"
migrate_desturi_type = "tcp"
default_conf_on_src = ["keepalive_interval", "keepalive_count"]
src_conf_type = "qemu"
default_conf_on_target = ["keepalive_interval", "keepalive_count"]
target_conf_type = "virtproxyd"
remote_file_type = "virtproxyd"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}/system"
variants keepalive_timeout:
- after_keepalive_timeout:
status_error = "yes"
migrate_again = "yes"
expected_event_src = ["lifecycle.*Suspended Migrated", "lifecycle.*Resumed Migrated"]
expected_event_target = ["lifecycle.*: Stopped Failed|lifecycle.*: Stopped Destroyed"]
#expected_event_target = ["lifecycle.*: Stopped Destroyed"]
check_str_local_log = '["countToDeath=5 idle=5", "countToDeath=4 idle=10", "countToDeath=3 idle=15", "countToDeath=2 idle=20", "countToDeath=1 idle=25", "countToDeath=0 idle=30", "No response from client.*after 5 keepalive messages in 30 seconds", "internal error: connection closed due to keepalive timeout"]'
check_str_remote_log = '["countToDeath=5 idle=5", "countToDeath=4 idle=10", "countToDeath=3 idle=15", "countToDeath=2 idle=20", "countToDeath=1 idle=25", "countToDeath=0 idle=30", "No response from client.*after 5 keepalive messages in 30 seconds", "internal error: connection closed due to keepalive timeout"]'
migrate_src_state = "running"
migrate_dest_state = "nonexist"
virsh_migrate_extra_mig_again = " "
action_during_mig = '[{"func": "libvirt_network.setup_firewall_rule", "after_event": "iteration: '1'", "func_param": "params", "need_sleep_time": "5"}]'
- before_keepalive_timeout:
status_error = "no"
check_str_local_log = '["client=.* countToDeath=5 idle=5", "client=.* countToDeath=4 idle=10", "client=.* countToDeath=5 idle=5", "client=.* countToDeath=5 idle=5"]'
check_str_remote_log = '["client=.* countToDeath=5 idle=5", "client=.* countToDeath=4 idle=10", "client=.* countToDeath=5 idle=5", "client=.* countToDeath=5 idle=5"]'
action_during_mig = [{"func": "libvirt_network.setup_firewall_rule", "after_event": "iteration: '1'", "func_param": "params"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "10"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
- migration.p2p_keepalive.src_and_dest_keepalive_disabled:
type = p2p_keepalive
migration_setup = 'yes'
storage_type = 'nfs'
setup_local_nfs = 'yes'
disk_type = "file"
disk_source_protocol = "netfs"
mnt_path_name = ${nfs_mount_dir}
# Console output can only be monitored via virsh console output
only_pty = True
take_regular_screendumps = no
# Extra options to pass after <domain> <desturi>
virsh_migrate_extra = ''
# SSH connection time out
ssh_timeout = 60
# Local URI
virsh_migrate_connect_uri = 'qemu:///system'
image_convert = 'no'
server_ip = "${migrate_dest_host}"
server_user = "root"
server_pwd = "${migrate_dest_pwd}"
client_ip = "${migrate_source_host}"
client_user = "root"
client_pwd = "${migrate_source_pwd}"
virsh_migrate_options = "--live --p2p --timeout 2 --timeout-suspend --verbose"
virsh_migrate_extra = "--bandwidth 10"
virsh_migrate_dest_state = "running"
virsh_migrate_src_state = "shut off"
status_error = "no"
action_during_mig = '[{"func": "libvirt_network.setup_firewall_rule", "after_event": "iteration: '1'", "func_param": "params", "need_sleep_time": "5"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "30"}]'
test_case = "src_and_dest_keepalive_disabled"
variants:
- with_precopy:
variants:
- desturi_ssh:
migrate_desturi_type = "ssh"
new_ssh_port = "6666"
migrate_desturi_port = "${new_ssh_port}"
conf_on_src = '{"keepalive_interval": "-1"}'
src_conf_type = "qemu"
conf_on_target = '{r".*keepalive_interval\s*=.*": "keepalive_interval = -1"}'
target_conf_type = "virtqemud"
remote_file_type = "virtqemud"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}:${new_ssh_port}/system"
- desturi_tcp:
migrate_desturi_port = "16509"
migrate_desturi_type = "tcp"
conf_on_src = '{"keepalive_interval": "-1"}'
src_conf_type = "qemu"
conf_on_target = '{r".*keepalive_interval\s*=.*": "keepalive_interval = -1"}'
target_conf_type = "virtproxyd"
remote_file_type = "virtproxyd"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}/system"
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
- migration.p2p_keepalive.src_keepalive_disabled:
type = p2p_keepalive
migration_setup = 'yes'
storage_type = 'nfs'
setup_local_nfs = 'yes'
disk_type = "file"
disk_source_protocol = "netfs"
mnt_path_name = ${nfs_mount_dir}
# Console output can only be monitored via virsh console output
only_pty = True
take_regular_screendumps = no
# Extra options to pass after <domain> <desturi>
virsh_migrate_extra = ''
# SSH connection time out
ssh_timeout = 60
# Local URI
virsh_migrate_connect_uri = 'qemu:///system'
image_convert = 'no'
server_ip = "${migrate_dest_host}"
server_user = "root"
server_pwd = "${migrate_dest_pwd}"
client_ip = "${migrate_source_host}"
client_user = "root"
client_pwd = "${migrate_source_pwd}"
libvirtd_file_type = "virtqemud"
libvirtd_debug_level = "1"
libvirtd_debug_filters = "1:*"
set_remote_libvirtd_log = "yes"
virsh_migrate_options = "--live --p2p --timeout 2 --timeout-suspend --verbose"
virsh_migrate_extra = "--bandwidth 10"
virsh_migrate_dest_state = "running"
virsh_migrate_src_state = "shut off"
variants:
- with_precopy:
variants:
- desturi_ssh:
migrate_desturi_type = "ssh"
new_ssh_port = "6666"
migrate_desturi_port = "${new_ssh_port}"
conf_on_src = '{"keepalive_interval": "-1"}'
src_conf_type = "qemu"
remote_file_type = "virtqemud"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}:${new_ssh_port}/system"
- desturi_tcp:
migrate_desturi_port = "16509"
migrate_desturi_type = "tcp"
conf_on_src = '{"keepalive_interval": "-1"}'
src_conf_type = "qemu"
remote_file_type = "virtproxyd"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp -j DROP --dport ${migrate_desturi_port} -s ${migrate_source_host}"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp -j DROP --sport ${migrate_desturi_port} -s ${migrate_dest_host}"
virsh_migrate_desturi = "qemu+${migrate_desturi_type}://${migrate_dest_host}/system"
variants keepalive_timeout:
- after_keepalive_timeout:
status_error = "yes"
migrate_again = "yes"
expected_event_src = ["lifecycle.*Suspended Migrated", "lifecycle.*Resumed Migrated"]
expected_event_target = ["lifecycle.*: Stopped Destroyed|lifecycle.*: Stopped Failed"]
check_no_str_local_log = '["No response.*after 5 keepalive messages in 30 seconds"]'
check_str_remote_log = '["countToDeath=5 idle=5", "countToDeath=4 idle=10", "countToDeath=3 idle=15", "countToDeath=2 idle=20", "countToDeath=1 idle=25", "countToDeath=0 idle=30", "No response from client.*after 5 keepalive messages in 30 seconds", "internal error: connection closed due to keepalive timeout"]'
migrate_src_state = "running"
migrate_dest_state = "nonexist"
virsh_migrate_extra_mig_again = " "
action_during_mig = '[{"func": "libvirt_network.setup_firewall_rule", "after_event": "iteration: '1'", "func_param": "params", "need_sleep_time": "5"}]'
- before_keepalive_timeout:
status_error = "no"
check_str_remote_log = '["client=.* countToDeath=5 idle=5", "client=.* countToDeath=4 idle=10", "client=.* countToDeath=5 idle=5", "client=.* countToDeath=5 idle=5"]'
action_during_mig = [{"func": "libvirt_network.setup_firewall_rule", "after_event": "iteration: '1'", "func_param": "params"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "10"}]
Loading
Loading