Skip to content

Removing targets

Nareg Sinenian edited this page May 21, 2016 · 6 revisions

Removing Static Targets

Targets (and portals) that were configured using static discovery may be removed:

$ iscsictl remove <target>[,<portal>]

If a specific portal is not specified, the target and all associated portals are removed (the target must not have an active session). If the portal is specified then only that portal is removed (if the portal is not active).

Examples

$ iscsictl remove target iqn.2012-06.com.example:target0,192.168.1.10:3260
The specified portal has been removed

$ iscsictl add target iqn.2012-06.com.example:target0
The specified target has been removed

Removing Dynamic Targets

Targets that were configured using SendTargets discovery (dynamically configured targets) can be removed only by removing their associated discovery portal. The latter is the portal that was used to discover the target. The discovery portal is listed in the target's configuration:

$ iscsictl list target-config iqn.2012-06.com.example:target0
	auto-login: disabled
	discovery portal: 192.168.56.2
	Configuration:
		MaxConnections (1)
		ErrorRecoveryLevel (0)
		HeaderDigest (none)
		DataDigest (none)
	Authentication: none
		CHAP-name 
		CHAP-secret <unspecified>
	192.168.56.2 <inactive, port 3260, interface default>

In this case, the discovery portal is 192.168.56.2. To remove this target, first ensure that there are no active sessions by logging out of the target. Then, remove the discovery portal:

$ iscsictl remove discovery-portal 192.168.56.2
The discovery portal 192.168.56.2 has been removed