[Lxc-users] ubuntu-lxc/daily, lxc-create lxcpath on nfs, Error locking partial file
Serge Hallyn
serge.hallyn at ubuntu.com
Wed Jun 5 03:58:11 UTC 2013
Quoting zoolook (nbensa+lxcusers at gmail.com):
> Hello Serge,
>
> On Tue, Jun 4, 2013 at 1:08 PM, Serge Hallyn <serge.hallyn at ubuntu.com> wrote:
> > Quoting zoolook (nbensa+lxcusers at gmail.com):
> >> sysadmin at lxc0:~$ sudo lxc-create -n test1 -P /srv/lxc -B lvm --vgname
> >> vg_vmstorage --lvname lxc-test1-root --fssize 2G -t ubuntu -- -r
> >> precise
> >> [sudo] password for sysadmin:
> >> lxc-create: Bad file descriptor - Error locking partial file
> >> /srv/lxc/test1/partial
> >> lxc-create: _recursive_rmdir_onedev: failed to delete /srv/lxc/test1
> >> lxc-create: Error creating container test1
> >
> > grrr. flock doesn't work on nfs?
>
> O_EXCL? AFAIK, nope.
>
>
> > as a workaround in the meantime, I'd suggest
> >
> > sudo mkdir -p /srv/lxc/locks
> > sudo mount -t tmpfs tmpfs /srv/lxc/locks
> >
> > so the lockfiles aren't on nfs :)
>
>
> Did not work, as lxc-create expects a lock on
> /srv/lxc/${CONTAINER_NAME}/partial. Note that this file is outside of
> /srv/lxc/locks.
Hm. Really just an atomic creat with O_EXCL|O_CREAT should suffice
for that file, which would at least work for nfsv3+.
> It's been a decade or so since I touched any C code so I'll better
> wait for your patch. But don't worry Serge, I'm not in a hurry.
>
> Worst case, I can create the containers in some other directory and
> then mv/rsync to the nfs mount point, ... or maybe try samba, but I
> think it'll be overkill and I better avoid it.
I'll try switching to ioctl(F_SETLK) this week.
thanks,
-serge
More information about the lxc-users
mailing list