本文整理了Java中org.apache.cloudstack.engine.subsystem.api.storage.DataStore.getName()
方法的一些代码示例,展示了DataStore.getName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataStore.getName()
方法的具体详情如下:
包路径:org.apache.cloudstack.engine.subsystem.api.storage.DataStore
类名称:DataStore
方法名:getName
暂无
代码示例来源:origin: apache/cloudstack
public void logDisconnect() {
s_logger.warn("Unable to monitor upload progress of " + typeName + " at host " + sserver.getName());
}
代码示例来源:origin: apache/cloudstack
public void log(String message, Level level) {
s_logger.log(level, message + ", " + type.toString() + " = " + typeName + " at host " + sserver.getName());
}
代码示例来源:origin: apache/cloudstack
/**
* Clean volumes cache entries (if they exist).
*/
protected void cleanVolumesCache(VolumeVO volume) {
List<VolumeInfo> cacheVols = volFactory.listVolumeOnCache(volume.getId());
if (CollectionUtils.isEmpty(cacheVols)) {
return;
}
for (VolumeInfo volOnCache : cacheVols) {
s_logger.info("Delete volume from image cache store: " + volOnCache.getDataStore().getName());
volOnCache.delete();
}
}
代码示例来源:origin: apache/cloudstack
@Override
public Pair<EndPoint, DataObject> registerVolumeForPostUpload(VolumeInfo volume, DataStore store) {
EndPoint ep = _epSelector.select(store);
if (ep == null) {
String errorMessage = "There is no secondary storage VM for image store " + store.getName();
s_logger.warn(errorMessage);
throw new CloudRuntimeException(errorMessage);
}
DataObject volumeOnStore = store.create(volume);
return new Pair<>(ep, volumeOnStore);
}
代码示例来源:origin: apache/cloudstack
long storeId = store.getId();
List<TemplateDataStoreVO> destroyedTemplateStoreVOs = _templateStoreDao.listDestroyed(storeId);
s_logger.debug("Secondary storage garbage collector found " + destroyedTemplateStoreVOs.size() + " templates to cleanup on template_store_ref for store: " + store.getName());
for (TemplateDataStoreVO destroyedTemplateStoreVO : destroyedTemplateStoreVOs) {
if (s_logger.isDebugEnabled()) {
s_logger.warn("problem cleaning up templates in template_store_ref for store: " + store.getName(), e);
try {
List<SnapshotDataStoreVO> destroyedSnapshotStoreVOs = _snapshotStoreDao.listDestroyed(store.getId());
s_logger.debug("Secondary storage garbage collector found " + destroyedSnapshotStoreVOs.size() + " snapshots to cleanup on snapshot_store_ref for store: " + store.getName());
for (SnapshotDataStoreVO destroyedSnapshotStoreVO : destroyedSnapshotStoreVOs) {
s_logger.warn("problem cleaning up snapshots in snapshot_store_ref for store: " + store.getName(), e2);
try {
List<VolumeDataStoreVO> destroyedStoreVOs = _volumeStoreDao.listDestroyed(store.getId());
s_logger.debug("Secondary storage garbage collector found " + destroyedStoreVOs.size() + " volumes to cleanup on volume_store_ref for store: " + store.getName());
for (VolumeDataStoreVO destroyedStoreVO : destroyedStoreVOs) {
if (s_logger.isDebugEnabled()) {
s_logger.warn("problem cleaning up volumes in volume_store_ref for store: " + store.getName(), e2);
代码示例来源:origin: apache/cloudstack
private void syncSnapshotToRegionStore(long snapshotId, DataStore store){
// if snapshot is already on region wide object store, check if it is really downloaded there (by checking install_path). Sync snapshot to region
// wide store if it is not there physically.
SnapshotInfo snapOnStore = _snapshotFactory.getSnapshot(snapshotId, store);
if (snapOnStore == null) {
throw new CloudRuntimeException("Cannot find an entry in snapshot_store_ref for snapshot " + snapshotId + " on region store: " + store.getName());
}
if (snapOnStore.getPath() == null || snapOnStore.getPath().length() == 0) {
if (s_logger.isDebugEnabled()) {
s_logger.debug("sync snapshot " + snapshotId + " from cache to object store...");
}
// snapshot is not on region store yet, sync to region store
SnapshotInfo srcSnapshot = _snapshotFactory.getReadySnapshotOnCache(snapshotId);
if (srcSnapshot == null) {
throw new CloudRuntimeException("Cannot find snapshot " + snapshotId + " on cache store");
}
AsyncCallFuture<SnapshotResult> future = syncToRegionStoreAsync(srcSnapshot, store);
try {
SnapshotResult result = future.get();
if (result.isFailed()) {
throw new CloudRuntimeException("sync snapshot from cache to region wide store failed for image store " + store.getName() + ":"
+ result.getResult());
}
_cacheMgr.releaseCacheObject(srcSnapshot); // reduce reference count for template on cache, so it can recycled by schedule
} catch (Exception ex) {
throw new CloudRuntimeException("sync snapshot from cache to region wide store failed for image store " + store.getName());
}
}
}
代码示例来源:origin: apache/cloudstack
throw new CloudRuntimeException("Cannot find an entry in template_store_ref for template " + templateId + " on region store: " + store.getName());
TemplateApiResult result = future.get();
if (result.isFailed()) {
throw new CloudRuntimeException("sync template from cache to region wide store failed for image store " + store.getName() + ":" +
result.getResult());
throw new CloudRuntimeException("sync template from cache to region wide store failed for image store " + store.getName());
代码示例来源:origin: apache/cloudstack
private void cleanupDatadiskTemplates(TemplateInfo parentTemplateInfo) {
DataStore imageStore = parentTemplateInfo.getDataStore();
List<VMTemplateVO> datadiskTemplatesToDelete = _templateDao.listByParentTemplatetId(parentTemplateInfo.getId());
for (VMTemplateVO datadiskTemplateToDelete: datadiskTemplatesToDelete) {
s_logger.info("Delete template: " + datadiskTemplateToDelete.getId() + " from image store: " + imageStore.getName());
AsyncCallFuture<TemplateApiResult> future = deleteTemplateAsync(imageFactory.getTemplate(datadiskTemplateToDelete.getId(), imageStore));
try {
TemplateApiResult result = future.get();
if (!result.isSuccess()) {
s_logger.warn("Failed to delete datadisk template: " + datadiskTemplateToDelete + " from image store: " + imageStore.getName() + " due to: " + result.getResult());
break;
}
_vmTemplateZoneDao.deletePrimaryRecordsForTemplate(datadiskTemplateToDelete.getId());
_resourceLimitMgr.decrementResourceCount(datadiskTemplateToDelete.getAccountId(), ResourceType.secondary_storage, datadiskTemplateToDelete.getSize());
} catch (Exception e) {
s_logger.debug("Delete datadisk template failed", e);
throw new CloudRuntimeException("Delete template Failed", e);
}
}
}
代码示例来源:origin: apache/cloudstack
s_logger.debug("Delete snapshot " + snapshot.getId() + " from image cache store: " + cacheSnap.getDataStore().getName());
cacheSnap.delete();
代码示例来源:origin: apache/cloudstack
EndPoint ssAhost = _epSelector.select(store);
if (ssAhost == null) {
s_logger.debug("There is no secondary storage VM for secondary storage host " + store.getName());
continue;
代码示例来源:origin: apache/cloudstack
s_logger.debug("failed to copy template from image store:" + srcSecStore.getName() + " to primary storage");
代码示例来源:origin: apache/cloudstack
TemplateApiResult result = future.get();
if (result.isFailed()) {
s_logger.debug("copy template failed for image store " + dstSecStore.getName() + ":" + result.getResult());
continue; // try next image store
if (dataDiskTemplates != null && !dataDiskTemplates.isEmpty()) {
for (VMTemplateVO dataDiskTemplate : dataDiskTemplates) {
s_logger.debug("Copying " + dataDiskTemplates.size() + " for source template " + template.getId() + ". Copy all Datadisk templates to destination datastore " + dstSecStore.getName());
TemplateInfo srcDataDiskTemplate = _tmplFactory.getTemplate(dataDiskTemplate.getId(), srcSecStore);
AsyncCallFuture<TemplateApiResult> dataDiskCopyFuture = _tmpltSvr.copyTemplate(srcDataDiskTemplate, dstSecStore);
TemplateApiResult dataDiskCopyResult = dataDiskCopyFuture.get();
if (dataDiskCopyResult.isFailed()) {
s_logger.error("Copy of datadisk template: " + srcDataDiskTemplate.getId() + " to image store: " + dstSecStore.getName()
+ " failed with error: " + dataDiskCopyResult.getResult() + " , will try copying the next one");
continue; // Continue to copy next Datadisk template
_resourceLimitMgr.incrementResourceCount(dataDiskTemplate.getAccountId(), ResourceType.secondary_storage, dataDiskTemplate.getSize());
} catch (Exception ex) {
s_logger.error("Failed to copy datadisk template: " + srcDataDiskTemplate.getId() + " to image store: " + dstSecStore.getName()
+ " , will try copying the next one");
s_logger.debug("failed to copy template to image store:" + dstSecStore.getName() + " ,will try next one");
代码示例来源:origin: apache/cloudstack
s_logger.warn("Unable to start upload of " + template.getUniqueName() + " from " + secStore.getName() + " to " + url, e);
ul.setDisconnected();
ul.scheduleStatusCheck(RequestType.GET_OR_RESTART);
代码示例来源:origin: apache/cloudstack
@Override
public void extractVolume(UploadVO uploadVolumeObj, DataStore secStore, VolumeVO volume, String url, Long dataCenterId, String installPath, long eventId,
long asyncJobId, AsyncJobManager asyncMgr) {
uploadVolumeObj.setUploadState(Upload.Status.NOT_UPLOADED);
_uploadDao.update(uploadVolumeObj.getId(), uploadVolumeObj);
start();
UploadCommand ucmd = new UploadCommand(url, volume.getId(), volume.getSize(), installPath, Type.VOLUME);
UploadListener ul =
new UploadListener(secStore, _timer, _uploadDao, uploadVolumeObj, this, ucmd, volume.getAccountId(), volume.getName(), Type.VOLUME, eventId, asyncJobId,
asyncMgr);
_listenerMap.put(uploadVolumeObj, ul);
try {
EndPoint ep = _epSelector.select(secStore);
if (ep == null) {
String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
s_logger.error(errMsg);
return;
}
ep.sendMessageAsync(ucmd, new UploadListener.Callback(ep.getId(), ul));
} catch (Exception e) {
s_logger.warn("Unable to start upload of volume " + volume.getName() + " from " + secStore.getName() + " to " + url, e);
ul.setDisconnected();
ul.scheduleStatusCheck(RequestType.GET_OR_RESTART);
}
}
代码示例来源:origin: apache/cloudstack
EndPoint ep = _epSelector.select(secStore);
if (ep == null) {
errorString = "There is no secondary storage VM for secondary storage host " + secStore.getName();
throw new CloudRuntimeException(errorString);
代码示例来源:origin: apache/cloudstack
, srcVolume.getId()
, srcRole
, destStore.getName()
, destStore.getId()
, destStore.getRole());
代码示例来源:origin: apache/cloudstack
s_logger.warn("Unable to start/resume copy of template " + srcTemplate.getUniqueName() + " to " + destStore.getName() +
", no secondary storage vm in running state in source zone");
throw new CloudRuntimeException("No secondary VM in running state in source template zone ");
代码示例来源:origin: apache/cloudstack
String errMsg = "There is no secondary storage VM for downloading template to image store " + store.getName();
s_logger.warn(errMsg);
throw new CloudRuntimeException(errMsg);
ep.sendMessageAsync(dcmd, new UploadListener.Callback(ep.getId(), dl));
} catch (Exception e) {
s_logger.warn("Unable to start /resume download of template " + template.getId() + " to " + store.getName(), e);
dl.setDisconnected();
dl.scheduleStatusCheck(RequestType.GET_OR_RESTART);
代码示例来源:origin: apache/cloudstack
String errMsg = "There is no secondary storage VM for downloading template to image store " + imageStore.getName();
s_logger.warn(errMsg);
throw new CloudRuntimeException(errMsg);
代码示例来源:origin: apache/cloudstack
s_logger.warn("There is no secondary storage VM for image store " + store.getName());
return;
ep.sendMessageAsync(dcmd, new UploadListener.Callback(ep.getId(), dl));
} catch (Exception e) {
s_logger.warn("Unable to start /resume download of volume " + volume.getId() + " to " + store.getName(), e);
dl.setDisconnected();
dl.scheduleStatusCheck(RequestType.GET_OR_RESTART);
内容来源于网络,如有侵权,请联系作者删除!