Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

Revert port when registering in HIL #761

Closed
naved001 opened this issue Apr 24, 2017 · 9 comments
Closed

Revert port when registering in HIL #761

naved001 opened this issue Apr 24, 2017 · 9 comments

Comments

@naved001
Copy link
Contributor

So I came across this when I was playing with the dell n3048. So when you enable trunking on it (sw mode trunk) by default the port has all the vlans enabled which is not cool. This may be the case in other switches too.

What we should do is, during port registration, call revert_port on the port being registered. That way, when a new port is registered we can be sure that it has no vlans enabled. (Or are we doing this already?)

cc: @zenhack

@zenhack
Copy link
Contributor

zenhack commented Apr 24, 2017

Yeah, I thought there was a note somwehre about admins needing to shut that off when setting up. But now that we have the functionality we probably ought to just do it automatically.

@naved001
Copy link
Contributor Author

@zenhack just realised that I can't call port revert on a port that is not attached to any nic. Why is that so?

@naved001
Copy link
Contributor Author

@zenhack ping

@zenhack
Copy link
Contributor

zenhack commented May 19, 2017

It's an artifact of the fact that NewtorkingActions are bound to nics, not ports, so to actually shove something in the queue we need a nic. This probably shouldn't be the case, just a limitation of the existing implementation.

It would require a bit of refactoring to fix. I think we could just switch what object the networking action was bound to, though there are likely a few subtleties in the places where we check for the existance of an action.

@zenhack
Copy link
Contributor

zenhack commented Sep 7, 2017

So, one potential issue with this: it will make it harder to set up HIL in an existing environment without disturbing things, which is a use case we've discussed in the past.

@naved001
Copy link
Contributor Author

naved001 commented Sep 7, 2017

hm, maybe we can make it tunable via the configuration file.

[installation]
complete-wipe or sneaky

that way we can do other stuff too, like turn off nodes when they are registered.

@zenhack
Copy link
Contributor

zenhack commented Sep 7, 2017

maybe a more stragithforward name for the option, like clean_resources_on_register = True, but that seems reasonable.

@naved001
Copy link
Contributor Author

naved001 commented Oct 5, 2017

so we can make it tunable via the config file, and call revert_port() when we do a port_connect_nic(). And since that would be an admin only operation that'll be performed before the nodes are given to users, I think it'll be safe to do.

What do you think @zenhack?

@naved001
Copy link
Contributor Author

Now that I think of it, this may not always work and is probably a bad idea. Sometimes a switchport may have more configuration than just VLANs. Our revert_port call only removes networks, not any other configuration on a switchport (like ip-address, qos etc etc). So it's best to leave it up to admins to set the state right before registering in HIL; otherwise there may be unwanted side affects.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants