Porting the block-iscsi hotplug script

Gustau Pérez gustau.perez at gmail.com
Thu Mar 3 09:08:18 UTC 2016



El 2/03/16 a les 10:46, Roger Pau Monné ha escrit:
>
> There's a little shortcut in libxl to deal with disks that are using the
> default hotplug script, see:
>
> http://xenbits.xen.org/gitweb/?p=xen.git;a=blob;f=tools/libxl/libxl.c;h=4cdc1690c4d5e5d5b66c896e4c11e813be92b468;hb=HEAD#l2451
>
> libxl does the hotplug script job and already writes the xenstore
> "physical-device" node on behalf of the hotplug script. This is done to
> speed up domain creation.
>
> You can disable this shortcut by spelling out the hotplug script on each
> disks configuration line. Using the configuration file you posted in [2]
> as an example, you will need to change your disk configuration lines so
> they look like:
>
> disk = [
>     'vdev=xvda,access=rw,script=block,target=/dev/zvol/dades/debian',
>     'vdev=xvdb,access=rw,script=block,target=/dev/zvol/dades/debian_1',
>         ]
>
> This will prevent libxl from writing the "physical-device" node.

   Thank you. That makes it. I'm using a simpler form like:

           phy:/dev/zvol/dades/debian,xvda,rw,script=block',

   which behaves in the same way.
>
>>    On the other hand, if I attach two disks[2], the xenstored again
>> complains about one of the disks already declared in the xenstore.
>> However the store seem to be fine [3].  If I remove that disk from the
>> definition the domain boots just fine.
> According to [2], you are assigning the same vdev to both disks (xvda).
> This is not possible, you should change the second disk definition to:
>
> 'phy:/dev/zvol/dades/debian_1,xvdb,rw'
>
> Or any other xvd* value that's not xvda.

    Ah, you're right. Cut and paste betrayed me :) However perhaps the
error message may be misleading (it made me think the error was the
volume, no the given virtual disk).

> http://www.informit.com/articles/article.aspx?p=1160234 

   Very  interesting. I'd need some time to read it through.

   I'm checking the libxl code and I'd like to pass more arguments to
the script. I'll modify libxl/libxl_freebsd.c to do so. I'll let you
know my experiments.

   Thank you,

   Gustau

  



More information about the freebsd-xen mailing list