- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope
类的一些代码示例,展示了ZoneScope
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneScope
类的具体详情如下:
包路径:org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope
类名称:ZoneScope
暂无
代码示例来源:origin: apache/cloudstack
private Scope getZoneScope(Scope scope) {
ZoneScope zoneScope;
if (scope instanceof ClusterScope) {
ClusterScope clusterScope = (ClusterScope)scope;
zoneScope = new ZoneScope(clusterScope.getZoneId());
} else if (scope instanceof HostScope) {
HostScope hostScope = (HostScope)scope;
zoneScope = new ZoneScope(hostScope.getZoneId());
} else {
zoneScope = (ZoneScope)scope;
}
return zoneScope;
}
代码示例来源:origin: apache/cloudstack
@Override
public boolean attachZone(DataStore dataStore, ZoneScope scope, Hypervisor.HypervisorType hypervisorType) {
dataStoreHelper.attachZone(dataStore);
List<HostVO> xenServerHosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(Hypervisor.HypervisorType.XenServer, scope.getScopeId());
List<HostVO> vmWareServerHosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(Hypervisor.HypervisorType.VMware, scope.getScopeId());
List<HostVO> kvmHosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(Hypervisor.HypervisorType.KVM, scope.getScopeId());
List<HostVO> hosts = new ArrayList<HostVO>();
hosts.addAll(xenServerHosts);
hosts.addAll(vmWareServerHosts);
hosts.addAll(kvmHosts);
for (HostVO host : hosts) {
try {
_storageMgr.connectHostToSharedPool(host.getId(), dataStore.getId());
} catch (Exception e) {
logger.warn("Unable to establish a connection between " + host + " and " + dataStore, e);
}
}
return true;
}
代码示例来源:origin: apache/cloudstack
@Override
public Scope getScope() {
return new ZoneScope(imageDataStoreVO.getDataCenterId());
}
代码示例来源:origin: apache/cloudstack
@Override
public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) {
List<HostVO> xenServerHosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(HypervisorType.XenServer, scope.getScopeId());
List<HostVO> vmWareServerHosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(HypervisorType.VMware, scope.getScopeId());
List<HostVO> kvmHosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(HypervisorType.KVM, scope.getScopeId());
List<HostVO> hosts = new ArrayList<>();
hosts.addAll(xenServerHosts);
hosts.addAll(vmWareServerHosts);
hosts.addAll(kvmHosts);
for (HostVO host : hosts) {
try {
_storageMgr.connectHostToSharedPool(host.getId(), dataStore.getId());
} catch (Exception e) {
s_logger.warn("Unable to establish a connection between " + host + " and " + dataStore, e);
}
}
_dataStoreHelper.attachZone(dataStore);
return true;
}
代码示例来源:origin: apache/cloudstack
private Scope getZoneScope(Scope destScope) {
ZoneScope zoneScope = null;
if (destScope instanceof ClusterScope) {
ClusterScope clusterScope = (ClusterScope)destScope;
zoneScope = new ZoneScope(clusterScope.getZoneId());
} else if (destScope instanceof HostScope) {
HostScope hostScope = (HostScope)destScope;
zoneScope = new ZoneScope(hostScope.getZoneId());
} else {
zoneScope = (ZoneScope)destScope;
}
return zoneScope;
}
代码示例来源:origin: apache/cloudstack
@Override
public List<ImageStoreVO> findImageCacheByScope(ZoneScope scope) {
SearchCriteria<ImageStoreVO> sc = createSearchCriteria();
sc.addAnd("role", SearchCriteria.Op.EQ, DataStoreRole.ImageCache);
if (scope.getScopeId() != null) {
sc.addAnd("scope", SearchCriteria.Op.EQ, ScopeType.ZONE);
sc.addAnd("dcId", SearchCriteria.Op.EQ, scope.getScopeId());
}
return listBy(sc);
}
代码示例来源:origin: apache/cloudstack
@Override
public DataStore getImageStore(long zoneId) {
List<DataStore> stores = getImageStoresByScope(new ZoneScope(zoneId));
if (stores == null || stores.size() == 0) {
return null;
}
return imageDataStoreMgr.getImageStore(stores);
}
代码示例来源:origin: apache/cloudstack
@Override
public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) {
List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(hypervisorType, scope.getScopeId());
s_logger.debug("In createPool. Attaching the pool to each of the hosts.");
List<HostVO> poolHosts = new ArrayList<HostVO>();
for (HostVO host : hosts) {
try {
storageMgr.connectHostToSharedPool(host.getId(), dataStore.getId());
poolHosts.add(host);
} catch (Exception e) {
s_logger.warn("Unable to establish a connection between " + host + " and " + dataStore, e);
}
}
if (poolHosts.isEmpty()) {
s_logger.warn("No host can access storage pool " + dataStore + " in this zone.");
primaryDataStoreDao.expunge(dataStore.getId());
throw new CloudRuntimeException("Failed to create storage pool as it is not accessible to hosts.");
}
dataStoreHelper.attachZone(dataStore, hypervisorType);
return true;
}
代码示例来源:origin: apache/cloudstack
@Override
public DataStore getImageCacheStore(long zoneId) {
List<DataStore> stores = getImageCacheStores(new ZoneScope(zoneId));
if (stores == null || stores.size() == 0) {
return null;
}
return imageDataStoreMgr.getImageStore(stores);
}
代码示例来源:origin: apache/cloudstack
@Override
public List<ImageStoreVO> findByScope(ZoneScope scope) {
SearchCriteria<ImageStoreVO> sc = createSearchCriteria();
sc.addAnd("role", SearchCriteria.Op.EQ, DataStoreRole.Image);
if (scope.getScopeId() != null) {
SearchCriteria<ImageStoreVO> scc = createSearchCriteria();
scc.addOr("scope", SearchCriteria.Op.EQ, ScopeType.REGION);
scc.addOr("dcId", SearchCriteria.Op.EQ, scope.getScopeId());
sc.addAnd("scope", SearchCriteria.Op.SC, scc);
}
// we should return all image stores if cross-zone scope is passed
// (scopeId = null)
return listBy(sc);
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
// get all elgible image stores
List<DataStore> imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imgStores != null) {
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreDownloadStatus(templateId, store.getId(), status);
if (sRes != null && sRes.size() > 0) {
Collections.shuffle(sRes);
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) {
List<HostVO> hosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(hypervisorType, scope.getScopeId());
s_logger.debug("In createPool. Attaching the pool to each of the hosts.");
List<HostVO> poolHosts = new ArrayList<HostVO>();
for (HostVO host : hosts) {
try {
storageMgr.connectHostToSharedPool(host.getId(), dataStore.getId());
poolHosts.add(host);
} catch (StorageConflictException se) {
primaryDataStoreDao.expunge(dataStore.getId());
throw new CloudRuntimeException("Storage has already been added as local storage to host: " + host.getName());
} catch (Exception e) {
s_logger.warn("Unable to establish a connection between " + host + " and " + dataStore, e);
}
}
if (poolHosts.isEmpty()) {
s_logger.warn("No host can access storage pool " + dataStore + " in this zone.");
primaryDataStoreDao.expunge(dataStore.getId());
throw new CloudRuntimeException("Failed to create storage pool as it is not accessible to hosts.");
}
dataStoreHelper.attachZone(dataStore, hypervisorType);
return true;
}
代码示例来源:origin: apache/cloudstack
@Override
public List<DataStore> getImageStoreByTemplate(long templateId, Long zoneId) {
// find all eligible image stores for this zone scope
List<DataStore> imageStores = _dataStoreMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imageStores == null || imageStores.size() == 0) {
return null;
}
List<DataStore> stores = new ArrayList<DataStore>();
for (DataStore store : imageStores) {
// check if the template is stored there
List<TemplateDataStoreVO> storeTmpl = _tmplStoreDao.listByTemplateStore(templateId, store.getId());
if (storeTmpl != null && storeTmpl.size() > 0) {
stores.add(store);
}
}
return stores;
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZoneReady(long templateId, Long zoneId) {
List<DataStore> imgStores = null;
imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imgStores != null) {
Collections.shuffle(imgStores);
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreStatus(templateId, store.getId(), State.Ready);
if (sRes != null && sRes.size() > 0) {
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZoneStagingDownloadStatus(long templateId, Long zoneId, Status... status) {
// get all elgible image stores
List<DataStore> cacheStores = _storeMgr.getImageCacheStores(new ZoneScope(zoneId));
if (cacheStores != null) {
for (DataStore store : cacheStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreDownloadStatus(templateId, store.getId(),
status);
if (sRes != null && sRes.size() > 0) {
Collections.shuffle(sRes);
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public List<TemplateDataStoreVO> listByTemplateZoneDownloadStatus(long templateId, Long zoneId, Status... status) {
// get all elgible image stores
List<DataStore> imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imgStores != null) {
List<TemplateDataStoreVO> result = new ArrayList<TemplateDataStoreVO>();
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStoreDownloadStatus(templateId, store.getId(), status);
if (sRes != null && sRes.size() > 0) {
result.addAll(sRes);
}
}
return result;
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public TemplateDataStoreVO findByTemplateZone(long templateId, Long zoneId, DataStoreRole role) {
// get all elgible image stores
List<DataStore> imgStores = null;
if (role == DataStoreRole.Image) {
imgStores = _storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
} else if (role == DataStoreRole.ImageCache) {
imgStores = _storeMgr.getImageCacheStores(new ZoneScope(zoneId));
}
if (imgStores != null) {
for (DataStore store : imgStores) {
List<TemplateDataStoreVO> sRes = listByTemplateStore(templateId, store.getId());
if (sRes != null && sRes.size() > 0) {
return sRes.get(0);
}
}
}
return null;
}
代码示例来源:origin: apache/cloudstack
@Override
public List<DataStore> listImageCacheStores(Scope scope) {
if (scope.getScopeType() != ScopeType.ZONE) {
s_logger.debug("only support zone wide image cache stores");
return null;
}
List<ImageStoreVO> stores = dataStoreDao.findImageCacheByScope(new ZoneScope(scope.getScopeId()));
List<DataStore> imageStores = new ArrayList<DataStore>();
for (ImageStoreVO store : stores) {
imageStores.add(getImageStore(store.getId()));
}
return imageStores;
}
代码示例来源:origin: apache/cloudstack
List<DataStore> imageStores = storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
if (imageStores == null || imageStores.size() == 0) {
throw new CloudRuntimeException("Unable to find image store to download template " + profile.getTemplate());
代码示例来源:origin: apache/cloudstack
@Override
public TemplateInfo prepareIso(long isoId, long dcId, Long hostId, Long poolId) {
TemplateInfo tmplt;
boolean bypassed = false;
if (_tmplFactory.isTemplateMarkedForDirectDownload(isoId)) {
tmplt = _tmplFactory.getReadyBypassedTemplateOnPrimaryStore(isoId, poolId, hostId);
bypassed = true;
} else {
tmplt = _tmplFactory.getTemplate(isoId, DataStoreRole.Image, dcId);
}
if (tmplt == null || tmplt.getFormat() != ImageFormat.ISO) {
s_logger.warn("ISO: " + isoId + " does not exist in vm_template table");
return null;
}
if (!bypassed && tmplt.getDataStore() != null && !(tmplt.getDataStore().getTO() instanceof NfsTO)) {
// if it is s3, need to download into cache storage first
Scope destScope = new ZoneScope(dcId);
TemplateInfo cacheData = (TemplateInfo)cacheMgr.createCacheObject(tmplt, destScope);
if (cacheData == null) {
s_logger.error("Failed in copy iso from S3 to cache storage");
return null;
}
return cacheData;
} else {
return tmplt;
}
}
CloudStack SSVM启动条件源码阅读与问题解决方法: 在CloudStack建立zone的时候,经常遇到SSVM不启动,或者根本就没有SSVM的情况,分析CloudStack
CloudStack创建主存储失败(SR已经被使用),删除SR后成功 &nb
CloudStack 环境重新部署: 最近公司项目需求,由于更
CloudStack 安装及使用过程中常见问题汇总 在做工程项
我正在开发一个cloudstack框架模型,以分析Cloudstack与我组织的产品的可行性。 我试图从cloudstack的UI中删除辅助存储,但由于错误“无法删除带有事件模板备份的图像存储!”而失
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭10
本文整理了Java中org.jclouds.cloudstack.domain.Zone类的一些代码示例,展示了Zone类的具体用法。这些代码示例主要来源于Github/Stackoverflow/M
本文整理了Java中org.jclouds.cloudstack.features.ZoneClient类的一些代码示例,展示了ZoneClient类的具体用法。这些代码示例主要来源于Github/S
本文整理了Java中org.jclouds.cloudstack.predicates.ZonePredicates类的一些代码示例,展示了ZonePredicates类的具体用法。这些代码示例主要来
我想将 10-15 个 VMWare 主机部署到 cloudstack。这是我第一次使用任何类型的云。我正在研究安装和架构,我一直坚持使用 VMWare 主机我必须安装 VCenter 服务器,但我不
本文整理了Java中org.apache.cloudstack.api.response.ZoneResponse类的一些代码示例,展示了ZoneResponse类的具体用法。这些代码示例主要来源于G
我正在 ubuntu 上安装 cloudstack,它使用 maven 来解决它的依赖关系。运行命令 mvn -P deps 时出现以下错误 [ERROR] The build could not r
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDisplayText()方法的一些代码示例,展示了Zone.getDisplayText()的具体用法
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getVLAN()方法的一些代码示例,展示了Zone.getVLAN()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.builder()方法的一些代码示例,展示了Zone.builder()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.()方法的一些代码示例,展示了Zone.()的具体用法。这些代码示例主要来源于Github/Stackover
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDescription()方法的一些代码示例,展示了Zone.getDescription()的具体用法
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getName()方法的一些代码示例,展示了Zone.getName()的具体用法。这些代码示例主要来源于Gi
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getGuestCIDRAddress()方法的一些代码示例,展示了Zone.getGuestCIDRAddr
本文整理了Java中org.jclouds.cloudstack.domain.Zone.getDomain()方法的一些代码示例,展示了Zone.getDomain()的具体用法。这些代码示例主要来
我是一名优秀的程序员,十分优秀!