Как удалить wwn targetcli
targetcli is the community edition single-node Unified Target management shell by RisingTide Systems (RTS). RTSadmin is the commercial version of targetcli.
Contents
- 1 Overview
- 2 Linux distributions
- 3 Quick start guide
- 3.1 Startup
- 3.2 Navigate the object tree
- 3.3 Display the object tree
- 3.4 Display help
- 3.5 Create a backstore
- 3.6 Create a target
- 3.7 Persist the configuration
- 4.1 General
- 4.2 Working with contexts
- 4.3 Command completion
- 4.4 Command syntax
- 4.5 Command chains
- 4.6 Global parameters
- 5.1 Fabric objects
- 5.2 Storage objects
Overview
targetcli comprises a shell that uses the RTS library through a well-defined API. Thus targetcli can easily be replaced or complemented by a UI with other metaphors, such as a GUI, to provide the same functionality by different means.
targetcli was released on October 14, 2009 ( 2009-10-14 ) , and supports all fabric modules, including iSCSI, Fibre Channel, FCoE, InfiniBand, IBM vSCSI and tcm_loop. It is is based on a modular, extensible architecture, with plug-in modules for additional functionality.
targetcli is available under dual licensing:
- The targetcli Community Edition is released under the GNU Affero General Public License (AGPLv3). The Community Edition supports only the configuration of the Target. Everyone is welcome to contribute to the Community Edition.
- The rtsadmin Enterprise Edition is released under the commercial RTS license, and allows the management of complex full storage systems.
targetcli consists of three main Python modules:
- the underlying rtslib with the API [HTML] (RTSlib)
- the configshell that provides extensibility (configshell)
- the targetcli user shell itself (targetcli)
Linux distributions
targetcli and LIO Target are included in most Linux distributions per default. Here is an overview over the most popular distributions:
targetcli also has a complementary open-source SCSI test suite (scsi-testuite).
Quick start guide
The quick start guide provides simple examples of basic target setups that export one block device residing in a file backstore (FILEIO).
targetcli can creates a comprehensive configuration of storage objects with only a few commands by using smart default settings that auto-complete most of the work. targetcli also supports command and parameter completion via , so all available commands and parameters can be listed from all contexts.
Startup
Invoke targetcli as root from the command prompt of the underlying OS shell:
# targetcli Welcome to targetcli: Copyright (c) 2012 by RisingTide Systems LLC. All rights reserved. Visit us at http://www.risingtidesystems.com. Using ib_srpt fabric module. Using qla2xxx fabric module. Using iscsi fabric module. Using loopback fabric module. />
Upon targetcli initialization, the underlying RTSlib loads the installed fabric modules, and creates the corresponding ConfigFS mount points (at /sys/kernel/config/target/ ), as specified by the associated spec files (located in /var/target/fabric/fabric.spec).
Navigate the object tree
targetcli groups the target stack objects into an hierarchical tree of context objects, and allows navigating them correspondingly. Context objects are named by their full path.
cd navigates the object tree. Without parameters, cd presents the full objects tree. The destination path can also be selected via cursor keys.
pwd displays the complete current path (the prompt may display an abbreviated path).
Per default, auto_cd_after_create is set to true, which automatically enters an object context (or working directory) after its creation. The examples here are modeled after this behavior.
Optionally, set auto_cd_after_create=false to prevent targetcli from automatically entering new object contexts after their creation:
/> set global auto_cd_after_create=false Parameter auto_cd_after_create is now 'false'. />
Display the object tree
Use ls to list the object hierarchy, which is initially empty:
/> ls o- / . [. ] o- backstores . [. ] | o- fileio . [0 Storage Object] | o- iblock . [0 Storage Object] | o- pscsi . [0 Storage Object] | o- rd_dr . [0 Storage Object] | o- rd_mcp . [0 Storage Object] o- ib_srpt . [0 Target] o- iscsi . [0 Target] o- loopback . [0 Target] o- qla2xxx . [0 Target] />
Display help
Use help to get context-sensitive help corresponding to the current or selected object context:
/> help GENERALITIES This is an interactive shell in which you can create, delete and configure configuration objects. [. ] COMMAND SYNTAX Commands are built using the following syntax: [TARGET_PATH] COMMAND_NAME [OPTIONS] [. ] AVAILABLE COMMANDS The following commands are available in the current path: - bookmarks action [bookmark] - cd [path] - create [wwn] - delete wwn - exit - get [group] [parameter. ] - help [topic] - info - ls [path] [depth] - pwd - refresh - set [group] [parameter=value. ] - status - version /> backstores/iblock help create SYNTAX create name dev [generate_wwn] DESCRIPTION Creates an IBlock Storage object. dev is the path to the TYPE_DISK block device to use and the optional generate_wwn parameter is a boolean specifying whether or not we should generate a T10 wwn Serial for the unit (by default, yes). /> iscsi/ help create SYNTAX create [wwn] DESCRIPTION Creates a new target. The wwn format depends on the transport(s) supported by the fabric module. If the wwn is ommited, then a target will be created using either a randomly generated WWN of the proper type, or the first unused WWN in the list of possible WWNs if one is available. If WWNs are constrained to a list (i.e. for hardware targets addresses) and all WWNs are in use, the target creation will fail. Use the info command to get more information abour WWN type and possible values. SEE ALSO info />
Create a backstore
Enter the top-level backstore object, and create one (storage object) using IBLOCK or FILEIO type devices.
For instance, create an IBLOCK backstore from a /dev/sdb block device. Note that this device can be any TYPE_DISK block-device, and it can also use /dev/disk/by-id/ symlinks:
/> cd backstores/ /backstores> iblock/ create name=my_disk dev=/dev/sdb Generating a wwn serial. Created iblock storage object my_disk using /dev/sdb. Entering new node /backstores/iblock/my_disk. /backstores/iblock/my_disk>
targetcli automatically creates a WWN serial ID for the backstore device and then changes the working context to it.
The resulting object hierarchy looks as follows (displayed from the root object):
/> ls o- / . [. ] o- backstores . [. ] | o- fileio . [0 Storage Object] | o- iblock . [1 Storage Object] | | o- my_disk . [/dev/sdb activated] | o- pscsi . [0 Storage Object] | o- rd_dr . [0 Storage Object] | o- rd_mcp . [0 Storage Object] o- ib_srpt . [0 Target] o- iscsi . [0 Target] o- loopback . [0 Target] o- qla2xxx . [0 Target] />
Create an iSCSI target
Persist the configuration
The target configuration can be persisted across reboots by using saveconfig from the root context:
/> saveconfig WARNING: Saving rtsnode1 current configuration to disk will overwrite your boot settings. The current target configuration will become the default boot config. Are you sure? Type 'yes': yes Making backup of srpt/ConfigFS with timestamp: 2012-02-27_23:19:37.660264 Successfully updated default config /etc/target/srpt_start.sh Making backup of qla2xxx/ConfigFS with timestamp: 2012-02-27_23:19:37.660264 Successfully updated default config /etc/target/qla2xxx_start.sh Making backup of loopback/ConfigFS with timestamp: 2012-02-27_23:19:37.660264 Successfully updated default config /etc/target/loopback_start.sh Making backup of LIO-Target/ConfigFS with timestamp: 2012-02-27_23:19:37.660264 Successfully updated default config /etc/target/lio_backup-2012-02-27_23:19:37.660264.sh Making backup of Target_Core_Mod/ConfigFS with timestamp: 2012-02-27_23:19:37.660264 Successfully updated default config /etc/target/tcm_backup-2012-02-27_23:19:37.660264.sh Generated Target_Core_Mod config: /etc/target/backup/tcm_backup-2012-02-27_23:19:37.660264.sh Successfully updated default config /etc/target/lio_start.sh Successfully updated default config /etc/target/tcm_start.sh /> exit #
Basic concepts
There are two complementary key concepts that are fundamental to understanding how to use targetcli:
- Context sensitivity: The available command-set and options depend on the current context (which is determined by the current working directory).
- TAB completion: The full context-sensitive list of commands and their options is available by pressing TAB.
General
The fundamental metaphor of targetcli are context objects, which represent the target stack objects. Context objects are unified in a single hierarchical object tree that reflects their logical structure and relations. Context objects are named by their full path in the hierarchical object tree, which allows addressing and navigating them.
‘Entering’ an object changes the current object context, corresponding to its current working path, which is depicted in the command prompt.
pwd alternatively displays the complete current path (e.g., if the prompt displays an abbreviated path for space efficiency).
cd navigates the object tree. Without parameters, cd presents the full objects tree. The destination path can be selected via cursor keys.
help cd lists context-sensitive navigation tips.
Due to the hierarchical structure of a Target object tree, multiple context changes might be required to reach and enter a particular object. For instance:
- Enter an iSCSITarget, from there a specific TPG and then a Network Portal (attached to that TPG).
- Enter an Fibre ChannelTarget, and from there directly an Endpoint.
Working with contexts
create context , or short # , saves the current context under ‘name’, which simplifies traversal of the object tree. Saved contexts can be restored at any time and remain persistent across sessions.
enter context , or short @ , restores the corresponding saved context ‘name’ and immediately enters it. Saved contexts allow both naming and bookmarking available transport objects.
Each context objects provides context-sensitive operations, i.e. different context objects (or paths) provide different command sets. For instnace, a path pointing at an iSCSI target provides different commands than a path pointing at a storage object.
Command completion
With a unique option, pressing once auto-completes the current command being edited. With multiple options, hitting twice produces a list of available command completions, if any, and a quick syntax help on the command currently being edited. This is useful when the exact next parameters available for the current command are not known.
Each command parameter can be passed either as a positional parameter, following the order of the command syntax, or as a key=value pair, in any order. Command auto-completion will reflect and present all available options.
help followed by any command name lists the full command syntax and description.
Command syntax
Use on and .
Example: create target creates a Target for a ‘transport’ (iSCSI, FCoE, Fibre Channel, InfiniBand, etc.) in the root context. If the verb is omitted, the default is to use the first available implicit action verb for the object, in that order: enter, list and get.
Apart from generic verbs, there are also global commands, like help or exit. They take optional arguments and do not work on transport context objects or info objects.
Command chains
targetcli has the ability to chain commands, which provides powerful semantics for creating complex command sequences. Command chains are constructed by chaining multiple single commands together, separated by a comma:
command1, command2 [,command. ]
When a command results in a context change (i.e. enter target iqn.1999-03.org.foobar:1234 enters that target’s context), the next command in the chain executes in that new context. In addition, create context and enter context can be used in command chains, enabling easy scripting of creation, deletion and query operations of objects embedded deeply in the Target object tree.
Global parameters
There are numerous global and context-sensitive parameters that modify the behavior of targetcli.
Here are two particularly important ones:
- auto_cd_after_create
: If TRUE, automatically enter into the context of new objects upon their creation. - auto_enable_tpgt
: If TRUE, automatically enables TPGTs upon creation. - parameter prompt_maxlen: length of context (30 by default, unset to view full context)
Object tree
The Target object hierarchy encompasses both the fabric modules (iSCSI, FCoE, Fibre Channel, InfiniBand, etc.) and the low-level objects used to map the underlying storage objects.
Fabric objects
Here is a summary of the iSCSI fabric objects hierarchy (see also the underlying configFS layout]]):
+-targetcli | +-Targets | Identified by their WWNs or IQN (for iSCSI). | Targets identify a group of Endpoints. | +-TPGs (Target Portal Groups, iSCSI only) | The TPG is identified by its numerical Tag, starting at 1. It | groups several Network Portals, and caps LUNs and Node ACLs. | For fabrics other than iSCSI, targetcli masks the TPG level. | +-Network Portals (iSCSI only) | A Network Portal adds an IP address and a port. Without at | least one Network Portal, the Target remains disabled. | +-LUNs | LUNs point at the Storage Objects, and are numbered 0-255. | +-ACLs | Identified by initiator WWNs/IQNs, ACLs group permissions | for that specific initiator. If ACLs are enabled, one | NodeACL is required per authorized initiator. | + Mapped LUNs Determine which LUNs an initiator will see. E.g., if Mapped LUN 1 points at LUN 0, the initiator referenced by the NodeACL will see LUN 0 as LUN 1.
Storage objects
Here is a summary of the Target storage object hierarchy:
+-Root | +-VirtualHBAs | These are the emulated Host Bus Adapters of the TCM layer. | They are identified by their HBA number and their backstore type: | . iblock - emulates SCSI on top of any TYPE_DISK block device. | . fileio - emulates SCSI on top of the local filessystem. | . rd_mcp - ramdisk drive-based SCSI emulation, a bit slower | ramdisk, but more robust with multiple initiators, | with a separate memory mapping using memory copy. | . rd_dr - ramdisk drive-based SCSI emulation, faster ramdisk, | using direct memory mapping (use sagaciously). | + Storage Objects The actual Storage Objects that will be exported via iSCSI LUNS. . iblock objects need a name, and the path to a disk device. . fileio objects need a name, the path to a file and a size. . rd_dr and rd_mcp objects only need a name and a size.
The Target object hierarchy can be populated either manually by using the HBA and storage contexts of targetcli, or directly reference disks and files when creating LUNs. The latter method requires less commands, but despite targetcli trying its best to optimize the underlying storage objects, is not as flexible as manually creating them.
Manual storage object creation is typically necessary for:
- Creating a FILEIO object in asynchronous (write-back cached) mode
- Block-IO storage objects (IBLOCK)
- RAMDISKs
- Non-standard WWN
Как удалить wwn targetcli
Устанавливаем пакеты и запускаем службу
yum install targetcli scsi-target-utils -y systemctl enable target.service systemctl start target.serviceОткрываем порт сервиса
firewall-cmd --permanent --zone=public --add-port=3260/tcpЕсли необходимо удалить старую конфигурацию
targetcli clearconfig confirm=truetargetcli cd /backstores/block/ create data /dev/ cd /iscsi create wwn=iqn.XX-X-XX cd /iscsi//tpg1/portals delete 0.0.0.0 3260 create xxx.xxx.xxx.xx ip_port=3260 cd /iscsi//tpg1/luns create /backstores/block/ lun= cd /iscsi//tpg1 set attribute authentication=0 set attribute generate_node_acls=1 set attribute demo_mode_write_protect=0 #set attribute MaxBurstLength cd /iscsi//tpg1/acls create wwn=
Формат IQN имеет вид iqn.yyyy-mm.naming-author:unique-name , где:
yyyy-mm - год и месяц. naming-Authority - это обычно обратный синтаксис имени домена в Интернете организации. unique-name - это любое имя, которое вы хотите использовать, например, имя вашего хоста. iqn.2020-01.ru.tx0.iscsi:dss-12020-2023 | Tixo | info@tx0.ru | Погрузитесь в с Тиксо!
Как удалить wwn targetcli
При использовании WSUS на базе Windows Server 2012 R2 было замечено, что в последнее время наблюдались временные отказы при синхронизации метаданных с онлайн службой Windows Update. Синхронизация не работала несколько дней в Июле, затем в конце Июля опять заработала. И вот теперь ситуация снова повторяется, однако, судя по всему, рассчитывать на самовосстановление сервиса уже не приходится. Читать далее.
Ошибка targetcli «WWN not valid as: naa» при попытке добавления в ACL конфигурации Linux-IO FC Target хостов FC Initiator с WWPN от виртуальных машин Hyper-V Gen2
20.06.2019 Автор:Алексей Максимов
4 098 Просмотров Комментариев нетВ одной из прошлых заметок мы уже упоминали о такой штуке, как Linux-IO (LIO) и показывали пример пакетного использования утилиты targetcli, которая используется для управления конфигурацией FC Target. Использование этой утилиты в типичном сценарии, когда хосты, выступающие в роли FC Initiator, являются физическими и имеют физические адаптеры FC HBA, не вызывает проблем. Однако, если в качестве Initiator мы попробуем добавить в конфигурацию LIO вместо физических FC HBA, виртуальные HBA из виртуальных машин Hyper-V, то здесь нам targetcli может выдать ошибку » WWN not valid as: naa «. В этой заметке мы поговорим о том, почему возникает такая ошибка и как её обойти. Читать далее.
Ошибка IIS «HTTP Error 500.19 — Internal Server Error» (DynamicCompressionModule 0x8007007e) после удаления роли Windows Server Update Services (WSUS) на Windows Server 2012 R2
28.05.2019 Автор:Алексей Максимов
6 362 Просмотров 10 комментариевЕсли на сервере с ОС Windows Server 2012 R2 и установленной ролью Windows Server Update Services (WSUS) в конфигурации веб-сервера IIS помимо сайта WSUS Administration имеются какие-либо другие сайты, то после удаления роли WSUS эти сайты могут перестать работать. Рассмотрим эту проблему и способ её решения. Читать далее.
Ошибка установки AppFabric 1.1 на Windows Server 2012 R2 «AppFabric installation failed because installer MSI returned with error code : 1603»
17.05.2019 Автор:Алексей Максимов
4 032 Просмотров 1 КомментарийПри развёртывании сред тестирования и разработки для SharePoint Server 2016 может использоваться конфигурация, когда все нужные разработчику компоненты SharePoint Server и SQL Server устанавливаются в рамках одного виртуального сервера. В качестве одной из предварительно требуемых компонент для SharePoint Server 2016 является пакет Windows Server AppFabric (AppFabric 1.1 for Windows Server). Но в обозначенном окружении может возникнуть проблема с установкой этого пакета в том случае, если перед установкой AppFabric на сервере Windows Server 2012 R2 ранее были установлены серверные компоненты SQL Server, например, SQL Server 2016 Express. Читать далее.
Ошибка Workflow Manager «The provided signing certificate is invalid according to its expiration claims» в SharePoint 2013. Обновляем Self-Signed сертификат для служб Service Bus и Workflow Manager
06.04.2019 Автор:Алексей Максимов
4 497 Просмотров 2 комментария
В рассматриваемой ранее процедуре развёртывания Workflow Manager 1.0 для его последующей интеграции в SharePoint Server 2013 нами была использована схема с генерацией само-подписанного сертификата, который используется для веб-сервисов Workflow Manager (WFM) и Service Bus (SB). С тех пор прошло много времени, и наш экземпляр WFM всё это время выполнял свои задачи вполне себе штатно, пока не наступил момент, когда все новые рабочие процессы дружно перестали выполняться. Забегая вперёд, можно сказать, что это ещё одна история о том, как отсутствие проактивного мониторинга срока действия важного цифрового сертификата может в перспективе создать трудности, которые потом придётся героически преодолевать. Читать далее.
Попытка резервного копирования фермы SharePoint 2013 приводит к исключению Backup-SPFarm : An update conflict has occurred, and you must re-try this action …SPUpdatedConcurrencyException
05.04.2019 Автор:Алексей Максимов
1 619 Просмотров Комментариев нет
Ранее мы рассматривали пример скриптового решения для автоматизации периодического полного резервного копирования фермы SharePoint 2013. И это решение благополучно работало у нас до недавнего времени, но в какой-то момент резервные копии перестали создаваться успешно. Читать далее.
Ошибка запуска службы MSDTC EventID 4691 «The run-time environment was unable to initialize for transactions required to support transactional components. Make sure that MS-DTC is running. (DtcGetTransactionManagerEx(): hr = 0x80004005)»
22.01.2019 Автор:Алексей Максимов
6 603 Просмотров 4 комментарияЭто вторая история, ноги у которой, судя по всему, растут из первой. Дело случилось на одном из ранее описанных виртуальных серверов на базе Windows Server 2012 R2, имевших проблему первичной инициализации в механизме OOBE (Out-of-Box Experience) после клонирования диска ВМ, предварительно подготовленного с помощью sysprep. После развёртывания оба сервера были успешно введены в домен Active Directory и без каких-либо сложностей сделаны участниками нового кластера Windows Failover Cluster. И всё с виду было хорошо до тех пор, пока не настало время установки агента System Center DPM на оба этих сервера. Читать далее.
oVirt 4.2.5 — Ошибка передачи роли SPM между хостами — SPM due to a failure to stop the current SPM
19.08.2018 Автор:Алексей Максимов
5 117 Просмотров 1 КомментарийСлучилось так, что в кластере oVirt 4.2.5 сломалась возможность передачи роли Storage Pool Manager (SPM) с одного хоста на другой. Как позже выяснилось, истинная причина этой проблемы заключалась в том, что на хранилище виртуальных машин Data Domain возникла проблема с неудалённым «осиротевшим» диском в LVM-группе, с которой работает oVirt. Однако данная ключевая проблема привела к другой сложности — невозможности передачи роли SPM между хостами. Читать далее.
Ошибка «Server failed to start. HPE B-series SAN Network Advisor will be rolled back to previous version» при обновлении с версии 14.2 на версию 14.4
10.08.2018 Автор:Алексей Максимов
4 103 Просмотров Комментариев нетВ одной из прошлых заметок мы рассматривали процедуру обновления экземпляра HPE B-series SAN Network Advisor 12.4.1 до более новой версии 12.4.2 методом in-place upgrade. Принципиальных отличий процедура обновлений не претерпела и до текущих релизов 14 версии продукта. Однако между под-версиями 14.2 и 14.3 произошли некоторые изменения уровня безопасности, в результате которых процесс обновления может завершиться ошибкой. Читать далее.
Развёртывание и настройка Icinga 2 на Debian 8.6. Часть 13.2. Настройка мониторинга сетевых устройств в Icinga Director (на примере контроллеров управления ИБП). Получение SNMP Trap
23.08.2017 Автор:Алексей Максимов
9 758 Просмотров 7 комментариев
В данной части цикла заметок об Icinga мы продолжим тему мониторинга сетевых устройств по протоколу SNMP и рассмотрим пошаговый пример настройки ловушки SNMP Trap в конфигурации Icinga Director. Сразу хочу отметить тот факт, что в Icinga нет встроенных механизмов получения и обработки SNMP Trap. Поэтому, для того, чтобы реализовать нужный нам функционал, нам потребуется настроить стек состоящий из ряда элементов:
- snmptrapd – Служба SNMP Trap Daemon из состава Net-SNMP . Данная служба отвечает за прослушивание на сервере мониторинга UDP-порта и получение от внешних сетевых устройств сообщений SNMP Trap
- snmptt – Служба SNMP Trap Translator ( SNMPTT ). Данный элемент отвечает за разбор и интерпретацию сообщений SNMP Trap, полученных от службы snmptrapd. В частности он преобразует числовые идентификаторы OID в читаемый формат, используя подключаемые MIB-файлы.
- submit_snmp_trap – Скрипт, который принимает от службы snmptt нормализованное Trap-сообщение и, преобразовав данные этого сообщения в понятный для Icinga формат, отправляет их в командный pipe-файл Icinga.
- «SNMP Trap» — специальная пассивная Служба Icinga, в которую будут «прилетать» данные из pipe-файла Icinga. Данная Служба будет служить нам для визуализации конечного результата в веб-интерфейсе Icinga Web 2, а также организации оповещений администратора о проблеме.
Unable to create iqn at targetcli?
I want to make a san on my virtual machines, I have already configured a server1 as Server target with theses steps:
- create lvm on server1 - install targetcli - create blocks - create iqn using: create iqn.2017-26.com.example:target1When I tried to create iqn, I got this message:
WWN not valid as: iqn, naa, euiasked Feb 26, 2017 at 21:13
163 3 3 silver badges 12 12 bronze badges1 Answer 1
The IQN format takes the form iqn.yyyy-mm.naming-authority:unique name, where:
- yyyy-mm is the year and month when the naming authority was established.
- naming-authority is usually reverse syntax of the Internet domain name of the naming authority. For example, the iscsi.vmware.com naming authority could have the iSCSI qualified name form of iqn.1998-01.com.vmware.iscsi. The name indicates that the vmware.com domain name was registered in January of 1998, and iscsi is a subdomain, maintained by vmware.com.
- unique name is any name you want to use, for example, the name of your host. The naming authority must make sure that any names assigned following the colon are unique, such as:
- iqn.1998-01.com.vmware.iscsi:name1
- iqn.1998-01.com.vmware.iscsi:name2
- iqn.1998-01.com.vmware.iscsi:name999
However 2017-26 is not a valid date 26 month do not exist.
336 3 3 silver badges 13 13 bronze badges
answered Jun 27, 2017 at 20:37
Yilmar Hernández Yilmar Hernández
Are you quoting someone here? Can you format this to reflect that if so?
Jun 27, 2017 at 21:40You must log in to answer this question.
- centos7
- iscsi
-
The Overflow Blog
Related
Hot Network Questions
Subscribe to RSS
Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.10.27.43697
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.