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

virtual_disks_multivms: fix disk discovery #5323

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

smitterl
Copy link
Contributor

@smitterl smitterl commented Dec 5, 2023

Depends on avocado-framework/avocado-vt#3815

The tests used the disk target as identifier for the
disk inside of the VM. However, the target is not guaranteed
to show up in the guest as-is, especially given that the
/dev/XdY paths are not persistent and can change between boots.

Use instead a function that identifies a new disk inside of a VM
as the one disk that has no root mount on itself, its partitions
or volumes.

Finally, the delete_scsi_disk doesn't return any value so it
was always looping for the full timeout. Wrap it into a function
that confirms if both the module and device have been removed.

Signed-off-by: Sebastian Mitterle [email protected]

@smitterl
Copy link
Contributor Author

smitterl commented Dec 5, 2023

JOB ID     : 65e6ebd3e3f383e04ec0385a8d36e56add64aa25
JOB LOG    : /var/lib/avocado/job-results/job-2023-12-05T13.10-65e6ebd/job.log
 (01/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.hotplug.vms_sgio_share_normal_test.scsi_lbpu.filtered_shareable_option1: PASS (148.34 s)                                                                                            
 (02/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.hotplug.vms_sgio_share_normal_test.scsi_lbpws.filtered_shareable_option2: PASS (148.60 s)                                                                                           
 (03/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_normal_test.scsi_lbpu.filtered_shareable_option3: PASS (145.91 s)                                                                                           
 (04/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_normal_test.scsi_lbpws.filtered_shareable_option4: PASS (145.79 s)
 (05/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_error_test.scsi_lbpu.filtered_shareable_option1: PASS (138.02 s)
 (06/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_error_test.scsi_lbpws.filtered_shareable_option1: PASS (137.96 s)
 (07/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_stop: PASS (28.98 s)
 (08/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_report: PASS (28.85 s)
 (09/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_ignore: PASS (28.67 s)
 (10/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_enospace: PASS (17.97 s)
 (11/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sharable_test.block_type: PASS (39.55 s)
 (12/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sharable_test.file_type: PASS (28.83 s)
 (13/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_readonly_test: PASS (26.00 s)
RESULTS    : PASS 13 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2023-12-05T13.10-65e6ebd/results.html
JOB TIME   : 1064.09 s

@smitterl
Copy link
Contributor Author

smitterl commented Dec 5, 2023

@chunfuwen Please help review, thanks!

@smitterl
Copy link
Contributor Author

smitterl commented Dec 7, 2023

@chunfuwen Thank you for your review, I addressed your feedback. Please, could you review again?

@smitterl smitterl requested a review from chunfuwen December 7, 2023 11:00
@smitterl
Copy link
Contributor Author

smitterl commented Dec 7, 2023

Re-run for patch v2

JOB ID     : e124ea186ae494df0b4d1647f49289af4f162172
JOB LOG    : /var/lib/avocado/job-results/job-2023-12-07T05.54-e124ea1/job.log
 (01/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.hotplug.vms_sgio_share_normal_test.scsi_lbpu.filtered_shareable_option1: PASS (155.28 s)                                                                                            
 (02/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.hotplug.vms_sgio_share_normal_test.scsi_lbpws.filtered_shareable_option2: PASS (147.67 s)                                                                                           
 (03/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_normal_test.scsi_lbpu.filtered_shareable_option3: PASS (147.73 s)                                                                                           
 (04/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_normal_test.scsi_lbpws.filtered_shareable_option4: PASS (147.70 s)
 (05/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_error_test.scsi_lbpu.filtered_shareable_option1: PASS (139.41 s)
 (06/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sgio_share_error_test.scsi_lbpws.filtered_shareable_option1: PASS (140.12 s)
 (07/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_stop: PASS (31.14 s)
 (08/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_report: PASS (29.54 s)
 (09/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_ignore: PASS (31.13 s)
 (10/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_error_policy_test.error_policy_enospace: PASS (18.26 s)
 (11/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sharable_test.block_type: PASS (39.74 s)
 (12/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_sharable_test.file_type: PASS (28.08 s)
 (13/13) type_specific.io-github-autotest-libvirt.virtual_disks.multivms.coldplug.vms_readonly_test: PASS (28.16 s)
RESULTS    : PASS 13 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML   : /var/lib/avocado/job-results/job-2023-12-07T05.54-e124ea1/results.html
JOB TIME   : 1084.63 s

@chunfuwen chunfuwen added the depend on The PR has dependency on other PRs label Dec 11, 2023
@smitterl
Copy link
Contributor Author

I've tried to identify the new disk as not mounted and no children that are mounted but then the test at some point mounts it and might not find it anymore. OTOH, using serial doesn't work for LUN type disks "error: unsupported configuration: scsi-block 'lun' devices do not support the serial property"

The tests used the disk target as identifier for the
disk inside of the VM. However, the target is not guaranteed
to show up in the guest as-is, especially given that the
/dev/XdY paths are not persistent and can change between boots.

Use instead a function that identifies a new disk inside of a VM
as the one disk that has no root mount on itself, its partitions
or volumes.

Finally, the `delete_scsi_disk` doesn't return any value so it
was always looping for the full timeout. Wrap it into a function
that confirms if both the module and device have been removed.

Signed-off-by: Sebastian Mitterle <[email protected]>
@smitterl
Copy link
Contributor Author

@chunfuwen I think this is now the final working version. Unfortunately, via serial wouldn't work with LUNs and the algorithm gets a bit more complicated. Please have a look.

@smitterl smitterl requested a review from chunfuwen December 13, 2023 07:32
Copy link
Contributor

@chunfuwen chunfuwen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@dzhengfy dzhengfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dzhengfy dzhengfy merged commit ed02639 into autotest:master Dec 22, 2023
4 checks passed
@smitterl smitterl deleted the fix_multivms branch July 26, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
depend on The PR has dependency on other PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants