本文整理了Java中com.cloud.storage.Volume.getVolumeType()
方法的一些代码示例,展示了Volume.getVolumeType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Volume.getVolumeType()
方法的具体详情如下:
包路径:com.cloud.storage.Volume
类名称:Volume
方法名:getVolumeType
暂无
代码示例来源:origin: apache/cloudstack
private DataStore getPlannedDataStore(DeployDestination dest, DataStore dataStore) {
for (final Volume volume : dest.getStorageForDisks().keySet()) {
if (volume.getVolumeType() == Volume.Type.ROOT) {
final StoragePool primaryPool = dest.getStorageForDisks().get(volume);
dataStore = _dataStoreMgr.getDataStore(primaryPool.getId(), DataStoreRole.Primary);
break;
}
}
return dataStore;
}
代码示例来源:origin: apache/cloudstack
storageBuf.append(vol.getId());
storageBuf.append("|");
storageBuf.append(vol.getVolumeType().name());
storageBuf.append("-->Pool(");
storageBuf.append(_storage.get(vol).getId());
代码示例来源:origin: apache/cloudstack
for (Volume vol : volumesOrderBySizeDesc) {
haveEnoughSpace = false;
s_logger.debug("Checking if host: " + potentialHost.getId() + " can access any suitable storage pool for volume: " + vol.getVolumeType());
List<StoragePool> volumePoolList = suitableVolumeStoragePools.get(vol);
hostCanAccessPool = false;
代码示例来源:origin: apache/cloudstack
public DiskProfile(Volume vol, DiskOffering offering, HypervisorType hyperType) {
this(vol.getId(),
vol.getVolumeType(),
vol.getName(),
offering.getId(),
vol.getSize(),
offering.getTagsArray(),
offering.isUseLocalStorage(),
offering.isCustomized(),
null);
this.hyperType = hyperType;
this.provisioningType = offering.getProvisioningType();
}
代码示例来源:origin: apache/cloudstack
protected DiskProfile toDiskProfile(Volume vol, DiskOffering offering) {
return new DiskProfile(vol.getId(), vol.getVolumeType(), vol.getName(), offering.getId(), vol.getSize(), offering.getTagsArray(), offering.isUseLocalStorage(), offering.isRecreatable(),
vol.getTemplateId());
}
代码示例来源:origin: apache/cloudstack
public VolumeTO(Volume volume, StoragePool pool) {
this.id = volume.getId();
this.name = volume.getName();
this.path = volume.getPath();
this.size = volume.getSize();
this.type = volume.getVolumeType();
this.storagePoolType = pool.getPoolType();
this.storagePoolUuid = pool.getUuid();
this.mountPoint = volume.getFolder();
this.chainInfo = volume.getChainInfo();
this.chainSize = volume.getVmSnapshotChainSize();
if (volume.getDeviceId() != null)
this.deviceId = volume.getDeviceId();
}
代码示例来源:origin: apache/cloudstack
that.getMaxIops(),
that.get_iScsiName(),
that.getVolumeType());
recreatable = that.isRecreatable();
代码示例来源:origin: apache/cloudstack
@Override
public boolean postStateTransitionEvent(StateMachine2.Transition<State, Event> transition, Volume vol, boolean status, Object opaque) {
pubishOnEventBus(transition.getEvent().name(), "postStateTransitionEvent", vol, transition.getCurrentState(), transition.getToState());
if(transition.isImpacted(StateMachine2.Transition.Impact.USAGE)) {
Long instanceId = vol.getInstanceId();
VMInstanceVO vmInstanceVO = null;
if(instanceId != null) {
vmInstanceVO = _vmInstanceDao.findById(instanceId);
}
if(instanceId == null || vmInstanceVO.getType() == VirtualMachine.Type.User) {
if (transition.getToState() == State.Ready) {
if (transition.getCurrentState() == State.Resizing) {
// Log usage event for volumes belonging user VM's only
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_RESIZE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(),
vol.getDiskOfferingId(), vol.getTemplateId(), vol.getSize(), Volume.class.getName(), vol.getUuid());
} else {
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), vol.getDiskOfferingId(), null, vol.getSize(),
Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());
}
} else if (transition.getToState() == State.Destroy && vol.getVolumeType() != Volume.Type.ROOT) { //Do not Publish Usage Event for ROOT Disk as it would have been published already while destroying a VM
UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(),
Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume());
} else if (transition.getToState() == State.Uploaded) {
//Currently we are not capturing Usage for Secondary Storage so Usage for this operation will be captured when it is moved to primary storage
}
}
}
return true;
}
代码示例来源:origin: apache/cloudstack
public VolumeVO allocateDuplicateVolumeVO(Volume oldVol, Long templateId) {
VolumeVO newVol = new VolumeVO(oldVol.getVolumeType(), oldVol.getName(), oldVol.getDataCenterId(), oldVol.getDomainId(), oldVol.getAccountId(), oldVol.getDiskOfferingId(),
oldVol.getProvisioningType(), oldVol.getSize(), oldVol.getMinIops(), oldVol.getMaxIops(), oldVol.get_iScsiName());
if (templateId != null) {
newVol.setTemplateId(templateId);
} else {
newVol.setTemplateId(oldVol.getTemplateId());
}
newVol.setDeviceId(oldVol.getDeviceId());
newVol.setInstanceId(oldVol.getInstanceId());
newVol.setRecreatable(oldVol.isRecreatable());
newVol.setFormat(oldVol.getFormat());
return _volsDao.persist(newVol);
}
代码示例来源:origin: apache/cloudstack
} else {
DataTO volTO = volFactory.getVolume(volume.getId()).getTO();
DiskTO disk = new DiskTO(volTO, volume.getDeviceId(), volume.getPath(), volume.getVolumeType());
代码示例来源:origin: apache/cloudstack
DiskTO disk = storageMgr.getDiskWithThrottling(volTO, vol.getVolumeType(), vol.getDeviceId(), vol.getPath(), vm.getServiceOfferingId(), vol.getDiskOfferingId());
DataStore dataStore = dataStoreMgr.getDataStore(vol.getPoolId(), DataStoreRole.Primary);
代码示例来源:origin: apache/cloudstack
DiskTO disk = new DiskTO(volTO, volume.getDeviceId(), volume.getPath(), volume.getVolumeType());
内容来源于网络,如有侵权,请联系作者删除!