Once you have an iSCSI target defined, as you did in the Creating an iSCSI target recipe, you can use it. Essentially, to use the disk, you connect to the iSCSI target server (that is, SRV1
). Once you're connected, the Get-Disk
cmdlet returns the iSCSI disk as though it were a local disk. You can then format and use the iSCSI disk as though it were local.
This recipe uses the iSCSI target you created in the Creating an iSCSI target recipe. You use SRV1
as the iSCSI target and access the target from the iSCSI initiator (FS1
).
On
FS1
, set the iSCSI service to start automatically, then start the service:Set-Service MSiSCSI -StartupType 'Automatic' Start-Service MSiSCSI
Set up the portal to
SRV1
:$PHT = @{ TargetPortalAddress = 'SRV1.Reskit.Org' TargetPortalPortNumber = 3260 } New-IscsiTargetPortal @PHT
Find and view the
SalesTarget
on the portal:$Target = Get-IscsiTarget | Where-Object NodeAddress -Match 'SalesTarget' $Target...