Applies to: Windows Server 2019, Windows Server 2022 and Windows Server 2025, subject to the workload and edition requirements below.
Understand the block-storage boundary
The iSCSI Target Server role presents a virtual disk to an authorized remote initiator over a storage network. The initiator sees a block device and creates its own partitions and file system. This differs from SMB, where the file server owns the file system and serves files. The distinction determines permissions, backup ownership and the consequences of a lost connection: a network interruption can become a disk outage for the application.
This guide creates one new VHDX-backed iSCSI disk on STORAGE01 and assigns it to APP01. It is a standalone example, not a clustered shared-disk deployment. Never allow two independent non-cluster-aware hosts to write to the same disk. A target that accepts both initiators does not provide file-system coordination; concurrent mounting can corrupt data. Cluster use requires a supported cluster design, validation and application-specific procedures.
Prepare capacity, network isolation and initiator identity
Use a dedicated data location for the VHDX, supported underlying storage and sufficient physical capacity. A dynamically expanding virtual disk can be logically larger than its current file, so monitor the backing volume independently from the initiator’s free-space view. Exhausting the target’s storage can interrupt writes even when the guest disk appears to have space. Decide whether fixed allocation is required by the capacity design.
Record the initiator IQN directly from APP01 rather than typing a guessed server name. An IQN is an access identifier, not an encryption mechanism or strong proof that a packet came from a particular physical machine. Limit TCP 3260 to the approved storage network and initiator addresses. Use CHAP where the design calls for it, and an appropriate protected transport or isolated network when confidentiality is required; CHAP authentication does not encrypt storage payloads.
# On APP01:
Get-InitiatorPort | Select-Object NodeAddress,PortAddress
# On STORAGE01:
Get-Volume -DriveLetter D
Get-WindowsFeature FS-iSCSITarget-Server
Install the target and create a new virtual disk
On STORAGE01, use elevated Windows PowerShell to install the role and tools. Confirm the volume and intended path before creating a disk. The example uses a new 200 GB dynamically expanding VHDX, the cmdlet’s default allocation behaviour. It does not format an existing disk on APP01 and should not overwrite a VHDX already in use.
Install-WindowsFeature FS-iSCSITarget-Server -IncludeManagementTools
New-Item -ItemType Directory -Path 'D:\iSCSI' -Force | Out-Null
Test-Path -LiteralPath 'D:\iSCSI\AppData.vhdx'
New-IscsiVirtualDisk -Path 'D:\iSCSI\AppData.vhdx' -Size 200GB
Get-IscsiVirtualDisk -Path 'D:\iSCSI\AppData.vhdx'If Test-Path returns True, stop and identify the existing file instead of changing its size or deleting it. Retain the creation result and review the reported path and capacity. Restrict access to the VHDX directory to the target service and authorized administrators as required; do not expose it as an ordinary writable SMB share. Backups of the backing VHDX must account for active I/O and application consistency.
Authorize one initiator and map the disk
Create a descriptive target and specify the exact initiator IQN. The example IQN is illustrative and must be replaced by APP01’s recorded value. Mapping associates the VHDX with that target; it does not yet mean that APP01 has connected or that the application can use a file system.
New-IscsiServerTarget -TargetName 'AppServer01' `
-InitiatorIds 'IQN:iqn.1991-05.com.microsoft:app01.corp.example'
Add-IscsiVirtualDiskTargetMapping -TargetName 'AppServer01' `
-Path 'D:\iSCSI\AppData.vhdx'
Get-IscsiServerTarget -TargetName 'AppServer01' | Format-List *Inspect the authorized initiator list and LUN mapping. Avoid wildcard or catch-all access rules. If CHAP is required, configure it on the target before the initiator login and supply the matching approved credentials through a secure method. Do not put production secrets into a shared script, screenshot or article transcript. Keep the target network listener and firewall scope aligned with the isolated storage interface rather than accepting connections on every public-facing path.
Discover and connect from the initiator
On APP01, ensure the Microsoft iSCSI Initiator service is available and start it under the approved startup policy. Add the storage portal using its private storage address. Discovery can show more than one target, so select the exact target IQN reported by STORAGE01; never connect to the first returned object merely because it exists.
# On APP01; replace the private storage address:
Start-Service MSiSCSI
Set-Service MSiSCSI -StartupType Automatic
New-IscsiTargetPortal -TargetPortalAddress '10.20.30.10'
Get-IscsiTarget | Select-Object NodeAddress,IsConnected
# Set this to the exact intended target IQN from discovery:
$targetIqn = 'iqn.example:replace-with-actual-target-iqn'
Connect-IscsiTarget -NodeAddress $targetIqn `
-TargetPortalAddress '10.20.30.10' -IsPersistent $trueThe sample connection assumes a deliberately approved non-CHAP isolated-network example. If CHAP is configured, use matching authentication parameters or the initiator console instead; do not disable the target’s requirement to make this line work. Persistent login reconnects after restart but does not provide multiple paths. MPIO needs its own supported installation, device claiming and path configuration before multipath connection options are meaningful.
Identify the new disk before initialization
After connecting, inspect the disks on APP01. Correlate the new disk’s size, bus type, unique identifier and target/session mapping. Record disk inventory before and after connection if multiple new disks could appear. A disk number is not a stable identity and should not be copied from another server’s instructions.
Get-IscsiSession
Get-IscsiConnection
Get-Disk | Select-Object Number,FriendlyName,SerialNumber,UniqueId,BusType,PartitionStyle,OperationalStatus,SizeOnly a verified new, empty disk should be brought online, initialized as GPT, partitioned and formatted through Disk Management or a carefully scoped storage procedure. This guide deliberately does not pipe all RAW disks into Initialize-Disk: another uninitialized device may contain recoverable data or belong to a different application. If the disk already has a partition table, stop and identify it. Formatting the initiator’s disk changes the VHDX content on the target and is not reversed by disconnecting.
Verify persistence and diagnose connection failures
Once a test volume is prepared, use disposable content to verify normal reads and writes and perform an application-aware backup and restore test. In a planned window, verify the expected reconnection behaviour after a restart. Monitor both the initiator volume and the target backing volume. Confirm that no unintended initiator can discover or log in to the restricted target.
If discovery fails, check storage-interface addressing, routing, TCP 3260 and target listener/firewall scope. If discovery works but login fails, check the exact IQN allowlist and CHAP settings. If login succeeds but no usable disk appears, inspect target mappings, disk offline state, storage events and existing signatures. For intermittent latency or resets, correlate initiator and target timestamps with network loss, backing-disk latency and storage-capacity pressure. Do not repeatedly disconnect an active application disk as a diagnostic shortcut.
Remove access without losing the virtual disk
To roll back before production use, stop any test application, remove its dependency on the volume, and take the disk offline cleanly on the initiator. Remove persistent-session registration as appropriate, then disconnect the intended target. Confirm there are no remaining sessions or writes before removing the VHDX mapping or target object on STORAGE01. Retain the VHDX until its ownership and recovery requirements are settled.
For an established workload, copy or migrate data through an application-supported process and verify a recoverable backup first. Removing a mapping is an availability change, while deleting the VHDX destroys the backing data. Treat those as separate decisions. Record portal addresses, initiator and target IQNs, LUNs, capacity, authentication ownership and recovery sequence so that an operator can restore storage connectivity without accidentally presenting the disk to a competing host.
Related guidance and official references
Create a mirrored Storage Spaces volume; Scope a Windows Firewall rule; Validate a failover cluster.