tp-libvirt icon indicating copy to clipboard operation
tp-libvirt copied to clipboard

snapshot: Make sure the guest boot successfully before snapshot-create-as

Open hs0210 opened this issue 3 years ago • 4 comments

Make sure the guest boot successfully before creating snapshot, otherwise it may fail.

Before:

# /usr/local/bin/avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio virsh.snapshot_edit.positive_tests.edit_option_rename.edit_option_current_and_snapname.disk_snapshot.with_desc.disk_
snapshot --vt-connect-uri qemu:///system                                                                                                                                                                                                                                                                             
JOB ID     : 75dcc0e77481b4331486d35554502bb1934f06e9                                          
JOB LOG    : /var/lib/avocado/job-results/job-2022-07-06T05.09-75dcc0e/job.log
 (1/1) type_specific.io-github-autotest-libvirt.virsh.snapshot_edit.positive_tests.edit_option_rename.edit_option_current_and_snapname.disk_snapshot.with_desc.disk_snapshot: FAIL: Failed to create snapshot. Error:. (501.31 s)            
RESULTS    : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0                                                                                                                                                             
JOB HTML   : /var/lib/avocado/job-results/job-2022-07-06T05.09-75dcc0e/results.html
JOB TIME   : 502.14 s

After:

# /usr/local/bin/avocado run --vt-type libvirt --test-runner=runner --vt-machine-type arm64-mmio virsh.snapshot_edit.positive_tests.edit_option_rename.edit_option_current_and_snapname.disk_snapshot.with_desc.disk_snapshot --vt-connect-uri qemu:///system
JOB ID     : e14fb621471ecce592885d3190b575b58e36d88b
JOB LOG    : /var/lib/avocado/job-results/job-2022-07-06T07.59-e14fb62/job.log
 (1/1) type_specific.io-github-autotest-libvirt.virsh.snapshot_edit.positive_tests.edit_option_rename.edit_option_current_and_snapname.disk_snapshot.with_desc.disk_snapshot: PASS (34.13 s)
RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2022-07-06T07.59-e14fb62/results.html
JOB TIME   : 35.02 s

Signed-off-by: Hu Shuai [email protected]

hs0210 avatar Jul 06 '22 12:07 hs0210

@Yingshun PTAL.

hs0210 avatar Jul 06 '22 12:07 hs0210

virsh.snapshot_create_as can happen on stopped VM

@chunfuwen Yes. virsh.snapshot_create_as can both success on stopped VM and active VM. But if we do virsh.snapshot_create_as just after vm starts when the VM isn't full ready, sometimes it may fail:

2022-07-12 03:40:17,982 virsh_snapshot_e L0140 DEBUG| ...use option snap1 old-desc1 --disk-only
2022-07-12 03:40:17,982 virsh            L0776 DEBUG| Running virsh command: snapshot-create-as avocado-vt-vm1 snap1 old-desc1 --disk-only
2022-07-12 03:40:17,982 process          L0658 INFO | Running '/bin/virsh snapshot-create-as avocado-vt-vm1 snap1 old-desc1 --disk-only'
2022-07-12 03:41:42,262 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:02)<->(10.8.2.207) IP pair into address cache
2022-07-12 03:42:15,562 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:14)<->(10.8.2.225) IP pair into address cache
2022-07-12 03:43:14,871 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:0a)<->(10.8.2.215) IP pair into address cache
2022-07-12 03:44:15,982 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:05)<->(10.8.2.210) IP pair into address cache
2022-07-12 03:44:16,501 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:0c)<->(10.8.2.217) IP pair into address cache
2022-07-12 03:44:47,702 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:0d)<->(10.8.2.218) IP pair into address cache
2022-07-12 03:44:49,782 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:0b)<->(10.8.2.216) IP pair into address cache
2022-07-12 03:45:17,986 process          L0658 INFO | Running 'kill -19 746503'
2022-07-12 03:45:17,990 process          L0731 INFO | Command kill -19 746503 running on a thread
2022-07-12 03:45:17,990 process          L0740 INFO | Command 'kill -19 746503' finished with 0 after 0.001487255s
2022-07-12 03:45:18,052 process          L0658 INFO | Running 'kill -15 746503'
2022-07-12 03:45:18,055 process          L0731 INFO | Command kill -15 746503 running on a thread
2022-07-12 03:45:18,055 process          L0740 INFO | Command 'kill -15 746503' finished with 0 after 0.001044386s
2022-07-12 03:45:18,056 process          L0658 INFO | Running 'kill -18 746503'
2022-07-12 03:45:18,059 process          L0731 INFO | Command kill -18 746503 running on a thread
2022-07-12 03:45:18,059 process          L0740 INFO | Command '/bin/virsh snapshot-create-as avocado-vt-vm1 snap1 old-desc1 --disk-only' finished with -15 after 300.074643694s
2022-07-12 03:45:18,060 process          L0740 INFO | Command 'kill -18 746503' finished with 0 after 0.001397907s
2022-07-12 03:45:18,060 virsh            L0826 DEBUG| status: -15
2022-07-12 03:45:18,060 virsh            L0827 DEBUG| stdout:
2022-07-12 03:45:18,061 virsh            L0828 DEBUG| stderr:
2022-07-12 03:45:52,252 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:03)<->(10.8.2.208) IP pair into address cache
2022-07-12 03:46:20,331 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:10)<->(10.8.2.221) IP pair into address cache
2022-07-12 03:46:53,092 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:0f)<->(10.8.2.220) IP pair into address cache
2022-07-12 03:47:22,491 ip_sniffing      L0061 DEBUG| Updated HWADDR (52:54:00:23:55:0e)<->(10.8.2.219) IP pair into address cache

hs0210 avatar Jul 12 '22 07:07 hs0210

Hi, ping! PTAL.

hs0210 avatar Aug 01 '22 02:08 hs0210

Hi, ping! PTAL.

hs0210 avatar Sep 27 '22 09:09 hs0210

@Yingshun PTAL.

hs0210 avatar Dec 28 '22 03:12 hs0210