Managing Network Virtualization and Network Resources in Oracle® Solaris 11.2

Exit Print View

Updated: September 2014
 
 

Deleting VNICs

This section describes how to delete a VNIC.

How to Delete a VNIC

  1. Become an administrator.
  2. (Optional) Check whether the VNIC is busy.

    You can delete a VNIC only when it is not busy. A VNIC can be busy for multiple reasons. You need to perform the following steps to check whether the VNIC busy:

    • Check whether the VNIC is plumbed and associated with an IP address.
      # ipadm show-if
      # ipadm show-addr

      If the VNIC is plumbed and associated with IP addresses, remove the IP interface.

      # ipadm delete-ip interface
    • Check whether there are any flows configured over the VNIC.
      # flowadm

      If flows are configured over the VNIC, remove the flow.

      # flowadm remove-flow flowname
    • Check whether the VNIC is assigned to a zone.
      # dladm show-link -Z

      For more information about how to delete a VNIC that is attached to a zone, see How to Delete a VNIC Attached to a Zone.

    • Check whether the VNIC is created by the system.
      # dladm show-vnic

      Only a system-created VNIC contains a hyphen (-), which helps you to differentiate between a system-created VNIC and a user-created VNIC. You cannot modify, rename, plumb, or delete system-created VNICs.

    • Check whether the VNIC is snooped.
      # snoop
      # tshark

      If the VNIC is snooped by using the snoop command, kill the process.

      # pkill snoop
      

      If the VNIC is snooped by using the tshark command, kill the process.

      # pkill tshark
  3. Delete the VNIC.
    # dladm delete-vnic VNIC

How to Delete a VNIC Attached to a Zone

This procedure assumes that the VNIC is attached to a zone. You must be in the global zone to perform this procedure.

  1. Halt the zone.
    global# zoneadm -z zone halt

    Note -  To determine the links used by a zone, use the dladm show-link command.
  2. Remove or detach the VNIC from the zone.
    global# zonecfg -z zone remove net physical=VNIC
  3. Delete the VNIC from the system.
    global# dladm delete-vnic VNIC
  4. Reboot the zone.
    global# zoneadm -z zone boot
Example 2-23  Deleting a VNIC Attached to a Zone

In this example, vnic1 is removed from zoneB and from the system.

global# dladm show-link
LINK            CLASS   MTU    STATE   OVER
net0            phys    1500   up      --
net2            phys    1500   up      --
net1            phys    1500   up      --
net3            phys    1500   up      --
zoneA/net0      vnic    1500   up      net0
zoneB/net0      vnic    1500   up      net0
vnic0           vnic    1500   up      net1
zoneA/vnic0     vnic    1500   up      net1
vnic1           vnic    1500   up      net1
zoneB/vnic1     vnic    1500   up      net1

global# zoneadm -z zoneB halt
global# zonecfg -z zoneB remove net physical=vnic1
global# dladm delete-vnic vnic1
global# zoneadm -z zoneB boot