Hi Dimitris,

I was trying to apply your patch regarding NIC configuration scripts. After
having rebased them to current master and fixed a problem with distcheck, I
run into the following problem when creating and instance:

Wed Jun 12 10:08:53 2013 * creating instance disks...
Wed Jun 12 10:09:06 2013 adding instance instance.example.com to cluster
config
Wed Jun 12 10:09:07 2013  - INFO: Waiting for instance instance.example.com to
sync disks
Wed Jun 12 10:09:07 2013  - INFO: - device disk/0: 62.10% done, 1s
remaining (estimated)
Wed Jun 12 10:09:09 2013  - INFO: - device disk/0: 92.30% done, 0s
remaining (estimated)
Wed Jun 12 10:09:09 2013  - INFO: Instance instance.example.com's disks are
in sync
Wed Jun 12 10:09:10 2013 * running the instance OS create scripts...
Wed Jun 12 10:09:12 2013 * starting instance...
Failure: command execution error:
Could not start instance: Error while executing backend function: Cannot
create needed directory '/var/run/ganeti/xen-hypervisor/nic/
instance.example.com': [Errno 2] No such file or directory:
'/var/run/ganeti/xen-hypervisor/nic/instance.example.com'

Here's the node-daemon.log entry from the failing node:

2013-06-12 10:09:13,820: ganeti-noded pid=8529 noded:197 ERROR Error in RPC
call
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/ganeti/server/noded.py", line 181,
in HandleRequest
    result = (True, method(serializer.LoadJson(req.request_body)))
  File "/usr/lib/python2.7/dist-packages/ganeti/server/noded.py", line 604,
in perspective_instance_start
    return backend.StartInstance(instance, startup_paused, trail)
  File "/usr/lib/python2.7/dist-packages/ganeti/backend.py", line 1577, in
StartInstance
    hyper.StartInstance(instance, block_devices, startup_paused)
  File "/usr/lib/python2.7/dist-packages/ganeti/hypervisor/hv_xen.py", line
570, in StartInstance
    self._MakeConfigFile(instance, startup_memory, block_devices)
  File "/usr/lib/python2.7/dist-packages/ganeti/hypervisor/hv_xen.py", line
558, in _MakeConfigFile
    buf.write(self._GetConfig(instance, startup_memory, block_devices))
  File "/usr/lib/python2.7/dist-packages/ganeti/hypervisor/hv_xen.py", line
1026, in _GetConfig
    self._WriteNICInfoFile(instance.name, idx, nic)
  File "/usr/lib/python2.7/dist-packages/ganeti/hypervisor/hv_xen.py", line
398, in _WriteNICInfoFile
    constants.RUN_DIRS_MODE)])
  File "/usr/lib/python2.7/dist-packages/ganeti/utils/io.py", line 590, in
EnsureDirs
    " '%s': %s" % (dir_name, err))
GenericError: Cannot create needed directory
'/var/run/ganeti/xen-hypervisor/nic/instance.example.com': [Errno 2] No
such file or directory: '/var/run/ganeti/xen-hypervisor/nic/
instance.example.com'

And indeed, there is no /var/run/ganeti/xen-hypervisor/nic/ directory on
that node. Those directories should be created as well, just like the KVM
version does in hv_kvm.py:600.


Also, there might be a better solution to the distcheck problem. The root
is that we write to a path outside of $PREFIX during `make install` (namely
to /etc/xen/, or more precisely to $XEN_CONFIG_DIR). Actually we shouldn't
be doing that, but only provide documentation to the user what he has to do
himself after the installation. I agree that that's not as convenient as
having `make install` do it for him...

I attach the modified patches, so you don't have to rebase them again.

Thanks,
Thomas



On Fri, May 24, 2013 at 10:19 AM, Guido Trotter <[email protected]>wrote:

> On Fri, May 24, 2013 at 10:10 AM, Dimitris Aragiorgis <[email protected]>wrote:
>
>> Hi from Athens again!
>>
>> Have you forgotten to cc the list? Anyway I continue offline..
>>
>>
> Indeed, I did. +list, sorry.
>
>
>> * Guido Trotter <[email protected]> [2013-05-21 15:11:50 +0200]:
>>
>> > On Sat, May 18, 2013 at 3:17 AM, Dimitris Aragiorgis <[email protected]
>> >wrote:
>>
>> >
>> > > Add new script vif-ganeti that could be used instead of
>> > > default vif-bridge in order NIC customization can be more
>> > > flexible.
>> > >
>> > > Extract common code from kvm-ifup and insert it in a new
>> > > file net-common that is being sourced by kvm-ifup and
>> > > vif-ganeti and located under package lib dir (/usr/lib/ganeti/).
>> > >
>> > >
>> > If this is under tools/ can we also install it in /usr/lib/ganeti/tools
>> ?
>> >
>> >
>>
>> Well I don't think these scripts are tools. I put it in /usr/lib/ganeti
>> because kvm-ifup is located under that dir as well.
>>
>>
> Ah, sounds good then, thanks.
>
>
>> > > TODO: in debian/links add the following symbolic link;
>> > > /etc/xen/scripts/vif-ganeti ->/usr/lib/ganeti/vif-ganeti.
>> > > This is needed because Xen expects network related scripts
>> > > to be located under /etc/xen/scripts.
>> > >
>> > > Signed-off-by: Dimitris Aragiorgis <[email protected]>
>> > >
>> >
>> > Can we add the link at "make install" time? Why should it be done in
>> > debian/links?
>> >
>>
>> Good point. How about that interdiff:
>>
>> diff --git a/Makefile.am b/Makefile.am
>> index 9133a8b..08d3dc8 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -791,7 +791,12 @@ qa_scripts = \
>>  bin_SCRIPTS =
>>  if WANT_HTOOLS
>>  bin_SCRIPTS += $(HS_BIN_PROGS)
>> +endif
>>  install-exec-hook:
>> +       @mkdir_p@ "$(DESTDIR)${sysconfdir}/xen/scripts"
>> +       $(LN_S) -f "$(DESTDIR)${myexeclibdir}/vif-ganeti" \
>> +               "$(DESTDIR)${sysconfdir}/xen/scripts/vif-ganeti"
>>
>
> I was not sure we should forcibly create /etc/xen, and whether it should
> it be ${sysconfdir} considering that the default for sysconfdir is
> /usr/local/etc (ew...). But perhaps it's the best option, anyway.
>
>
>> +if WANT_HTOOLS
>>         @mkdir_p@ $(DESTDIR)$(iallocatorsdir)
>>  # FIXME: this is a hardcoded logic, instead of auto-resolving
>>         $(LN_S) -f ../../../bin/htools \
>>
>>
>> Do you agree with the rest?
>>
>>
> Yes, I believe so. Can you please do a resend, so I can look at it as a
> whole and apply?
>
> Thanks,
>
> Guido
>
>


-- 
Thomas Thrainer | Software Engineer | [email protected] |

Google Germany GmbH
Dienerstr. 12
80331 München

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Katherine Stephens

Attachment: 0001-Make-NIC-setup-more-flexible-in-case-of-Xen.patch
Description: Binary data

Attachment: 0002-Refactor-NIC-configuration-scripts.patch
Description: Binary data

Reply via email to