Skip to content

Commit

Permalink
OS-4158 zombie vnics lurking in the system
Browse files Browse the repository at this point in the history
Reviewed by: Rob Gulewich <robert.gulewich@joyent.com>
  • Loading branch information
rmustacc committed Apr 8, 2015
1 parent 354781d commit 5cf38e8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions overlay/generic/usr/lib/brand/jcommon/statechange
Expand Up @@ -262,12 +262,23 @@ setup_net()
# Create the vnic.
#

opt_str="-p zone=$ZONENAME"
opt_str="-p "

if [[ -n "$mtu" ]]; then
opt_str="$opt_str,mtu=$mtu"
opt_str="$opt_str mtu=$mtu,"
fi

#
# Always append the zone as the last property. This is
# to work around the fact that once we associate it with
# a zone, the zone will have a hold on the device and
# we'll not be able to delete it if a create fails due
# to a bad property (say an invalid MTU). Note if we
# have other properties, it is their responsibility to
# put a trailing comma on it.
#
opt_str="${opt_str}zone=$ZONENAME"

if [[ -n "$jst_vrrp" && -n $vrid ]]; then
# MAC addresses for VRRP vnics are determined by the VRID
mac_addr="vrrp"
Expand All @@ -279,6 +290,7 @@ setup_net()
[[ -n $vlan_id && $vlan_id != 0 ]] && \
opt_str="$opt_str -v $vlan_id"


#
# Creating a VNIC in a zone is a multi-step process internally.
# This means there is a short window where the VNIC exists in
Expand Down

0 comments on commit 5cf38e8

Please sign in to comment.