Guest User

Untitled

a guest
Nov 18th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. diff --git a/overlay/generic/usr/lib/brand/jcommon/statechange b/overlay/generic/usr/lib/brand/jcommon/statechange
  2. index e2a10f0c..07bdb9a0 100644
  3. --- a/overlay/generic/usr/lib/brand/jcommon/statechange
  4. +++ b/overlay/generic/usr/lib/brand/jcommon/statechange
  5. @@ -56,6 +56,7 @@ cmd=$5
  6. VNDADM=/usr/sbin/vndadm
  7. SNAPSHOT_DIR=root/checkpoints
  8. OVERLAY_RULES=/var/run/smartdc/networking/overlay_rules.json
  9. +SYSINFO=/tmp/.sysinfo.parsable
  10. DEFAULT_MTU=1500
  11.  
  12. #
  13. @@ -144,8 +145,15 @@ setup_net()
  14. do
  15. # Get simplified versions of the network config. variables.
  16. address=$(eval echo \$_ZONECFG_net_${nic}_address)
  17. - dhcp_server=$(get_boolean_nic_property ${nic} dhcp_server)
  18. + # If address set, must be a shared stack zone
  19. + [[ -n $address ]] && exit 0
  20. +
  21. global_nic=$(eval echo \$_ZONECFG_net_${nic}_global_nic)
  22. + # If no global-nic, must be a dedicated physical NIC instead
  23. + # of a vnic
  24. + [[ -z $global_nic ]] && continue
  25. +
  26. + dhcp_server=$(get_boolean_nic_property ${nic} dhcp_server)
  27. mac_addr=$(eval echo \$_ZONECFG_net_${nic}_mac_addr)
  28. vlan_id=$(eval echo \$_ZONECFG_net_${nic}_vlan_id)
  29. blocked_outgoing_ports=$(eval \
  30. @@ -177,12 +185,7 @@ setup_net()
  31. zone_ips=$zone_ip
  32. fi
  33.  
  34. - # If address set, must be a shared stack zone
  35. - [[ -n $address ]] && exit 0
  36.  
  37. - # If no global-nic, must be a dedicated physical NIC instead
  38. - # of a vnic
  39. - [[ -z $global_nic ]] && continue
  40.  
  41. orig_global=$global_nic
  42.  
  43. @@ -211,10 +214,11 @@ setup_net()
  44. tmp=$(echo $orig_global | sed -E 's_[a-zA-Z_0-9]+/[0-9]+__')
  45. if [[ -n "$tmp" ]]; then
  46.  
  47. - global_nic=$(eval echo \$SYSINFO_NIC_${orig_global})
  48. + global_nic=$(grep NIC_$orig_global $SYSINFO | \
  49. + awk -F= '{print $2}' | tr -d \'\\)
  50.  
  51. - # If the global nic is specified as a device or etherstub name
  52. - # rather than a tag
  53. + # If the global nic is specified as a device or
  54. + # etherstub name rather than a tag
  55. if [[ -z $global_nic ]]; then
  56. echo "$(dladm show-phys -p -o LINK) $(dladm show-etherstub -p -o LINK)" \
  57. | egrep "(^| )${orig_global}( |$)" > /dev/null
  58. @@ -417,26 +421,27 @@ setup_net()
  59. fi
  60. fi
  61.  
  62. - # If we aren't using IP spoofing, we'll need to set the allowed-ips
  63. - # property on the NIC so that the zone will be able to ifconfig the
  64. - # proper addresses.
  65. + # If we aren't using IP spoofing, we'll need to set the
  66. + # allowed-ips property on the NIC so that the zone will be able
  67. + # to ifconfig the proper addresses.
  68. if [[ $allow_ip_spoof != "true" ]]; then
  69. unset allowed_ip_map
  70. typeset -A allowed_ip_map
  71.  
  72. OLDIFS=$IFS
  73. IFS=,
  74. +
  75. + # For each static IP available, add it to the list.
  76. for zone_ip in $zone_ips; do
  77. - # For each static IP available, add it to the list.
  78. if [[ $zone_ip != "dhcp" ]] && [[ $zone_ip != "addrconf" ]]; then
  79. clean_ip=`printf "%s" "${zone_ip}" | sed 's|^\([^/]*\)/.*|\1|'`
  80. allowed_ip_map[${clean_ip}]=true
  81. fi
  82. done
  83.  
  84. - # If any additional IPs have been specified (for example, older
  85. - # VMs set up for IPv6 before vmadm gained support), add them to
  86. - # the list.
  87. + # If any additional IPs have been specified (for
  88. + # example, older VMs set up for IPv6 before vmadm gained
  89. + # support), add them to the list.
  90. for allowed_ip in $allowed_ips; do
  91. allowed_ip_map[${allowed_ip}]=true
  92. done
  93. @@ -783,12 +788,6 @@ cleanup_mount()
  94. # Main
  95. #
  96.  
  97. -# Load sysinfo variables with SYSINFO_ prefix
  98. -load_sdc_sysinfo
  99. -# Load config variables with CONFIG_ prefix, and sets the headnode variable
  100. -load_sdc_config
  101. -
  102. -
  103. [[ "$subcommand" == "pre" && $cmd == 0 ]] && setup_fs
  104. if [[ "$subcommand" == "post" && $cmd == 0 ]]; then
  105. [[ -n "$jst_showsnap" ]] && setup_snapshots
Add Comment
Please, Sign In to add comment