You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by re...@apache.org on 2015/10/02 16:26:18 UTC

[2/2] git commit: updated refs/heads/master to 78f7429

Merge pull request #901 from karuturi/CLOUDSTACK-8808

CLOUDSTACK-8808: Successfully registered VHD template is downloaded again due to missing virtualsize property in template.propertiesWe have multiple file processors to process different types of image
formats. The processor interface has two methods getVirtualSize() and
process().

1.  getVirtualSize() as the name says, returns the virtual size of
the file and is used at get the size while copying files from NFS to s3
2.  process() returns FormatInfo struct which has fileType, size,
virutalSize, filename.  on successfully downloading a template, each
file is passed to all the processors.process() and whichever returns a
FormatInfo, that will be used to create template.properties file.  If
process() throws an InternalErrorException, template installation fails.
But, if process() returns null, template registration is successful with
template.properties missing some attributes like virtualSize, file
format etc. which results in this bug on restart of ssvm/cloud
service/management server.

failing the template download if virutalsize or some other properties
cannot be determined.

The following changes are done:
getVirtualSize() to always return size(if it can calculate, get virtual
size else return file size). This would mean the following changes

1. QCOW2Processor.getVirtualSize() to return file size if virtual
size calculation fails
2. VHDProcessor.getVirtualSize() to return file size if virtual size
calculation fails

process() to throw InternalErrorException if virtual size calculation
fails or any other exceptions occur. This would mean the following
changes

1. OVAProcessor to throw InternalErrorException if untar fails
2. QCOW2Processor to throw InternalErrorException if virtual size
calculation fails
3. VHDProcessor to throw InternalErrorException if virtual size
calculation fails

Testing:
added unittests for the changes in the file processors.
manual test:
setup: host xenserver 6.5, management server centos 6.7
template: disk created using the process specified by andy at https://issues.apache.org/jira/browse/CLOUDSTACK-8808?focusedCommentId=14933368
tried to register the template and it failed with an error. Template never moved to Ready state.
![screen shot 2015-09-30 at 3 53 34 pm](https://cloud.githubusercontent.com/assets/186833/10190608/76bcce92-678b-11e5-8f52-b449d149300b.png)

* pr/901:
  CLOUDSTACK-8808: Successfully registered VHD template is downloaded again due to missing virtualsize property in template.properties

Signed-off-by: Remi Bergsma <gi...@remi.nl>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/78f74295
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/78f74295
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/78f74295

Branch: refs/heads/master
Commit: 78f74295e15fd396c8d8736f4a787cc8d3b165a4
Parents: 996c2f6 1056171
Author: Remi Bergsma <gi...@remi.nl>
Authored: Fri Oct 2 16:09:35 2015 +0200
Committer: Remi Bergsma <gi...@remi.nl>
Committed: Fri Oct 2 16:09:35 2015 +0200

----------------------------------------------------------------------
 .../cloud/storage/template/OVAProcessor.java    |   2 +-
 .../cloud/storage/template/QCOW2Processor.java  |  17 ++-
 .../storage/template/TemplateLocation.java      |   4 +-
 .../cloud/storage/template/VhdProcessor.java    |  17 ++-
 .../storage/template/OVAProcessorTest.java      | 138 +++++++++++++++++++
 .../storage/template/QCOW2ProcessorTest.java    | 109 +++++++++++++++
 .../storage/template/VhdProcessorTest.java      | 110 +++++++++++++++
 .../storage/template/DownloadManagerImpl.java   |   5 +-
 8 files changed, 393 insertions(+), 9 deletions(-)
----------------------------------------------------------------------