Skip to content

Commit

Permalink
migration: Add 4 cases about keepalive
Browse files Browse the repository at this point in the history
XXX-298208 - [VM migration] p2p migration with default keepalive configuration
XXX-298209 - [VM migration] p2p migration with src keepalive disabled
XXX-298211 - [VM migration] p2p migration with src and target keepalive disabled
XXX-298214 - [VM migration] p2p migration with customized keepalive_* settings

Signed-off-by: lcheng <[email protected]>
  • Loading branch information
cliping committed Sep 26, 2024
1 parent 768eab4 commit 6749e5d
Show file tree
Hide file tree
Showing 8 changed files with 530 additions and 10 deletions.
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

0 comments on commit 6749e5d

Please sign in to comment.