meta données pour cette page
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| linux:san_custom [11/01/2026 20:51] – mdl | linux:san_custom [18/01/2026 22:07] (Version actuelle) – supprimée mdl | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| - | ====== SAN CUSTOM - MDL-NAS ====== | ||
| - | |||
| - | * au préalable | ||
| - | * Fedora 43 avec cockpit, TGTD installés | ||
| - | <code BASH> | ||
| - | [root@mdl-nas ~]# dnf install cockpit targetcli nmap | ||
| - | [root@mdl-nas ~]# systemctl enable --now tgtd | ||
| - | [root@mdl-nas ~]# systemctl enable --now cockpit | ||
| - | </ | ||
| - | |||
| - | * ouverture des ports sur le firewall | ||
| - | <code BASH> | ||
| - | [root@mdl-nas ~]# firewall-cmd --add-service=cockpit --permanent | ||
| - | [root@mdl-nas ~]# firewall-cmd --add-port=3260/ | ||
| - | success | ||
| - | |||
| - | |||
| - | [root@mdl-nas ~]# firewall-cmd --reload | ||
| - | success | ||
| - | |||
| - | |||
| - | [root@mdl-nas ~]# firewall-cmd --list-all | ||
| - | public (default, active) | ||
| - | target: default | ||
| - | ingress-priority: | ||
| - | egress-priority: | ||
| - | icmp-block-inversion: | ||
| - | interfaces: enp3s0f0 enp5s0 | ||
| - | sources: | ||
| - | services: cockpit dhcpv6-client mdns ssh | ||
| - | ports: 3260/tcp | ||
| - | protocols: | ||
| - | forward: yes | ||
| - | masquerade: no | ||
| - | forward-ports: | ||
| - | source-ports: | ||
| - | icmp-blocks: | ||
| - | rich rules: | ||
| - | |||
| - | </ | ||
| - | |||
| - | * raid 5 sur 8 ssd de 500GB (créé avec le cockpit) | ||
| - | * on y a créé un Volume-group et 2 logical-volume pour nos 2 hyperviseurs | ||
| - | <code BASH> | ||
| - | [root@mdl-nas ~]# pvs | ||
| - | PV | ||
| - | /dev/md127 vgroup0 lvm2 a-- | ||
| - | / | ||
| - | |||
| - | [root@mdl-nas ~]# lvs | ||
| - | LV VG Attr | ||
| - | root fedora | ||
| - | lv_hyper-v1 vgroup0 -wi-ao---- 558, | ||
| - | lv_hyper-v2 vgroup0 -wi-ao---- | ||
| - | |||
| - | </ | ||
| - | |||
| - | * Creation ISCI portal et LUN (bridage de la publication des LUN sur les IP des interfaces des initiateurs) | ||
| - | <code BASH> | ||
| - | # avec TGTADM (plus d' | ||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.fr.delag.labo.mdl-nas: | ||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op bind --mode target --tid 1 -I 10.6.0.5 | ||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 0 -b / | ||
| - | |||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op new --mode target --tid 2 -T iqn.fr.delag.labo.mdl-nas: | ||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op bind --mode target --tid 2 -I 10.6.0.6 | ||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op new --mode logicalunit --tid 2 --lun 1 -b / | ||
| - | |||
| - | # avec un script fournis par le package | ||
| - | [root@mdl-nas ~]# tgt-setup-lun -n iqn.fr.delag.labo.mdl-nas: | ||
| - | [root@mdl-nas ~]# tgt-setup-lun -n iqn.fr.delag.labo.mdl-nas: | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | * affichage LUN et portail | ||
| - | <code BASH> | ||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op show --mode portal | ||
| - | Portal: [::]:3260,1 | ||
| - | Portal: 0.0.0.0: | ||
| - | |||
| - | |||
| - | [root@mdl-nas ~]# tgtadm --lld iscsi --op show --mode target | ||
| - | Target 1: iqn.fr.delag.labo.mdl-nas: | ||
| - | System information: | ||
| - | Driver: iscsi | ||
| - | State: ready | ||
| - | I_T nexus information: | ||
| - | I_T nexus: 1 | ||
| - | Initiator: iqn.fr.delag.labo.hyper-v1 alias: none | ||
| - | Connection: 1 | ||
| - | IP Address: 10.6.0.5 | ||
| - | LUN information: | ||
| - | LUN: 0 | ||
| - | Type: controller | ||
| - | SCSI ID: IET | ||
| - | SCSI SN: beaf10 | ||
| - | Size: 0 MB, Block size: 1 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: null | ||
| - | Backing store path: None | ||
| - | Backing store flags: | ||
| - | LUN: 1 | ||
| - | Type: disk | ||
| - | SCSI ID: IET | ||
| - | SCSI SN: beaf11 | ||
| - | Size: 599999 MB, Block size: 512 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: rdwr | ||
| - | Backing store path: / | ||
| - | Backing store flags: | ||
| - | Account information: | ||
| - | ACL information: | ||
| - | 10.6.0.5 | ||
| - | Target 2: iqn.fr.delag.labo.mdl-nas: | ||
| - | System information: | ||
| - | Driver: iscsi | ||
| - | State: ready | ||
| - | I_T nexus information: | ||
| - | I_T nexus: 2 | ||
| - | Initiator: iqn.fr.delag.labo.hyper-v2 alias: hyper-v2 | ||
| - | Connection: 0 | ||
| - | IP Address: 10.6.0.6 | ||
| - | LUN information: | ||
| - | LUN: 0 | ||
| - | Type: controller | ||
| - | SCSI ID: IET | ||
| - | SCSI SN: beaf20 | ||
| - | Size: 0 MB, Block size: 1 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: null | ||
| - | Backing store path: None | ||
| - | Backing store flags: | ||
| - | LUN: 1 | ||
| - | Type: disk | ||
| - | SCSI ID: 360000000000000000e00000000020001 | ||
| - | SCSI SN: beaf20 | ||
| - | Size: 1538672 MB, Block size: 512 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: rdwr | ||
| - | Backing store path: / | ||
| - | Backing store flags: | ||
| - | Account information: | ||
| - | ACL information: | ||
| - | 10.6.0.6 | ||
| - | |||
| - | </ | ||
| - | |||
| - | **<color # | ||
| - | |||
| - | |||
| - | == Rendre persistant les target == | ||
| - | * Cela est possible en créant le fichier /// | ||
| - | * backing-store: | ||
| - | * direct-store: | ||
| - | <code BASH> | ||
| - | [root@mdl-nas ~]# vi / | ||
| - | |||
| - | # simple en backing-store | ||
| - | <target iqn.fr.delag.labo.mdl-nas: | ||
| - | backing-store / | ||
| - | initiator-address 10.6.0.5 | ||
| - | </ | ||
| - | |||
| - | |||
| - | # plus complet en direct-store | ||
| - | <target iqn.fr.delag.labo.mdl-nas: | ||
| - | controller_tid 2 # must be unique | ||
| - | initiator-address 10.6.0.6 # restrict allowed client | ||
| - | < | ||
| - | | ||
| - | # | ||
| - | # | ||
| - | | ||
| - | | ||
| - | | ||
| - | lun 1 | ||
| - | </ | ||
| - | </ | ||
| - | |||
| - | |||
| - | # | ||
| - | |||
| - | </ | ||
| - | |||
| - | * on recharge la conf | ||
| - | <code BASH> | ||
| - | [root@mdl-nas ~]# systemctl reload tgtd.service | ||
| - | [root@mdl-nas ~]# | ||
| - | [root@mdl-nas ~]# | ||
| - | [root@mdl-nas ~]# | ||
| - | [root@mdl-nas ~]# systemctl status tgtd.service | ||
| - | ● tgtd.service - tgtd iSCSI target daemon | ||
| - | | ||
| - | Drop-In: / | ||
| - | | ||
| - | | ||
| - | | ||
| - | Process: 13169 ExecReload=/ | ||
| - | Main PID: 1054 (tgtd) | ||
| - | Tasks: 1 (limit: 9368) | ||
| - | | ||
| - | CPU: 1.344s | ||
| - | | ||
| - | | ||
| - | |||
| - | janv. 08 21:16:30 mdl-nas.delag.labo.fr systemd[1]: Starting tgtd.service - tgtd iSCSI target daemon... | ||
| - | janv. 08 21:16:31 mdl-nas.delag.labo.fr tgtd[1054]: tgtd: iser_ib_init(3431) Failed to initialize RDMA; load kernel modules? | ||
| - | janv. 08 21:16:31 mdl-nas.delag.labo.fr tgtd[1054]: tgtd: work_timer_start(146) use timer_fd based scheduler | ||
| - | janv. 08 21:16:31 mdl-nas.delag.labo.fr tgtd[1054]: tgtd: bs_init(387) use signalfd notification | ||
| - | janv. 08 21:16:36 mdl-nas.delag.labo.fr systemd[1]: Started tgtd.service - tgtd iSCSI target daemon. | ||
| - | janv. 09 07:43:55 mdl-nas.delag.labo.fr systemd[1]: Reloading tgtd.service - tgtd iSCSI target daemon... | ||
| - | janv. 09 07:43:55 mdl-nas.delag.labo.fr systemd[1]: Reloaded tgtd.service - tgtd iSCSI target daemon. | ||
| - | |||
| - | </ | ||
| - | |||
| - | |||
| - | * on affiche la conf | ||
| - | <code BASH> | ||
| - | [root@mdl-nas ~]# tgtadm --mode target --op show | ||
| - | Target 1: iqn.fr.delag.labo.mdl-nas: | ||
| - | System information: | ||
| - | Driver: iscsi | ||
| - | State: ready | ||
| - | I_T nexus information: | ||
| - | I_T nexus: 1 | ||
| - | Initiator: iqn.fr.delag.labo.hyper-v1 alias: none | ||
| - | Connection: 1 | ||
| - | IP Address: 10.6.0.5 | ||
| - | LUN information: | ||
| - | LUN: 0 | ||
| - | Type: controller | ||
| - | SCSI ID: IET | ||
| - | SCSI SN: beaf10 | ||
| - | Size: 0 MB, Block size: 1 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: null | ||
| - | Backing store path: None | ||
| - | Backing store flags: | ||
| - | LUN: 1 | ||
| - | Type: disk | ||
| - | SCSI ID: IET | ||
| - | SCSI SN: beaf11 | ||
| - | Size: 599999 MB, Block size: 512 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: rdwr | ||
| - | Backing store path: / | ||
| - | Backing store flags: | ||
| - | Account information: | ||
| - | ACL information: | ||
| - | 10.6.0.5 | ||
| - | Target 2: iqn.fr.delag.labo.mdl-nas: | ||
| - | System information: | ||
| - | Driver: iscsi | ||
| - | State: ready | ||
| - | I_T nexus information: | ||
| - | I_T nexus: 2 | ||
| - | Initiator: iqn.fr.delag.labo.hyper-v2 alias: hyper-v2 | ||
| - | Connection: 0 | ||
| - | IP Address: 10.6.0.6 | ||
| - | LUN information: | ||
| - | LUN: 0 | ||
| - | Type: controller | ||
| - | SCSI ID: IET | ||
| - | SCSI SN: beaf20 | ||
| - | Size: 0 MB, Block size: 1 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: null | ||
| - | Backing store path: None | ||
| - | Backing store flags: | ||
| - | LUN: 1 | ||
| - | Type: disk | ||
| - | SCSI ID: 360000000000000000e00000000020001 | ||
| - | SCSI SN: beaf20 | ||
| - | Size: 1538672 MB, Block size: 512 | ||
| - | Online: Yes | ||
| - | Removable media: No | ||
| - | Prevent removal: No | ||
| - | Readonly: No | ||
| - | SWP: No | ||
| - | Thin-provisioning: | ||
| - | Backing store type: rdwr | ||
| - | Backing store path: / | ||
| - | Backing store flags: | ||
| - | Account information: | ||
| - | ACL information: | ||
| - | 10.6.0.6 | ||
| - | |||
| - | </ | ||
| - | |||