Skip to content

Commit f965e2d

Browse files
committed
Download system template while adding S3 image store is working.
1 parent 0824be3 commit f965e2d

5 files changed

Lines changed: 15 additions & 7 deletions

File tree

core/src/com/cloud/storage/resource/LocalNfsSecondaryStorageResource.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import java.net.URISyntaxException;
1111
import java.net.URL;
1212
import java.util.List;
13+
import java.util.concurrent.Executors;
1314

1415
import org.apache.cloudstack.storage.command.DownloadSystemTemplateCommand;
1516
import org.springframework.stereotype.Component;
@@ -34,6 +35,7 @@ public class LocalNfsSecondaryStorageResource extends
3435

3536
public LocalNfsSecondaryStorageResource(){
3637
this._dlMgr = new DownloadManagerImpl();
38+
((DownloadManagerImpl)_dlMgr).setThreadPool(Executors.newFixedThreadPool(10));
3739
}
3840

3941
@Override

core/src/com/cloud/storage/template/S3TemplateDownloader.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,9 @@ public long download(boolean resume, DownloadCompleteCallback callback) {
279279
@Override
280280
public void progressChanged(
281281
ProgressEvent progressEvent) {
282-
s_logger.info(progressEvent.getBytesTransfered()
283-
+ " number of byte transferd "
284-
+ new Date());
282+
// s_logger.debug(progressEvent.getBytesTransfered()
283+
// + " number of byte transferd "
284+
// + new Date());
285285
totalBytes += progressEvent.getBytesTransfered();
286286
if (progressEvent.getEventCode() == ProgressEvent.COMPLETED_EVENT_CODE) {
287287
s_logger.info("download completed");

engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,9 @@ protected Void createTemplateCallback(AsyncCallbackDispatcher<TemplateServiceImp
477477
return null;
478478
}
479479

480-
parentCallback.complete(result);
480+
if (parentCallback != null){
481+
parentCallback.complete(result);
482+
}
481483
return null;
482484
}
483485

setup/db/db/schema-410to420.sql

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ CREATE VIEW `cloud`.`image_store_view` AS
105105
image_store.protocol,
106106
image_store.url,
107107
image_store.scope,
108+
image_store.role,
108109
data_center.id data_center_id,
109110
data_center.uuid data_center_uuid,
110111
data_center.name data_center_name,
@@ -115,8 +116,8 @@ CREATE VIEW `cloud`.`image_store_view` AS
115116
left join
116117
`cloud`.`data_center` ON image_store.data_center_id = data_center.id
117118
left join
118-
`cloud`.`image_store_details` ON image_store_details.store_id = image_store.id
119-
where image_store.role = 'Image';
119+
`cloud`.`image_store_details` ON image_store_details.store_id = image_store.id;
120+
120121

121122
-- here we have to allow null for store_id to accomodate baremetal case to search for ready templates since template state is only stored in this table
122123
-- FK also commented out due to this
@@ -732,3 +733,6 @@ CREATE VIEW `cloud`.`volume_view` AS
732733
`cloud`.`async_job` ON async_job.instance_id = volumes.id
733734
and async_job.instance_type = 'Volume'
734735
and async_job.job_status = 0;
736+
737+
update `cloud`.`vm_template` set state='Allocated' where state is NULL;
738+
update `cloud`.`vm_template` set update_count=0 where update_count is NULL;

tools/devcloud/devcloud_s3.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
},
9292
{
9393
"key" : "secretkey",
94-
"value" : "OYAZXCAFUC1DAFOXNJWI"
94+
"value" : "YHpRtzNDwl12DtrQmwRvdpnf2xK2AeVM30rXxQ=="
9595
},
9696
{
9797
"key" : "endpoint",

0 commit comments

Comments
 (0)