OpenSolaris

You are not signed in. Sign in or register.

Understanding the service model of COMSTAR

The target mode framework runs as a service just like any other smf(5) service. The name of the service is stmf. Once you install comstar, you can locate the service using svcs(1) command.

# svcs stmf
disabled       15:58:17 svc:/system/device/stmf:default
#

By default (after installation), the stmf service is disabled. You can enable the service as:

# svcadm enable stmf
# svcs stmf
online         15:59:53 svc:/system/device/stmf:default
#

You can also view the current service state as:

# stmfadm list-state
Operational Status: online
Config Status     : initialized
# 

COMSTAR uses smf(5) to store its persistent state (basically current configuration like LUN mapping and masking configuration, Host group and target group definitions, etc.). When the service is enabled during boot or by svcadm it clears any stale configuration data inside the kernel framework and reloads the configuration from smf repository into the driver.

Once the configuration is loaded any changes made to the configuration via stmfadm CLI will be automatically updated inside the driver database as well as inside the SMF repository. This way all the configuration changes persist across reboots.

Clearing the old config and starting fresh

Some of the steps below may fail and thats ok as this is a catch-all sequence.

# svcadm disable stmf
# svcadm clear stmf

Note that the step below will remove any driver aliases to say qlt or mptt. You may want to keep a note of them (from /etc/driver_aliases).

# pkgrm SUNWstmf
# svccfg delete -f stmf
# reboot
…
# pkgadd SUNWstmf
# <Update/add driver aliases> See Downloading and Installing for details.
# svcadm enable stmf

Backup and restore of the configuration information

All of the COMSTAR configuration information is kept under the stmf FMRI in smf(5). The step below will export the current configuration information for COMSTAR.

# svccfg export -a stmf > COMSTAR.backup

The -a option is critical as there are read-protected properties that will not get exported without it.


Please note that there is an existing bug in 'svccfg export' that will cause data to be silently lost on export when the persisted logical unit data (stored in the provider_data_pg_sbd property group) exceeds 2k. Refer to 6694511 for more details. Unfortunately, since the truncation is silent, there is no way to determine when data has been lost on export. Until CR 6694511 is integrated, export on the stmf service should not be used.


The COMSTAR configuration can be restored using the exported file on a new COMSTAR package installation or alternately it can be restored after issuing a delete on the stmf service ('svccfg delete -f stmf').

# svccfg import COMSTAR.backup