6.10. Création d'un LUN iSCSI en lecture seule
Par défaut, les LUN sont créés avec des permissions de lecture-écriture. Cette procédure décrit comment créer une LUN en lecture seule.
Conditions préalables
-
Installation et exécution de
targetcli
. Pour plus d'informations, voir Installation de targetcli. - Une cible iSCSI associée à un groupe de portail cible (TPG). Pour plus d'informations, voir Création d'une cible iSCSI.
- Objets de stockage créés. Pour plus d'informations, voir iSCSI Backstore.
Procédure
Définir les autorisations de lecture seule :
/> set global auto_add_mapped_luns=false Parameter auto_add_mapped_luns is now 'false'.
/> set global auto_add_mapped_luns=false Parameter auto_add_mapped_luns is now 'false'.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Cela empêche le mappage automatique des LUN aux ACL existants, ce qui permet le mappage manuel des LUN.
Naviguez jusqu'au répertoire initiator_iqn_name:
/> iscsi/target_iqn_name/tpg1/acls/initiator_iqn_name/
/> iscsi/target_iqn_name/tpg1/acls/initiator_iqn_name/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Créer le LUN :
/iscsi/nom_de_la_cible/tpg1/acls/initiator_iqn_name> create mapped_lun=next_sequential_LUN_number tpg_lun_ou_backstore=backstore write_protect=1
/iscsi/nom_de_la_cible/tpg1/acls/initiator_iqn_name> create mapped_lun=next_sequential_LUN_number tpg_lun_ou_backstore=backstore write_protect=1
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Exemple :
/iscsi/target_iqn_name/tpg1/acls/2006-04.com.example:888> create mapped_lun=1 tpg_lun_or_backstore=/backstores/block/block2 write_protect=1 Created LUN 1. Created Mapped LUN 1.
/iscsi/target_iqn_name/tpg1/acls/2006-04.com.example:888> create mapped_lun=1 tpg_lun_or_backstore=/backstores/block/block2 write_protect=1 Created LUN 1. Created Mapped LUN 1.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Vérifiez le LUN créé :
/iscsi/target_iqn_name/tpg1/acls/2006-04.com.example:888> ls o- 2006-04.com.example:888 .. [Mapped LUNs: 2] | o- mapped_lun0 .............. [lun0 block/disk1 (rw)] | o- mapped_lun1 .............. [lun1 block/disk2 (ro)]
/iscsi/target_iqn_name/tpg1/acls/2006-04.com.example:888> ls o- 2006-04.com.example:888 .. [Mapped LUNs: 2] | o- mapped_lun0 .............. [lun0 block/disk1 (rw)] | o- mapped_lun1 .............. [lun1 block/disk2 (ro)]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow La ligne mapped_lun1 comporte désormais (
ro
) à la fin (contrairement à la ligne mapped_lun0 (rw
)), indiquant qu'elle est en lecture seule.- Configurez les ACL. Pour plus d'informations, voir Création d'une ACL iSCSI.