Managing Storage URIs and Shared Storage Resources
To generate and verify storage URIs or administer shared storage resources based on storage URIs, use the suriadm
command.
You can use the suriadm
command to verify storage URIs that were created manually, or to create storage URIs automatically, based on existing system device paths. Depending on the storage URI type, the suriadm
command allows you to configure and unconfigure the corresponding storage subsystem. Given a storage URI, the same command can also identify possible instantiated device instances for the storage object described by the storage URI. The following examples demonstrate common use cases. For more information, see the
suriadm
(8) man page.
Example 13-1 Verifying Storage URIs With suriadm parse
The following examples show how to use the suriadm
command to verify storage URIs. In these examples, the storage URI string has been parsed and its corresponding properties are displayed. Once verified, the storage URI can be used later with either the zonecfg
command or the suriadm
command.
root@initiator:~# suriadm parse iscsi://target/luname.naa.600144F035FF8500000050C884E50001 PROPERTY VALUE uri-type iscsi hostname target port - luname naa.600144F035FF8500000050C884E50001 root@host:~# suriadm parse dev:/dev/dsk/c4t1d0 PROPERTY VALUE uri-type dev path /dev/dsk/c4t1d0
Example 13-2 Producing Storage URIs Based on Device Path With suriadm lookup-uri
The following example shows how to use the suriadm
command to produce storage URIs. In the example, based on the existing local device path, the suriadm
command output suggests valid storage URIs for later use with either the suriadm
or zonecfg
commands.
root@target:~# suriadm lookup-uri -t iscsi /dev/dsk/c0t600144F035FF8500000050C884E50001d0 iscsi://target/luname.naa.600144f035ff8500000050c884e50001 root@host:~# suriadm lookup-uri /dev/dsk/c4t1d0 dev:dsk/c4t1d0 root@host:~# suriadm lookup-uri /dev/dsk/c0t600144F0DBF8AF190000510979640005d0 lu:luname.naa.600144f0dbf8af190000510979640005 lu:initiator.naa.10000000c9991d8c,target.naa.21000024ff3ee89f,luname.naa.600144f0dbf8af190000510979640005 dev:dsk/c0t600144F0DBF8AF190000510979640005d0
Example 13-3 Configuring iSCSI based Storage Resources With suriadm map
The following example shows how to use the suriadm map
command to configure iSCSI based storage resources. In this example, for an iSCSI storage URI, the suriadm
configures the iSCSI initiator's send-targets discovery address and instantiates a local device representing the iSCSI target. The local device path from the mapped-dev
storage URI property can now be used with utilities such as the zpool
, format
, and mkfs
commands.
root@initiator:~# suriadm map iscsi://target/luname.naa.600144F035FF8500000050C884E50001
PROPERTY VALUE
mapped-dev /dev/dsk/c0t600144F035FF8500000050C884E50001d0s0
Example 13-4 Locating a Configured Storage Resource With suriadm lookup-mapping
In this example, the command is used to show the local system device currently associated with the given storage URI.
root@initiator:~# suriadm lookup-mapping iscsi://target/luname.naa.600144F035FF8500000050C884E50001
PROPERTY VALUE
mapped-dev /dev/dsk/c0t600144F035FF8500000050C884E50001d0s0
Example 13-5 Unconfiguring iSCSI-Based Storage Resources With suriadm unmap
For an iSCSI storage URI, the suriadm
command removes the iSCSI initiator's send-targets discovery address, and unconfigures the shared storage resource.
root@initiator:~# suriadm unmap iscsi://target/luname.naa.600144F035FF8500000050C884E50001 root@initiator:~# suriadm lookup-mapping iscsi://target/luname.naa.600144F035FF8500000050C884E50001 Failed to lookup mapping for URI: "iscsi://target/luname.naa.600144F035FF8500000050C884E50001": No such logical unit name found: "naa.600144F035FF8500000050C884E50001"