Enabled the service, tried to reproduce with ramdisk: If i unmount the /mnt/ramdisk filesystem the file in the ramdisk just get's recreated by targetcli. Don't what i did differently with ramdisk. I am however able to reproduce with a USB Stick (/dev/sdc). --- ls o- / ......................................................................................................................... [...] o- backstores .............................................................................................................. [...] | o- block .................................................................................................. [Storage Objects: 1] | | o- usb_stick ....................................................................... [/dev/sdc (14.9GiB) write-thru activated] | o- fileio ................................................................................................. [Storage Objects: 0] | o- pscsi .................................................................................................. [Storage Objects: 0] | o- ramdisk ................................................................................................ [Storage Objects: 0] o- iscsi ............................................................................................................ [Targets: 0] o- loopback ......................................................................................................... [Targets: 0] o- qla2xxx .......................................................................................................... [Targets: 2] | o- naa.2100001b329189cb ............................................................................................. [gen-acls] | | o- acls ............................................................................................................ [ACLs: 2] | | | o- naa.10000000c98f12b8 ................................................................................... [Mapped LUNs: 1] | | | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | | | o- naa.10000000c98f12b9 ................................................................................... [Mapped LUNs: 1] | | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | | o- luns ............................................................................................................ [LUNs: 1] | | o- lun0 ....................................................................................... [block/usb_stick (/dev/sdc)] | o- naa.2101001b32b189cb ............................................................................................. [gen-acls] | o- acls ............................................................................................................ [ACLs: 2] | | o- naa.10000000c98f12b8 ................................................................................... [Mapped LUNs: 1] | | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | | o- naa.10000000c98f12b9 ................................................................................... [Mapped LUNs: 1] | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | o- luns ............................................................................................................ [LUNs: 1] | o- lun0 ....................................................................................... [block/usb_stick (/dev/sdc)] o- vhost ............................................................................................................ [Targets: 0] Basic setup is /dev/sdc is a USB stick which gets mapped over FC (i know, stupid, but thats not the point :P) *** Client sees LUN properly after reboot. *** /> saveconfig /root/usb_stick_config Configuration saved to /root/usb_stick_config *** Remove USB Stick *** *** reboot host *** Results: /> 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] o- qla2xxx .......................................................................................................... [Targets: 1] | o- naa.2101001b32b189cb ............................................................................................. [gen-acls] | o- acls ............................................................................................................ [ACLs: 2] | | o- naa.10000000c98f12b8 ................................................................................... [Mapped LUNs: 0] | | o- naa.10000000c98f12b9 ................................................................................... [Mapped LUNs: 0] | o- luns ............................................................................................................ [LUNs: 0] o- vhost ............................................................................................................ [Targets: 0] My second FC target WWN is gone... I think because TargetCLI stopped loading the config after it found out that the lun was gone. ---- /> clearconfig confirm=True All configuration cleared /> 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] o- qla2xxx .......................................................................................................... [Targets: 0] o- vhost ............................................................................................................ [Targets: 0] *** plug in USB Stick *** /> restoreconfig /root/usb_stick_config Configuration restored from /root/usb_stick_config After which the configuration is fine again. /> saveconfig /root/usb_stick_config Configuration saved to /root/usb_stick_config *** poweroff machine *** *** remove USB Stick *** *** power on machine *** /> 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] o- qla2xxx .......................................................................................................... [Targets: 1] | o- naa.2100001b329189cb ............................................................................................. [gen-acls] | o- acls ............................................................................................................ [ACLs: 2] | | o- naa.10000000c98f12b8 ................................................................................... [Mapped LUNs: 0] | | o- naa.10000000c98f12b9 ................................................................................... [Mapped LUNs: 0] | o- luns ............................................................................................................ [LUNs: 0] o- vhost ............................................................................................................ [Targets: 0] /> Again, 1 WWN missing. [root@fchost ~]# targetcli clearconfig confirm=True All configuration cleared *** plug in USB Stick *** [root@fchost ~]# targetcli restoreconfig /root/usb_stick_config Configuration restored from /root/usb_stick_config /> ls o- / ......................................................................................................................... [...] o- backstores .............................................................................................................. [...] | o- block .................................................................................................. [Storage Objects: 1] | | o- usb_stick ....................................................................... [/dev/sdc (14.9GiB) write-thru activated] | o- fileio ................................................................................................. [Storage Objects: 0] | o- pscsi .................................................................................................. [Storage Objects: 0] | o- ramdisk ................................................................................................ [Storage Objects: 0] o- iscsi ............................................................................................................ [Targets: 0] o- loopback ......................................................................................................... [Targets: 0] o- qla2xxx .......................................................................................................... [Targets: 2] | o- naa.2100001b329189cb ............................................................................................. [gen-acls] | | o- acls ............................................................................................................ [ACLs: 2] | | | o- naa.10000000c98f12b8 ................................................................................... [Mapped LUNs: 1] | | | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | | | o- naa.10000000c98f12b9 ................................................................................... [Mapped LUNs: 1] | | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | | o- luns ............................................................................................................ [LUNs: 1] | | o- lun0 ....................................................................................... [block/usb_stick (/dev/sdc)] | o- naa.2101001b32b189cb ............................................................................................. [gen-acls] | o- acls ............................................................................................................ [ACLs: 2] | | o- naa.10000000c98f12b8 ................................................................................... [Mapped LUNs: 1] | | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | | o- naa.10000000c98f12b9 ................................................................................... [Mapped LUNs: 1] | | o- mapped_lun0 ............................................................................... [lun0 block/usb_stick (rw)] | o- luns ............................................................................................................ [LUNs: 1] | o- lun0 ....................................................................................... [block/usb_stick (/dev/sdc)] o- vhost ............................................................................................................ [Targets: 0] Config is restored once more. 2016-03-07 20:31 GMT+01:00 Andy Grover <agrover@xxxxxxxxxx>: > On 03/06/2016 11:33 PM, Thijs Cramer wrote: >> >> 2016-03-06 18:25 GMT+01:00 Andy Grover <agrover@xxxxxxxxxx>: >>> >>> On 03/06/2016 02:06 AM, Thijs Cramer wrote: >>>> >>>> >>>> I've noticed some weird behaviour on the targetcli upon restarting. >>>> >>>> For testing wirespeeds of different settings, i've created a ramdisk >>>> using >>>> tmpfs in /mnt/ramdisk (mount -t tmpfs tmpfs /mnt/ramdisk). >>>> After which i've created a "lun" (dd if=/dev/zero of=16G.ramdisk bs=16M >>>> count=1024). >>>> >>>> In targetcli i've added this file in backstores/fileio and added it as a >>>> lun under several Fibre Channel ACL's and LUN's. >>>> >>>> So far so good, and everything works fine. Until i reboot. >>>> Which of course makes sense, because the ramdisk and thus the file are >>>> gone. >>>> >>>> But the weird thing is, the entire targetcli configuration is *empty*. >>>> The expeceted behaviour here, would be that Targetcli unmaps the missing >>>> LUN from the configuration, but leaves the rest of the configuration >>>> intact. And not destroy my whole configuration. >>>> >>>> Can anyone shed some light on this? >>> >>> >>> >>> What kernel version and targetcli version? -- Andy > > > [fixed top-posting] > >> Fedora 23 latest so: Kernel 4.4.3 & TargetCLI version 2.1.fb42-3.fc23. > > Step one would be verify that target.service is enabled. This is needed to > restore settings on restart: > > sudo systemctl enable target.service > sudo reboot > > ...still broken? > > 2) verify /etc/target/saveconfig.json looks ok > 3) try 'targetctl clear' and 'targetctl restore' without rebooting to see if > that works, or any error messages produced > 4) open a Fedora bug and attach saveconfig.json > > Thanks -- Andy > -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html