cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiroki Ohashi" <>
Subject Review Request 28511: CLOUDSTACK-7412: Can't create proper template from VM on S3 secondary storage environment
Date Thu, 27 Nov 2014 10:38:30 GMT

This is an automatically generated e-mail. To reply, visit:

Review request for cloudstack.


Repository: cloudstack-git



Root cause of this issue is a way to handle cache using S3 as
Secondary Storage.

When CloudStack uploads a disk image on Primary Storage(PS) to
Secondary Storage(SS), it caches the disk image on Secondary Staging
Store(SSS). This is a bug.

CloudStack uses disk image cache every time if the cache exists. For
this behavior, the old cache on SSS will be uploaded as a template
though a CloudStack user creates the template from a newer disk image
on PS than the cache.

So, we fixed this issue in a way that CloudStack deletes the cache on
SSS after CloudStack uploads disk image to SS.


Process of handling cache is different between copy from SS to
PS(download) and copy from PS to SS(upload).

* Downloading a disk image from SS to PS

This is the case that a CloudStack user creates an instance from a
template. CloudStack caches the image on SSS.

* Uploading a disk image from PS to SS

This is the case that a CloudStack user creates a template from a disk
image of an instance. CloudStack shouldn't cache a disk image because
it usually happens that a cache image is older than a volume of an

However, there is a bug in branch condition about post process of
uploading a disk image. Then CloudStack doesn't delete the disk image
on SSS.

CloudStack uses a common method to copy a disk image between PS and SS
for upload and download. The method includes post process of disk
image cache.

As a part of post process, it is judged whether a disk image on SSS is
used as cache or not in this method:

  a. Delete a disk image as upload procedure

  b. Delete a disk image to handle errors

  c. Cache a disk image as download procedure

In case of uploading a disk image, branch-a should be selected. But
branch-c is always selected by the condition bug. As a result, a disk
image is left on SSS and used as cache next time a CloudStack user
creates a template from an instance.





Items below are confirmed.

- A template created from an instance reflects a volume of the instance.
- No cache file exists on NFS secondary staging store.
- No cache entry exists on template_store_ref.

We use this patch in our environment.


Hiroki Ohashi

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message