Delete Target

  1. 執行 targetcli。
    [root@kvm5 ~]# targetcli
    targetcli shell version 2.1.fb46
    Copyright 2011-2013 by Datera, Inc and others.
    For help on commands, type 'help'.
    
  2. 刪除 iscsi。
    /> /iscsi delete iqn.2015-08.wang.deyu:kvm5 
    Deleted Target iqn.2015-08.wang.deyu:kvm5.
    
  3. 刪除 block。
    /> /backstores/block delete kvm5.disk1 
    Deleted storage object kvm5.disk1.
    
  4. ls 查看 block 及 iscsi 都已清空。
    /> ls
    o- / ..................................................................... [...]
      o- backstores .......................................................... [...]
      | o- block .............................................. [Storage Objects: 0]
      | o- fileio ............................................. [Storage Objects: 0]
      | o- pscsi .............................................. [Storage Objects: 0]
      | o- ramdisk ............................................ [Storage Objects: 0]
      o- iscsi ........................................................ [Targets: 0]
      o- loopback ..................................................... [Targets: 0]
    
  5. 退出 targetcli。
    /> exit
    Global pref auto_save_on_exit=true
    Configuration saved to /etc/target/saveconfig.json