-
Dimitris Aragiorgis authored
This hook should run on instance-modify-post phase and will reconfigure the VM's taps based on certain tags. Just like with firewalling we first check if the instance has a tag with prefix synnefo:network:<some_nic_ident>:reconfigure. If the identifier is missing then the reconfiguration will apply to all NICs. This hook will run only in primary node of the instance. Since hooks and runtime environment may differ (due to modifications without hotplug), we get all the info stored locally. That is /var/lib/snf-network/<TAP>-env and /var/run/ganeti/kvm-hypervisor/nics/<INSTANCE>/<NIC_UUID>. Then we invoke /etc/ganeti/kvm-ifup-custom with the RECONFIGURE environment variable set to true. If this is set it sources the already existing env file (and overrides and other environment variables). This feature is useful when we want to apply changes that affect only the hosts environment and not the VM, e.g. firewalls. To this end we do: # gnt-instance add-tags instance synnefo:network:0:protected # gnt-instance add-tags instance synnefo:network:0:reconfigure # gnt-instance modify --net 0: instance Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
09e9cce5