[Openstack] Can't boot lxc instance
P at draigBrady.com
Mon Oct 22 10:17:24 UTC 2012
On 10/22/2012 10:33 AM, hzguanqiang wrote:
> Hi Pádraig
> I think you are right. I met the same probelm just as 念远 did when I tried lxc with openstack folsom.
> To solve the problem, I tried to modify the function setup_container, adding a partition argument to _DiskImage(...) just as follow:
> #img = _DiskImage(image=image, use_cow=use_cow, mount_dir=container_dir)
> img = _DiskImage(image=image, partition=FLAGS.libvirt_inject_partition, use_cow=use_cow, mount_dir=container_dir)
> And it works!
Right. I'm not sure why LXC is treated differently in this regard,
but I'm looking at improving config in this area.
Note a global libvirt_inject_partition config option isn't
appropriate for disparate images, so it seems like we could benefit
from some image introspection, and/or image tagging in glance,
to indicate which partition to use.
Note if using libguestfs with libvirt_inject_partition=-1
we already support inspection of the image to determine
the best way to mount.
> But I still have a little doubt about the lxc image.
> It seems to me that many kvm images can not be used to create lxc while another little few can.
> Why does this happen?
I can only guess that a single partition within the image
is not enough to use it. I'd need info about the images though
and specific errors to deduce further.
More information about the Openstack