CLOUDSTACK-2947: fix create template from snapshot, in case of mix zone-wide/cluster wide primary storage

This commit is contained in:
Edison Su 2013-06-20 16:53:15 -07:00
parent 09f50ca506
commit 6b9ea1761a
2 changed files with 13 additions and 3 deletions

View File

@ -123,6 +123,10 @@ under the License.
<priority value="DEBUG"/>
</category>
<category name="org.apache.cloudstack">
<priority value="DEBUG"/>
</category>
<category name="com.cloud.utils.nio">
<priority value="INFO"/>
</category>

View File

@ -361,9 +361,15 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C
if (pool.getStatus() != StoragePoolStatus.Up) {
continue;
}
ClusterVO cluster = _clusterDao.findById(pool.getClusterId());
if (type == cluster.getHypervisorType()) {
retPools.add(pool);
if (pool.getScope() == ScopeType.ZONE) {
if (pool.getHypervisor() != null && pool.getHypervisor() == type) {
retPools.add(pool);
}
} else {
ClusterVO cluster = _clusterDao.findById(pool.getClusterId());
if (type == cluster.getHypervisorType()) {
retPools.add(pool);
}
}
}
Collections.shuffle(retPools);