[fedora-virt] Adding tgtd iSCSI LUNs on the fly

Ewan Mac Mahon ewan at macmahon.me.uk
Mon Jul 12 14:30:05 UTC 2010


Hi,

This isn't strictly a virt question, but I hope it's related enough
that this is a sensible place to ask it.

I've got a small libvirt/KVM setup (on F13) that uses a separate storage
box (on RHEL/SL 5.4) running tgtd to export iSCSI storage consisting of
a single target with one (LV backed) LUN per VM.  The storage is all
configured in /etc/targets.conf. If I add a new LUN to the configuration
file and then try to make it live by doing:
 tgt-admin --verbose --execute
I simply get a message saying that the target already exists (which it
does) and the LUN isn't added. I can, however, add the LUN manually by
doing something like:
 tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 5 -b /dev/VGstorage/LVkvm-vm5 

So, in short, is there a better way of doing this that will sync the
running configuration from /etc/targets.conf, including picking up
changes to a target rather than just new targets?

Ewan


More information about the virt mailing list