[libvirt] Re: [Patch v0.4] iSCSI Multi-IQN (Libvirt Support)
dallan at redhat.com
Wed Nov 18 17:31:59 UTC 2009
Shyam_Iyer at Dell.com wrote:
>> -----Original Message-----
>> From: libvir-list-bounces at redhat.com [mailto:libvir-list-
>> bounces at redhat.com] On Behalf Of Daniel P. Berrange
>> Sent: Wednesday, November 18, 2009 4:47 PM
>> To: Iyer, Shyam
>> Cc: libvir-list at redhat.com; Bellad, Sudhir; Domsch, Matt; KM, Paniraja
>> Subject: Re: [libvirt] Re: [Patch v0.4] iSCSI Multi-IQN (Libvirt
>> On Wed, Nov 18, 2009 at 04:37:02PM +0530, Shyam_Iyer at Dell.com wrote:
>>>>> 2) By using iscsiadm commands like the following
>>>>> # iscsiadm -m iface -I <iface_name> -o new
>>>>> # iscsiadm -m iface -I iface1 --op=update -n iface.initiatorname
>>>> In that case, why don't we make libvirt automatically set things
>>>> way whenever it sees the IQN in the XML file.
>>>>> We don't change the default initiatorname with libvirt/virt
>>>>> today right ? So, we haven't added any apis to manage the iface
>>>>> name using libvirt as such.
>>>>> But if required by virt-manager(to create a single window of
>>>>> the iface file could be constructed using libvirt apis that call
>>>>> iscsiadm commands detailed in method 2)
>>>> We don't need to add any new APIs for this - just automatically
>>>> mapping whenever logging into a target with a IQN that we don't
>>>> know about
>>> How do we ensure that the iqn is not already known and libvirt is
>>> creating the corresponding iface file for the first time?
>>> That would mean searching through the IFACES_DIR which has been
>>> in the thread...
>> Now that you've explained why this searching in IFACE_DIR was needed,
>> I've no problem with that approach. We should search through
>> to find the iface mapping, if none is found, then run those 2 commands
>> you show above in order to create a new mapping
> Ok. Thanks.
Dan and I took another look at this, and we think that parsing the
output of iscsiadm is the right way to go, since the relevant
information is available there. It's what we're doing in the rest of
the code, as well as (IMO) less likely to change between builds of
iscsiadm/distros/etc. Sorry about the conflicting advice.
>>> Also, how do we go about creating unique iface filenames when
>>> automatically creating them using libvirt ?
>> I don't know what naming convention is used in IFACES_DIR, but I'd say
>> just follow whatever's used already
> What I mean here is how do I create unique file names through libvirt.
> Today a unique iface file name is created by the user manually.
> So, should mkstemp be used... with a template feed of the initiator iqn
> name ?
Just to make sure I'm understanding correctly, the filename is the
interface name, so what we're talking about here is generating a unique
interface name? Assuming that's the case, you could use a randomly
generated string, although personally I find those things somewhat
difficult to keep in mind. You could also just append a monotonically
increasing value, but I don't have too strong an opinion about how you
Any way you generate the interface name, you should use iscsiadm to
create the interface.
More information about the libvir-list