-
Notifications
You must be signed in to change notification settings - Fork 139
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
Cant boot vm using upstream autotest when nics number get larger #1058
Comments
Just to make sure I'm not missing anything, you're starting out clean, no Then, you run boot test, a VM instance is created, Next, you change Finally, you run boot test, and it breaks as described above. Can you confirm the MAC address of the first nic in the first test is exactly the same as the first nic in the second test? |
@cevich
yes, the first nic mac is same
no, the vm is running
yes, the second test will restart the vm.
in our env_process preprcocess_vm will using the vm.virtnet directly when create new vm, the virnet of the new vm dosen't do any init. |
another issues: issue1:
issue2:
|
On 11/12/2013 08:14 PM, Yiqiao Pu wrote:
I remember we used to fix similar issue before. VM always try to use Now it happens in network part.
|
@FengYang The old fix only makes the command line generate function works in the right way, but the prepare work for tapfds are not covered. |
On 11/12/2013 09:36 PM, Yunping Zheng wrote:
Excellent, I see how this problem is happening, it is caused by two things:
The bad news is, the problem is embedded deep inside virtnet code and bound up with incorrect responsibility delegation (i.e. virtnet code tries to be "smart" in some areas). The good news is I believe I have a good understanding of what is causing these problems, and am far along into fixing it at the root:
You can follow my changes here: https://github.com/cevich/virt-test/compare/autotest:next...virtnet_modernize |
@ypu Status: fixed bug from second unittest class, and finished writing third class. Found a few more bugs and fixed all except one. Also remembered I'll need a fourth unittest class for libvirt, but hopefully that one will be easier after having written the first three. Hopefully I can finish up all four by the end of tomorrow, then it's onto making them all work in the VM classes (which hopefully means deleting a lot of crusty code). High-level of what I'm doing: Re-writing all the virtnet stuff to be more "dumb" and not try to make decisions. Instead, the logic of which networking data to use will be ONLY in vm class. This will make virtnet much simpler to use and easier for vm classes to take the correct actions. |
@cevich You are so kind to let me know the status of this problem. Will following the virtnet_modernize branch and do some tests with it. Thanks a lot. |
@ypu You said this was critical problem, no? Today I fixed many bugs and finished forth unittest class. However, I run tools/run_unittests.py to check, and found I have broken some other things on accident. I will investigate those, then tomorrow as I hoped, I can start getting all these virtnet changes into the VM classes w00t! |
Okay, I just figured out the unittest failures are a timing issue uncovered by my un-related changes. Opened this issue #1074 Now I can start integrating my changes into |
@ypu Sorry, forgot to update this yesterday. I've taken a bunch of bug fixes and small enhancements our of my patchset, and separated them to their own PR #1075 and opened an issue for the unittest concurrency problem I found as #1074. Assuming those can be handled in parallel, now I can focus on integration w/ a smaller set of changes on my branch. |
@ypu Oh! I just found the cause for all this! A long while ago when I wrote virtnet, I made |
@ypu Today I learned of a tricky circular dependency that was causing unrelated unittests to fail, but only when run in parallel. Turns out, it was related to some changes I made in my branch. I had to revert those and re-implement a small section + it's unittest. Still, good to catch such a nasty problem early, yay unittests! My work from yesterday was committed upstream, simplifying my branch. I started working through the virt_vm class, cleaning and getting it ready for the new virtnet. Tomorrow I will continue that work. |
@ldoktor I'm looking at updating virtnet in That got me thinking, reading through your code, and pondering why qemu_vm should have two completely different object models for devices? I don't see a network-device implementation, but IIRC, you said N/B: On the libvirt-side, we don't really even need virtnet since our I guess I'm trying to look at the big picture, if both @lmr you remember how tricky this networking stuff is, what's your opinion on dumping virtnet, and using qemu_devices for this? (I'll keep plugging away at what I'm doing in case the above won't work or isn't a good idea). |
Hi @cevich, yes, |
@ldoktor hahahaha, but will networking avoid you! It is very tricky with many corner cases, so I understand. Though by my reading of what you have already in
The problem @ypu is having comes from current solutions to No. 2 and 5 (however, these have dependencies on the other items). As I see it currently, qemu_devices already has ability for almost all of these. The only parts that seem to be missing in qemu-devices is No 4. and then using it in In other words, saving the qemu_devices networking info (outside of Env), then using it again in Do you think you could manage stripping out VirtNetDB, moving that functionality into qemu_devices, and update |
@ldoktor yeah, looking at this more, it really seems to me that |
@ldoktor and @cevich, I've decided to push the interim solution by @humanux while you guys debate what is the best solution. After looking at the time line of this issue, I found not admissible that we've been with virt-test broken for so long for anything as trivial as running tests in sequence that change network configuration. Feel free to revert the change when you have a proper solution. |
@ypu Okay, after discussing much with @lmr, he is on-board with having Basically what I've done is simplify virtnet into just a params parser and collection of "helpers" for the vm and qemu-devices to consume. Once this reduction is working, @ldoktor can set about migrating the minimal virtnet address_cache db use over/info qemu-devices (should be relatively simple task). Here's my latest work (likely broken in some spots): https://github.com/cevich/virt-test/compare/virtnet_reduction I'll keep hammering away at this effort, to account for just a few small virtnet interface changes. There's bound to be some breakage, but not a lot that I haven't dealt with in the past. I'll keep y'all posted on my progress. |
@ypu I've got most of the basic qemu-kvm tests "working", including multi-nic. However, as I know from experience there are likely some corner-cases and odd situations I need to test for. Then I'll need to go over libvirt and get it updated as well (should be much quicker than qemu_vm though). Finally, I'll start going through and polishing up my commits so we can test, test, test, test, test and maybe merge them soonish :) |
@ypu Amazingly, after I got past a few unrelated problems, I am running qemu-kvm tests for boot, ping.multi_nics, reboot, and shutdown with no problem and new networking code. I decided to polish up commit messages today, and get PR ready so more testing can be done by other people. While that testing happens, I will work on getting libvirt tests to work again, with new code. |
@ypu @lmr @ldoktor Yay! First draft: #1217 Please check it out when you have time. I know it's HUGE set of changes, so I'm opening it up early so y'all can pick away at it in more manageable chunks over a longer period of time. I have no expectations of merging this quickly, I've spent a lot of time trying to get this "right" and want the merge to happen that way too. Thanks! |
@ldoktor As far as qemu_devices go, let me know what you think about using it to replace the BaseVM's use of VirtnetDB. It's really qemu-kvm specific and probably doesn't need to be in the base module. It's only purpose is to make sure the same vm.instance gets the same mac addresses for it's corresponding nics over a test job. I'm also open to just leaving it this way if you see it as a huge burden to incorporate into qemu_devices, of if you don't think it makes sense to do so. |
As now autotest always get vm object from env and virtnet is not updated. We will met problem when we run tests like this:
we will meet this problem as in the second test the prepare work for nics get virtnet object from the pre vm object from last case. :
cmdline for second case:
-device virtio-net-pci,mac=9a:e3:e4:e5:e6:e7,id=idfKDrOm,netdev=idhlb9is,bus=pci.0,addr=06
-netdev tap,id=idhlb9is,vhost=on,vhostfd=21,fd=20
-device virtio-net-pci,mac=9a:cb:cc:cd:ce:cf,id=idXVv625,netdev=idBRKPax,bus=pci.0,addr=07
-netdev tap,id=idBRKPax,vhost=on,ifname='t1-PGkoOH',downscript='no' \
and qemu-kvm will failed to start the guest:
20:09:21 INFO | [qemu output] /etc/qemu-ifup: could not launch network script
20:09:22 INFO | [qemu output] qemu: -netdev tap,id=idBRKPax,vhost=on,ifname=t1-PGkoOH,downscript=no: Device 'tap' could not be initialized
20:09:22 INFO | [qemu output](Process terminated with status 1)
But what we expect is guest start with two nics both using tapfd.
The text was updated successfully, but these errors were encountered: