Ask Your Question
0

Instance launched from a snapshot

asked 2019-02-27 07:34:55 -0500

najeh gravatar image

Why the time taken by the first instance launched from a snapshot image is much more bigger than other instances time launched from the same snapshot?

edit retag flag offensive close merge delete

Comments

1

My guess: You have to download the image from the Glance store first. Often, this store is Swift. Glance then caches that image, which makes subsequent image accesses much faster.

Bernd Bausch gravatar imageBernd Bausch ( 2019-02-27 07:44:36 -0500 )edit

@Bernd Bausch you mean i have to create a public image from the private one ? and i launch the instance from the pubic image?

najeh gravatar imagenajeh ( 2019-02-27 08:04:08 -0500 )edit
1

This has nothing to do with public vs. private, but with the fact that it takes longer to get the image out of the store than out of cache.

You could try the command glance-cache-manage queue-image IMAGE to preload an image to the cache and see if this changes anything.

Bernd Bausch gravatar imageBernd Bausch ( 2019-02-27 08:37:24 -0500 )edit
1

Another effect: If you launch a second instance on the same compute node from the same image, the image is already on that compute node and doesn't have to be copied from anywhere at all.

Bernd Bausch gravatar imageBernd Bausch ( 2019-02-27 08:38:17 -0500 )edit

root@controller:~# glance-cache-manage queue-image mysnapshot

Traceback (most recent call last):

File "/usr/bin/glance-cache-manage", line 6, in <module>

from glance.cmd.cache_manage import main

ImportError: No module named cache_manage

najeh gravatar imagenajeh ( 2019-02-27 08:50:27 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-03-04 03:02:30 -0500

eblock gravatar image

IIRC you're using ceph as storage backend, in that case you should disable cache management since it's not required, see this for more information, I had the same issue some time ago. Most important thing for ceph backend: use "raw" image format for your glance images. Otherwise glance will download the whole image to the compute node to /var/lib/nova/instances/_base and then upload it back to ceph as a flat image, this can take a long time. Check your image's disk_format.

edit flag offensive delete link more

Comments

@eblock I didn't use any storage service

I used QCOW2 disk format

najeh gravatar imagenajeh ( 2019-03-04 04:01:10 -0500 )edit

I thought you also used Ceph as storage backend, my mistake. So if you're using file based images and instances you probably should enable image-cache for both glance and nova. Bernd already provided the required information. I'll try to rephrase the conclusion, maybe it will get clearer for you...

eblock gravatar imageeblock ( 2019-03-04 04:29:22 -0500 )edit

When using file based images (like you seem to use) nova needs to have a copy of the original glance image, so this download from glance to the compute node takes time, the file is stored under /var/lib/nova/instances/_base. Another qcow file is stored under /var/lib/nova/instances/<instance> as a..

eblock gravatar imageeblock ( 2019-03-04 04:31:34 -0500 )edit

diff file, so every nova instance on that compute node is put together by the base image file and the changes made to the instance stored as a different file. If you launch more instances of the same base image on the same compute node the download from glance can be skipped, so it takes less time.

eblock gravatar imageeblock ( 2019-03-04 04:34:03 -0500 )edit

This command "glance-cache-manage queue-image IMAGE" didn't work for me

najeh gravatar imagenajeh ( 2019-03-04 04:53:58 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-02-27 07:34:55 -0500

Seen: 59 times

Last updated: Mar 04