Gerer le ISCSI
Exemple de scénario pour utiliser le module ISCSI Target de Windows Server 2012 afin de présenter du stockage via ISCSI
Sur le serveur Target :
=======================
0 - Add-WindowsFeature FS-iSCSITarget-Server
NB : ajouter aussi le fournisseur VSS et VDS si resuis par les initiateurs
1 - LUN creation: New-IscsiVirtualDisk c:\test\Disk-01.vhd –size 1GB
NB: f you want to load an existing VHD file, use Import-IscsiVirtualDisk command.
2 - Target creation: New-IscsiServerTarget TestTarget2 –InitiatorIds “IQN: iqn.1991-05.com.Microsoft:VM1.contoso.com”
Pour connaitre IQN sur initiator, taper simplement sur l'initiateur : iscsicli
3 - Assign VHD to Target: Add-IscsiVirtualDiskTargetMapping TestTarget2 c:\test\Disk-01.vhd
Sur le serveur Initiator : Nom de serveur NETBOOT-1
=========================
1 - Démarrage et configuration du service Initiator Microsoft :
Start-Service msiscsi
Set-Service msiscsi –StartupType “Automatic”
2 - Specify the iSCSI Target Server name:
New-IscsiTargetPortal –TargetPortalAddress Target-Server-Name
This is similar to the discovery in the UI.
3 - Get the available Targets (this is optional):
Get-IscsiTarget
4 - Connect:
Connect-IscsiTarget –NodeAddress “iqn.1991-05.com.microsoft:netboot-1-nettarget-target”
If you want to connect all the Targets, you can also type:
Get-IscsiTarget | Connect-IscsiTarget
5 - Register the Target as Favorite target, so that, it will reconnect upon initiator machine reboot.
Register-IscsiSession -SessionIdentifier "fffffa8004146020-4000013700000007"
NB: Vous avez récuperer le(s) SessionIdentifier lors de la commande précédente car elle(s) s'affiche(nt)
Initialiser le disque :
=======================
1. Check if the initiator can see the disk:
Get-disk
2. Bring disk 3 online:
Set-disk –number 3 –IsOffline 0
3. Make disk 3 writable:
Set-disk –number 3 –isReadOnly 0
4. Initialize the disk 3:
Initialize-Disk -Number 3 -PartitionStyle MBR
5. Create a partition on disk 3 (To avoid a format volume popup in Windows Explorer, let’s not assign a drive letter at this time. We will do that after the volume is formatted)
New-Partition -DiskNumber 3 -UseMaximumSize -AssignDriveLetter:$False
6. Format volume:
Get-Partition –DiskNumber 3 | Format-Volume
7. Assign the drive letter now:
Get-Partition –DiskNumber 3 | Add-PartitionAccessPath –AssignDriveLetter:$true
ISCSICPL.EXE
==================================================================================================================
==================================================================================================================
----------------- Configurer le ISCSI -----------------------------------------------------------------------------------------------------
==================================================================================================================
Lancer ISCSICPL.EXE
Il est possible de lancer directement l'outil de configuration de l'initiateur ICSCI sur les serveurs Hyper-V ^meen mode
Core ou en Hyper-V Server
L'interfacesemi-graphique de paramétrage que vou connaissez certainement apparait. Il vous reste à définir vos "Portal",
vos "target" et gérer les connexions automatiques (et le multipath ci nécessaire)
==================================================================================================================
ISCSICLI.EXE
==================================================================================================================
==================================================================================================================
Voir les Iqn iSCSI :
==============
taper : iscsicli