public:iscsi:logout
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
public:iscsi:logout [2016/12/16 19:38] – [Log out of iSCSI] wiki.tk | public:iscsi:logout [2024/06/07 08:09] (current) – [Remove DM devices] Thomas Kornack | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== log out of iSCSI targets ===== | ||
+ | For a complete logout of an iSCSI device - especially by keeping other active iSCSI connections - it is necessary to end all related device connections step by step in the right order. This affects all devices related to the iSCSI connection. Because of the complexity of the logout process and the participation of many different devices a separate section was dedicated to the process. | ||
+ | ==== Remove LVM device connection ==== | ||
+ | At first all processes have to be finished that access iSCSI devices. On KVM hosts this can be running vhosts. When partitions or LVM partitions on iSCSI devices are mounted, they have to be unmounted. On KVM hosts this can affect snapshots. | ||
+ | |||
+ | Afterwards all LVM devices on iSCSI devices will be set to inactive. The activity flags of the LVM devices are always related to the current KVM host. It is possible without problems to deactivate LVM devices on one host that are still in use on other hosts. | ||
+ | root@kvm55: | ||
+ | LV VG | ||
+ | images | ||
+ | lv_dbslave5501 | ||
+ | lv_dbserver5501 vg3_dbserver -wi-ao | ||
+ | lv_nas5501 | ||
+ | | ||
+ | root@kvm55: | ||
+ | root@kvm55: | ||
+ | | ||
+ | root@kvm55: | ||
+ | LV VG | ||
+ | images | ||
+ | lv_dbslave5501 | ||
+ | lv_dbserver5501 vg3_dbserver -wi--- | ||
+ | lv_nas5501 | ||
+ | |||
+ | root@kvm55: | ||
+ | VG #PV #LV #SN Attr | ||
+ | vg | ||
+ | vg3_dbserver | ||
+ | vg3_nas | ||
+ | | ||
+ | root@kvm55: | ||
+ | 0 logical volume(s) in volume group „vg3_dbserver“ now active | ||
+ | root@kvm55: | ||
+ | 0 logical volume(s) in volume group „vg3_nas“ now active | ||
+ | | ||
+ | root@kvm55: | ||
+ | VG #PV #LV #SN Attr | ||
+ | vg | ||
+ | vg3_dbserver | ||
+ | vg3_nas | ||
+ | The command '' | ||
+ | root@kvm55: | ||
+ | PV | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | | ||
+ | root@kvm55: | ||
+ | Physical volume „dev/ | ||
+ | 1 physical volume changed / 0 physical volumes not changed | ||
+ | root@kvm55: | ||
+ | Physical volume „dev/ | ||
+ | 1 physical volume changed / 0 physical volumes not changed | ||
+ | root@kvm55: | ||
+ | PV | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | Please note: The command '' | ||
+ | ==== Remove DM devices ==== | ||
+ | With the commands related to LVM it is not possible to disable LVM devices completely. When logging out of iSCSI after the actions mentioned above, LVM commands like '' | ||
+ | |||
+ | As last resort all DM devices have to be removed before. But it has to be made sure to only remove the devices related to the iSCSI devices. When removing the wrong device data loss may occur. Usually the command '' | ||
+ | root@kvm55: | ||
+ | vg-images | ||
+ | vg-lv_dbslave5501 | ||
+ | 350002ac21d632071 | ||
+ | vg3_dbserver-lv_dbserver5501 (252:3) | ||
+ | 350002ac21d622071 | ||
+ | vg3_nas-lv_nas5501 | ||
+ | In the example above the DM devices No. 2, 3, 4 and 5 have to be removed. The order of removal is important: First the LVM partitions are removed (devices 3 and 5), then the physical devices can be removed (devices 2 and 4). | ||
+ | root@kvm55: | ||
+ | root@kvm55: | ||
+ | root@kvm55: | ||
+ | root@kvm55: | ||
+ | While removing the DM devices 2 and 4 the multipath devices also disappeared. | ||
+ | root@kvm55: | ||
+ | (no output) | ||
+ | ==== Log out of iSCSI ==== | ||
+ | After the preparations descibed above log-out of iSCSI will be possible: | ||
+ | root@kvm55: | ||
+ | Logging out of session [sid: 3, target: iqn.2000-05.com.3pardata: | ||
+ | Logout of [sid: 3, target: iqn.2000-05.com.3pardata: | ||
+ | | ||
+ | root@kvm55: | ||
+ | Logging out of session [sid: 4, target: iqn.2000-05.com.3pardata: | ||
+ | Logout of [sid: 4, target: iqn.2000-05.com.3pardata: | ||
+ | |||
+ | [[public: | ||