Created
February 12, 2024 19:44
-
-
Save dginhoux/087d911e48a9a18837e7f1b9878ff543 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
h1. installation d'une qla25xx dans tina-save-cat | |
h1. création des backstores/fileio | |
<pre><code class="coffeescript"> | |
mkdir -p /var/ibm.quorum | |
chown -R root:root /var/ibm.quorum | |
dd if=/dev/zero of=/var/ibm.quorum/quorum1.disk count=1024 bs=1M | |
chown root:root /var/ibm.quorum/quorum1.disk | |
chmod 644 /var/ibm.quorum/quorum1.disk | |
</code></pre> | |
h1. installation de targetcli et des firmware qla2xxxx | |
<pre><code class="coffeescript"> | |
apt install -y targetcli-fb firmware-qlogic | |
tee /etc/modprobe.d/qla2xxx.conf <<EOF | |
## disable initiator mode | |
options qla2xxx qlini_mode=disabled | |
EOF | |
</code></pre> | |
h1. create targetd config folder | |
<pre><code class="coffeescript"> | |
mkdir -p /etc/targetd | |
chown -R root:root /etc/targetd | |
</code></pre> | |
h1. create targetd systemd unit | |
<pre><code class="coffeescript"> | |
tee /etc/targetd/targetd.service <<EOF | |
[Unit] | |
Description=Restore LIO kernel target configuration | |
Requires=sys-kernel-config.mount | |
After=sys-kernel-config.mount network.target local-fs.target | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/usr/bin/targetctl restore /etc/targetd/config.json | |
ExecStop=/usr/bin/targetctl clear | |
SyslogIdentifier=target | |
[Install] | |
WantedBy=multi-user.target | |
EOF | |
cp -m 644 /etc/targetd/targetd.service /etc/systemd/system/targetd.service | |
chown root:root /etc/systemd/system/targetd.service | |
chmod 644 /etc/systemd/system/targetd.service | |
systemctl daemon-reload | |
systemctl enable targetd.service | |
</code></pre> | |
h1. configuration de targetd | |
<pre><code class="coffeescript"> | |
targetcli | |
</code></pre> | |
<pre><code class="coffeescript"> | |
/> qla2xxx/ info | |
Fabric module name: qla2xxx | |
ConfigFS path: /sys/kernel/config/target/qla2xxx | |
Allowed WWN types: naa | |
Allowed WWNs list: naa.21000024ff2de292, naa.21000024ff2de293 | |
Fabric module features: acls | |
Corresponding kernel module: tcm_qla2xxx | |
/> qla2xxx/ create naa.21000024ff2de292 | |
/> qla2xxx/ create naa.21000024ff2de293 | |
/> /backstores/fileio create file_or_dev=/var/ibm.quorum/quorum1.disk name=quorum1 | |
/> qla2xxx/naa.21000024ff2de292/luns create /backstores/fileio/quorum1 lun=1 | |
/> qla2xxx/naa.21000024ff2de293/luns create /backstores/fileio/quorum1 lun=1 | |
/> qla2xxx/naa.21000024ff2de293/acls create wwn=50:05:07:68:10:14:bd:e9 | |
/> qla2xxx/naa.21000024ff2de293/acls create wwn=50:05:07:68:10:14:bc:43 | |
/> qla2xxx/naa.21000024ff2de293/acls create wwn=50:05:07:68:10:14:bc:30 | |
/> qla2xxx/naa.21000024ff2de293/acls create wwn=50:05:07:68:10:14:bc:ae | |
/> qla2xxx/naa.21000024ff2de292/acls create wwn=50:05:07:68:10:13:bd:e9 | |
/> qla2xxx/naa.21000024ff2de292/acls create wwn=50:05:07:68:10:13:bc:43 | |
/> qla2xxx/naa.21000024ff2de292/acls create wwn=50:05:07:68:10:13:bc:30 | |
/> qla2xxx/naa.21000024ff2de292/acls create wwn=50:05:07:68:10:13:bc:ae | |
/> saveconfig savefile=/etc/targetd/config.json | |
/> qla2xxx/ ls | |
o- qla2xxx ........................................................................................................... [Targets: 2] | |
o- naa.21000024ff2de292 .............................................................................................. [gen-acls] | |
| o- acls ............................................................................................................. [ACLs: 4] | |
| | o- naa.500507681013bc30 .................................................................................... [Mapped LUNs: 1] | |
| | | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| | o- naa.500507681013bc43 .................................................................................... [Mapped LUNs: 1] | |
| | | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| | o- naa.500507681013bcae .................................................................................... [Mapped LUNs: 1] | |
| | | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| | o- naa.500507681013bde9 .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- luns ............................................................................................................. [LUNs: 1] | |
| o- lun1 .................................................. [fileio/quorum1 (/var/ibm.quorum/quorum1.disk) (default_tg_pt_gp)] | |
o- naa.21000024ff2de293 .............................................................................................. [gen-acls] | |
o- acls ............................................................................................................. [ACLs: 4] | |
| o- naa.500507681014bc30 .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- naa.500507681014bc43 .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- naa.500507681014bcae .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- naa.500507681014bde9 .................................................................................... [Mapped LUNs: 1] | |
| o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
o- luns ............................................................................................................. [LUNs: 1] | |
o- lun1 .................................................. [fileio/quorum1 (/var/ibm.quorum/quorum1.disk) (default_tg_pt_gp)] | |
</code></pre> | |
h1. test systemd unit | |
<pre><code class="coffeescript"> | |
/usr/bin/targetctl clear | |
targetcli qla2xxx/ ls | |
o- qla2xxx ........................................................................................................... [Targets: 0] | |
systemctl status targetd.service | |
systemctl stop targetd.service | |
targetcli qla2xxx/ ls | |
o- qla2xxx ........................................................................................................... [Targets: 0] | |
</code></pre> | |
<pre><code class="coffeescript"> | |
systemctl start targetd.service | |
systemctl status targetd.service | |
● targetd.service - Restore LIO kernel target configuration | |
Loaded: loaded (/etc/systemd/system/targetd.service; enabled; vendor preset: enabled) | |
Active: active (exited) since Wed 2024-01-31 10:45:20 CET; 9s ago | |
Process: 6498 ExecStart=/usr/bin/targetctl restore /etc/targetd/config.json (code=exited, status=0/SUCCESS) | |
Main PID: 6498 (code=exited, status=0/SUCCESS) | |
janv. 31 10:45:10 tina-save-cat systemd[1]: Starting Restore LIO kernel target configuration... | |
janv. 31 10:45:20 tina-save-cat systemd[1]: Started Restore LIO kernel target configuration. | |
root@tina-save-cat:/etc/targetd# targetcli qla2xxx/ ls | |
o- qla2xxx ........................................................................................................... [Targets: 2] | |
o- naa.21000024ff2de292 .............................................................................................. [gen-acls] | |
| o- acls ............................................................................................................. [ACLs: 4] | |
| | o- naa.500507681013bc30 .................................................................................... [Mapped LUNs: 1] | |
| | | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| | o- naa.500507681013bc43 .................................................................................... [Mapped LUNs: 1] | |
| | | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| | o- naa.500507681013bcae .................................................................................... [Mapped LUNs: 1] | |
| | | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| | o- naa.500507681013bde9 .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- luns ............................................................................................................. [LUNs: 1] | |
| o- lun1 .................................................. [fileio/quorum1 (/var/ibm.quorum/quorum1.disk) (default_tg_pt_gp)] | |
o- naa.21000024ff2de293 .............................................................................................. [gen-acls] | |
o- acls ............................................................................................................. [ACLs: 4] | |
| o- naa.500507681014bc30 .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- naa.500507681014bc43 .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- naa.500507681014bcae .................................................................................... [Mapped LUNs: 1] | |
| | o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
| o- naa.500507681014bde9 .................................................................................... [Mapped LUNs: 1] | |
| o- mapped_lun1 ................................................................................. [lun1 fileio/quorum1 (rw)] | |
o- luns ............................................................................................................. [LUNs: 1] | |
o- lun1 .................................................. [fileio/quorum1 (/var/ibm.quorum/quorum1.disk) (default_tg_pt_gp)] | |
</code></pre> | |
<pre><code class="coffeescript"> | |
systemctl stop targetd.service | |
targetcli qla2xxx/ ls | |
o- qla2xxx ........................................................................................................... [Targets: 0] | |
</code></pre> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment