本文整理了Java中org.apache.cloudstack.engine.subsystem.api.storage.DataStore.getUri()
方法的一些代码示例,展示了DataStore.getUri()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataStore.getUri()
方法的具体详情如下:
包路径:org.apache.cloudstack.engine.subsystem.api.storage.DataStore
类名称:DataStore
方法名:getUri
暂无
代码示例来源:origin: apache/cloudstack
private String getSecondaryStorageStoreUrl(long zoneId) {
String secUrl = null;
DataStore secStore = _dataStoreMgr.getImageStore(zoneId);
if (secStore != null) {
secUrl = secStore.getUri();
}
if (secUrl == null) {
s_logger.warn("Secondary storage uri couldn't be retrieved");
}
return secUrl;
}
代码示例来源:origin: apache/cloudstack
@Override
public String getSecondaryStorageURL(long zoneId) {
DataStore secStore = _dataStoreMgr.getImageStore(zoneId);
if (secStore == null) {
return null;
}
return secStore.getUri();
}
代码示例来源:origin: apache/cloudstack
@Override
public Pair<String, String> getAbsoluteIsoPath(long templateId, long dataCenterId) {
TemplateDataStoreVO templateStoreRef = _tmplStoreDao.findByTemplateZoneDownloadStatus(templateId, dataCenterId, VMTemplateStorageResourceAssoc.Status.DOWNLOADED);
if (templateStoreRef == null) {
throw new CloudRuntimeException("Template " + templateId + " has not been completely downloaded to zone " + dataCenterId);
}
DataStore store = _dataStoreMgr.getDataStore(templateStoreRef.getDataStoreId(), DataStoreRole.Image);
String isoPath = store.getUri() + "/" + templateStoreRef.getInstallPath();
return new Pair<String, String>(isoPath, store.getUri());
}
代码示例来源:origin: apache/cloudstack
protected void attachCluster(DataStore store) {
// send down AttachPrimaryDataStoreCmd command to all the hosts in the
// cluster
List<EndPoint> endPoints = selector.selectAll(store);
CreatePrimaryDataStoreCmd createCmd = new CreatePrimaryDataStoreCmd(store.getUri());
EndPoint ep = endPoints.get(0);
HostVO host = hostDao.findById(ep.getId());
if (host.getHypervisorType() == HypervisorType.XenServer) {
ep.sendMessage(createCmd);
}
endPoints.get(0).sendMessage(createCmd);
AttachPrimaryDataStoreCmd cmd = new AttachPrimaryDataStoreCmd(store.getUri());
for (EndPoint endp : endPoints) {
endp.sendMessage(cmd);
}
}
代码示例来源:origin: apache/cloudstack
@Override
public String getSecondaryStorageURL(SnapshotVO snapshot) {
SnapshotDataStoreVO snapshotStore = _snapshotStoreDao.findBySnapshot(snapshot.getId(), DataStoreRole.Image);
if (snapshotStore != null) {
DataStore store = dataStoreMgr.getDataStore(snapshotStore.getDataStoreId(), DataStoreRole.Image);
if (store != null) {
return store.getUri();
}
}
throw new CloudRuntimeException("Can not find secondary storage hosting the snapshot");
}
代码示例来源:origin: apache/cloudstack
@Override
public String getUri() {
if (dataStore == null) {
throw new CloudRuntimeException("datastore must be set before using this object");
}
DataObjectInStore obj = objectInStoreMgr.findObject(volumeVO.getId(), DataObjectType.VOLUME, dataStore.getId(), dataStore.getRole());
if (obj.getState() != ObjectInDataStoreStateMachine.State.Ready) {
return dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&" + EncodingType.SIZE + "=" + volumeVO.getSize() + "&" +
EncodingType.NAME + "=" + volumeVO.getName();
} else {
return dataStore.getUri() + "&" + EncodingType.OBJTYPE + "=" + DataObjectType.VOLUME + "&" + EncodingType.PATH + "=" + obj.getInstallPath();
}
}
代码示例来源:origin: apache/cloudstack
private Map<Long, TemplateProp> listVolume(DataStore store) {
ListVolumeCommand cmd = new ListVolumeCommand(store.getTO(), store.getUri());
EndPoint ep = _epSelector.select(store);
Answer answer = null;
if (ep == null) {
String errMsg = "No remote endpoint to send command, check if host or ssvm is down?";
s_logger.error(errMsg);
answer = new Answer(cmd, false, errMsg);
} else {
answer = ep.sendMessage(cmd);
}
if (answer != null && answer.getResult()) {
ListVolumeAnswer tanswer = (ListVolumeAnswer)answer;
return tanswer.getTemplateInfo();
} else {
if (s_logger.isDebugEnabled()) {
s_logger.debug("Can not list volumes for image store " + store.getId());
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
ConcurrentHashMap<Long, StorageStats> storageStats = new ConcurrentHashMap<Long, StorageStats>();
for (DataStore store : stores) {
if (store.getUri() == null) {
continue;
代码示例来源:origin: apache/cloudstack
success = false;
if (answer != null) {
s_logger.warn("Failed to delete all snapshot for volume " + volumeId + " on secondary storage " + ssHost.getUri());
s_logger.error(answer.getDetails());
代码示例来源:origin: apache/cloudstack
.getChecksum(), tmpl.getType().toString(), template.getUniqueName(), template.getFormat().toString(), templateOnStore.getDataStore().getUri(),
templateOnStore.getDataStore().getRole().toString());
代码示例来源:origin: apache/cloudstack
destVolumeInfo.getDataStore().getUri(), true, StorageManager.KvmStorageOfflineMigrationWait.value(), true);
代码示例来源:origin: apache/cloudstack
vol.getName(), vol.getFormat().toString(), dataObject.getDataStore().getUri(), dataObject.getDataStore().getRole().toString());
command.setLocalPath(volumeStore.getLocalDownloadPath());
内容来源于网络,如有侵权,请联系作者删除!