[lxc-users] cannot create a centos container on lvm with centos template
Serge Hallyn
serge.hallyn at ubuntu.com
Thu Jan 22 02:33:25 UTC 2015
Quoting 黄奕 (ruffian_hy at 126.com):
> lxc version:1.0.7
> I tried to create a lxc on lvm with command:
> lxc-create -n mylxc2 -t centos -B lvm
> and i got the errors:
>
> Copy /usr/local/var/cache/lxc/centos/x86_64/6/rootfs to /dev/lxc/mylxc2 ...
> Copying rootfs to /dev/lxc/mylxc2 ...mkdir: cannot create directory ‘/dev/lxc/mylxc2’: File exists
> rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
> rsync: ERROR: cannot stat destination "/dev/lxc/mylxc2/": Not a directory (20)
> rsync error: errors selecting input/output files, dirs (code 3) at main.c(565) [Receiver=3.0.9]
> rsync: connection unexpectedly closed (9 bytes received so far) [sender]
> rsync error: error in rsync protocol data stream (code 12) at io.c(605) [sender=3.0.9]
Ah yes, I think this is a bug in the centos template. It appears to take
the $rootfs_path to which it rsyncs from the lxc.rootfs entry in
the container config file, rather than from the --rootfs argument
which lxc-create passed to it. The lxc config file specifies
/dev/lxc/mylx2, whereas --rootfs will be the path at which
that fs is mounted.
Can someone volunteer to fix the centos template in this regard?
More information about the lxc-users
mailing list