network restart should die
Currently when you change ANYTHING related to networking at all, FreeNAS reacts by restarting the network, and by that I mean it destroys all virtual interfaces and recreates them.
Handwavy IRC conversation says we should "do something" and that something should be able to apply deltas between the current config and what you are saving...doing the needful as far as ifconfig, ifconfig create, ifconfig destroy
this is a large project. (which in william speak means it will take most of a day. ;)
feat(middlewared): network plugin for interfaces sync
This is a work in progress, only regular physical ifaces are working.
Code inspired in networkd using py-netif.
Revert "feat(middlewared): depend on py-ucl"
UCL will no longer be used for parsing.
This reverts commit bfcd78df12a08a496d2bdff6a23447a3c85d78ab.
feat(middlewared): run dhclient if dhcp is enabled and not running
fix(gui): partially revert last commit
File was committed by accident, this is not yet ready for overall usage.
feat(middlewared): destroy interfaces which are not in database
feat(middlewared): set ipv6 interface flags
Grabbed from networkd.
fix(middlewared): ipv6 auto configure also enable flags
Make sure rtsold is started for ipv6auto.
feat(gui): make start network call middleware interfaces.sync
fix(middlewared): actually check for returncode before logging error
feat(gui): adding interface should not interrupt connectivity now
rem(gui): ifconfig_alias has been superseded by interfaces.sync
fix(middlewared): reconfigure_logging has to happen later
While I'm here, space -> tab.
fix(gui): do not reload "networkgeneral" when editing interfaces
fix(gui): sync_carp_ips has been superseded by interfaces.sync
fix(middlewared): check for error when applying iface options
fix(middlewared): add lagg and vlan to interfaces in database list
fix(gui): network start should happen in done()
This is to make sure all formsets are saved before it happens.
fix(middlewared): better handling of vlan/lagg not in Interfaces
If lagg/vlan is in database but not in interfaces we should remove its
addresses and bring it down.
We also turn down every physical interface not in database.
feat(gui): deleting vlan Interface will delete underlying vlan config
fix(middlewared): be more graceful when interface in db does not exist
feat(gui): remove the requirement to manually disable failover
#9 Updated by Josh Paetzel over 2 years ago
jpaetzel [5:09 PM]
I'm confused perhaps
if self.middleware.call('notifier.failover_status') == 'MASTER':
advskew = 20
could that demote an HA unit's advskew from 1 -> 20 ?
william [5:11 PM]
idk, lets think about it
say you are passive and becomes master, it will set advskew to 1, right? and when the other needs comes back up, it will be 20?
jpaetzel [5:13 PM]
when the HA node boots it will select it's advskew from the database as either 20 or 80
william [5:13 PM]
its not in the database
jpaetzel [5:13 PM]
when carp goes master, carp_hook runs, and if it "wins" the advskew gets set to 1
oh right, it's all in rc.conf.local now
william [5:15 PM]
but yeah, that doesn't look right
jpaetzel [5:15 PM]
and if carp goes BACKUP, carp_hook runs it's backup routines and sets advskew to 100
the comment on line 250
it sounds like what needs to happen is before the delete, see what the advskew is, then use that when reconfiguring carp
william [5:18 PM]
jpaetzel [5:18 PM]
I'll update the ticket
william [5:19 PM]
and additionally, use the node A or B to set 20 or 80
if there was no carp configured previously (edited)
instead of MASTER/BACKUP
jpaetzel [5:19 PM]