-
Notifications
You must be signed in to change notification settings - Fork 54
Check for port in node_connect_network() #474
Comments
I think complaining loudly and as soon as possible is the right thing here (and usually). Should be straightforward to implement. |
One tricky part of doing this is that we will want to verify that a NIC is connected to a PORT on all of the real drivers, but not on the mock or null switch drivers we use for testing. One way around this that keeps the api.py calls driver-neutral would be to check |
I don't see any reason to change the behavior here. |
Curious to hear your reasons? This just bit us in one of our setups -- some folks spent hours trying to debug why their connected nodes couldn't talk to each other. If we know ahead of time that a NIC is not connected to a PORT (and it's not in dev mode), then why not do the check so that we can tell the user immediately that the operation will fail? There currently is an error message, but it's in the network service thread output:
|
...hmm, that's pretty convincing. How about returning 200, but also including in the body "Warning---this NIC is not connected to any port, and will not provide any network connectivity. Contact your HaaS administrator to get this fixed." or something like that? Whether the NIC has a PORT can be checked without looking into the driver at all. Now, there's no way to check that the port makes /sense/ without looking into the driver... but I don't know that that's doable at all. |
Would there ever be a case (outside of |
It "succeeds" fine. It just doesn't do anything. If we're serious about ports without nics being bad news, then we should structure the API to make it impossible for that to happen in the first place---for instance, having nics and ports be the same thing. |
IMO the I am going to work on this and submit a fix. |
|
Also not returning when we know there's an error, and not returning until the work is done, are VERY different. I'm not convinced you two are agreeing right now. |
I'm going to repeat my recommendation: if we eliminate the distinction between ports and nics, and have each nic have a database field representing the port information, none of this is a problem anymore, and the API is simpler too |
I see @gsilvis 's point now. @SahilTikale also suggest that having a way to poll the status later may be necessary. The "eliminate distinction between nics and ports" seems to be a good one, though I doubt we will be able to do it right now. However I still believe that we should not add job to the queue if it will definitely fail, i.e. Nic is not connected to a port. |
+1 for immediately checking that the NIC is attached, as a maybe only short-term solution. But I'm going to keep bringing the other option up, whenever we talk about this :) |
Great that we finally sort it out! Jason has already started work on the other option :P I will start to work on this issue. |
hey @shwsun just wanted to see if you had made it any where on this |
Fix this is quite easy, but seems like it will break a lot of tests in |
@shwsun discovered that this will also require some adjustments to the tests, including at least tests/unit/api/main.py. Since there are so many |
closing, fix is in #625 |
In node_connect_network(), we currently do not verify that a NIC is connected to a port before adding the connection request to the Network Action Service queue.
According to Ian in #455:
I think this is pretty straightforward (even if it breaks compatibility). Anyone disagree? @gsilvis @zenhack
The text was updated successfully, but these errors were encountered: