Skip to content
Permalink
Browse files

NET-204: netbooted nodes should be able to add / delete nic tags with…

…out a reboot
  • Loading branch information
Rob Gulewich
Rob Gulewich committed Apr 10, 2013
1 parent d71e608 commit 08fdaa5efa81bebe92545804b36ee31e77fcf6f4
Showing with 852 additions and 134 deletions.
  1. +1 −0 .gitignore
  2. +101 −0 man/src/nictagadm.1m.md
  3. +5 −2 src/Makefile
  4. +2 −0 src/manifest
  5. +717 −0 src/nictagadm
  6. +26 −132 src/sysinfo
@@ -42,6 +42,7 @@ man/man/man1m/vfsstat.1m
man/man/man1m/ziostat.1m
man/man/man1m/dsadm.1m
man/man/man1m/imgadm.1m
man/man/man1m/nictagadm.1m
man/man/man1m/vmadm.1m
man/man/man1m/vmadmd.1m
man/man/man1m/sysinfo.1m
@@ -0,0 +1,101 @@
# nictagadm(1m) -- Manage SmartOS nic tags.


## SYNOPSIS

nictagadm [-v] list
nictagadm [-v] list -l
nictagadm [-v] list -L
nictagadm [-v] add <tag name> <MAC>
nictagadm [-v] add -l <tag name>
nictagadm [-v] update <tag name> <MAC>
nictagadm [-v] delete <tag name>
nictagadm [-v] vms <tag name>


## DESCRIPTION

The nictagadm tool allows you to add, update, delete and display information
about SmartOS nic tags. Both standard nic tags and local-only etherstubs can
be managed.

Nic tags are used in SmartOS to refer to a physical nic without needing its
underlying MAC address or interface name. Both vmadm(1m) and the SmartOS
config file use them as identifiers.

For nodes with /usbkey present, nictagadm will update /usbkey/config as
appropriate, and attempt to mount the original USB key and update its copy
as well. This allows the nic tags to persist across reboots.

For nodes without /usbkey present, nic tags will not persist across reboots
unless the nic tag parameters are passed in as boot parameters at the next
reboot.


## OPTIONS

**-v**
Output verbose diagnostic information

**-?**
Print help and exit.

**-?**
Print help and exit.


## COMMANDS

The following commands and options are supported:

add [-l] <name> [MAC address]

Create a new nic tag on the system. If the '-l' option is specified,
the nic tag will be an etherstub, and the MAC address is not needed.


delete <tag name>

Deletes an existing tag on the system, unless it's in use by any VMs.


list [<options>]

List nic tags on the system.

Options:
-l List etherstubs only.
-L List normal nic tags only.
-p Parseable output.
-d delim Change the delimiter for parseable output. The
default delimiter is ':'.


update <tag name> <new MAC address>

Updates the MAC address associated with a nic tag.


vms <tag name>

Lists UUIDs of VMs using a nic tag.


## EXIT STATUS

The following exit values are returned:

0
Successful completion.

1
An error occurred.

2
Invalid usage.


## SEE ALSO

dladm(1m), sysinfo(1m), vmadm(1m)

@@ -298,11 +298,11 @@ SMARTDC_TARGETS = \
SMARTDC_LIB_TARGETS = \
sdc-on-tty

all: $(TARGETS) sysinfo $(SMARTDC_TARGETS) $(SMARTDC_LIB_TARGETS)
all: $(TARGETS) sysinfo nictagadm $(SMARTDC_TARGETS) $(SMARTDC_LIB_TARGETS)

install: all
mkdir -p $(DESTDIR)/usr/bin
cp -p $(TARGETS) sysinfo $(DESTDIR)/usr/bin
cp -p $(TARGETS) sysinfo nictagadm $(DESTDIR)/usr/bin
mkdir -p $(DESTDIR)/smartdc/bin
cp -p $(SMARTDC_TARGETS) $(DESTDIR)/smartdc/bin
mkdir -p $(DESTDIR)/smartdc/lib
@@ -447,6 +447,9 @@ mkzpool: mkzpool.js
sysinfo:
touch sysinfo

nictagadm:
touch nictagadm

#
# Node native add-on target patterns. Follow these patterns when adding a new
# add-on and see the comment and definitions for EXPAT.NODE above as well.
@@ -357,6 +357,7 @@ f usr/lib/amd64/libiostream.so.1 0755 root bin
d smartdc 0555 root bin
d smartdc/bin 0555 root bin
f smartdc/bin/qemu-exec 0555 root bin
f usr/bin/nictagadm 0555 root bin
f usr/bin/sysinfo 0555 root bin
f usr/bin/bootparams 0555 root bin
f usr/bin/diskinfo 0555 root bin
@@ -517,6 +518,7 @@ f usr/share/man/man1m/sys-unconfig.1m 0444 root bin
f usr/share/man/man1m/ziostat.1m 0444 root bin
f usr/share/man/man1m/vfsstat.1m 0444 root bin
f usr/share/man/man1m/hotplug.1m 0444 root bin
f usr/share/man/man1m/nictagadm.1m 0444 root bin
f usr/share/man/man1m/sysinfo.1m 0444 root bin
f usr/share/man/man1m/zonemon.1m 0444 root bin
f usr/share/man/man1m/zonememstat.1m 0444 root bin

0 comments on commit 08fdaa5

Please sign in to comment.
You can’t perform that action at this time.