[Openstack] How should I spawn an instance using ceph

Tom Walsh expresswebsys+openstack at gmail.com
Sat Mar 26 17:48:11 UTC 2016


Yang,

If your Glance images are stored in the same Ceph cluster as your
Cinder volumes then you should be able to do Copy on Write instance
cloning. Basically what happens is your Glance images are passed to
Cinder as a snapshot pointer and then you boot from that. Boot times
with this method are very fast, typically less than 30 seconds.

There are a few things you need to make sure you have in place though.

1) If you are using Ceph authentication (CephX) then you must make
sure that your pool users have the correct permissions to access the
other pools. In our setup we allow rwx on the images pool from the
cinder user "client.volumes".

2) You must tell Glance to provide a snapshot URL instead of copying
the entire image to the volume in glance-api.conf:

show_image_direct_url = True

There is one minor gotcha with this method though. Once you create an
instance volume from an image, you can no longer remove that image
from Glance for the lifetime of the Cinder volume it is based off of.
We set our images to be "protected" for that reason.

This page provided by Ceph covers this information as well, but some
of it doesn't work right in Liberty, and the values that they use
don't match up with other RBD guides provided by OpenStack to get Ceph
working (usernames for CephX don't match - so don't just use it to
copy and paste).
http://docs.ceph.com/docs/master/rbd/rbd-openstack/

Hope that helps.

Tom Walsh
ExpressHosting
https://expresshosting.net/

On Fri, Mar 25, 2016 at 12:30 PM, yang sheng <forsaks.30 at gmail.com> wrote:
> Hi All
>
> I am new to openstack. I just deployed Openstack liberty using ceph as
> cinder and glance backend.
>
> I have some images (raw format, about 10G) in glance (stored in ceph).
>
> I tried 2 different methods to spawn the instance.
>
> Because my image size are huge. If I want to spawn an instance by using
> creating a volume from an image and boot from that volume,
> (http://docs.openstack.org/user-guide/cli_nova_launch_instance_from_volume.html)
> cinder-volume will download entire image from glance (also in the ceph).
> Instance will in error status after about 3 minutes (internal time-out
> mechanism?), saying block device mapping problem. However, my cinder is
> still creating the volume (  It will take 10 minutes for cinder to upload,
> download the image and create volume).
>
> So I came up with another method. I create a volume from glance first (also
> 10 minutes). If I want to spawn an new  instance, I just clone that volume
> (it is instant). Then boot from that volume directly.
>
> My glance and cinder are using the same ceph cluster (different pools).
>
> I download some images from openstack
> (http://docs.openstack.org/image-guide/obtain-images.html). Since their size
> are not that large, most are no more than 1G, it is fine to use the first
> method.
>
> Just wondering why cinder-volume has to download the image. Is there anyway
> to bypass this process? Or can ceph handle this internally?
>
> thanks for any advise!
>
>
>
> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
>




More information about the Openstack mailing list