#1# Hyper-V specific events23notify 10 {4match "system" "DEVFS";5match "subsystem" "CDEV";6match "type" "CREATE";7match "cdev" "hv_kvp_dev";8action "/usr/sbin/hv_kvp_daemon";9};1011notify 10 {12match "system" "DEVFS";13match "subsystem" "CDEV";14match "type" "DESTROY";15match "cdev" "hv_kvp_dev";16action "pkill -x hv_kvp_daemon";17};1819notify 11 {20match "system" "DEVFS";21match "subsystem" "CDEV";22match "type" "CREATE";23match "cdev" "hv_fsvss_dev";24action "/usr/sbin/hv_vss_daemon";25};2627notify 11 {28match "system" "DEVFS";29match "subsystem" "CDEV";30match "type" "DESTROY";31match "cdev" "hv_fsvss_dev";32action "pkill -x hv_vss_daemon";33};3435#36# Rules for non-transparent network VF.37#38# How network VF works with hn(4) on Hyper-V in non-transparent mode:39#40# - Each network VF has a corresponding hn(4).41# - The network VF and the it's corresponding hn(4) have the same hardware42# address.43# - Once the network VF is up, e.g. ifconfig VF up:44# o All of the transmission should go through the network VF.45# o Most of the reception goes through the network VF.46# o Small amount of reception may go through the corresponding hn(4).47# This reception will happen, even if the corresponding hn(4) is48# down. The corresponding hn(4) will change the reception interface49# to the network VF, so that network layer and application layer will50# be tricked into thinking that these packets were received by the51# network VF.52# o The corresponding hn(4) pretends the physical link is down.53# - Once the network VF is down or detached:54# o All of the transmission should go through the corresponding hn(4).55# o All of the reception goes through the corresponding hn(4).56# o The corresponding hn(4) fallbacks to the original physical link57# detection logic.58#59# All these features are mainly used to help live migration, during which60# the network VF will be detached, while the network communication to the61# VM must not be cut off. In order to reach this level of live migration62# transparency, we use failover mode lagg(4) with the network VF and the63# corresponding hn(4) attached to it.64#65# To ease user configuration for both network VF and non-network VF, the66# lagg(4) will be created by the following rules, and the configuration67# of the corresponding hn(4) will be applied to the lagg(4) automatically.68#69# NOTE:70# If live migration is not needed at all, the following rules could be71# commented out, and the network VF interface could be used exclusively.72# Most often the corresponding hn(4) could be completely ignored.73#74#75# Default workflow for the network VF bringup:76# 1) ETHERNET/IFATTACH -> VF interface up (delayed by rc.conf hyperv_vf_delay77# seconds). This operation will trigger HYPERV_NIC_VF/VF_UP.78# 2) HYPERV_NIC_VF/VF_UP:79# a) Create laggX corresponding to hnX.80# b) Add hnX and VF to laggX.81# c) Whack all previous network configuration on hnX, including stopping82# dhclient.83# d) Apply rc.conf ifconfig_hnX to laggX; i.e. including starting dhclient.84#85# NOTE:86# HYPERV_NIC_VF/VF_UP action script could be customized per-interface by87# adding /usr/libexec/hyperv/hyperv_vfup.hnX script.88# /usr/libexec/hyperv/hyperv_vfup could be used as the template for the89# customized per-interface script.90#91# NOTE:92# For transparent network VF, hyperv_vfattach does nothing and93# HYPERV_NIC_VF/VF_UP will not be triggered at all.94#9596notify 10 {97match "system" "HYPERV_NIC_VF";98match "type" "VF_UP";99action "/usr/libexec/hyperv/hyperv_vfup $subsystem";100};101102notify 10 {103match "system" "ETHERNET";104match "type" "IFATTACH";105match "vm_guest" "hv";106action "/usr/libexec/hyperv/hyperv_vfattach $subsystem 0";107};108109110