private boolean isForVMware(DataObject dataObj) { if (dataObj instanceof VolumeInfo) { return ImageFormat.OVA.equals(((VolumeInfo)dataObj).getFormat()); } if (dataObj instanceof SnapshotInfo) { return ImageFormat.OVA.equals(((SnapshotInfo)dataObj).getBaseVolume().getFormat()); } return dataObj instanceof TemplateInfo && HypervisorType.VMware.equals(((TemplateInfo)dataObj).getHypervisorType()); }
@Override public long getDataObjectSizeIncludingHypervisorSnapshotReserve(DataObject dataObject, StoragePool pool) { long volumeSize = 0; if (dataObject.getType() == DataObjectType.VOLUME) { VolumeInfo volume = (VolumeInfo)dataObject; volumeSize = getVolumeSizeIncludingHypervisorSnapshotReserve(volume.getSize(), volume.getHypervisorSnapshotReserve()); } else if (dataObject.getType() == DataObjectType.TEMPLATE) { TemplateInfo templateInfo = (TemplateInfo)dataObject; // TemplateInfo sometimes has a size equal to null. long templateSize = templateInfo.getSize() != null ? templateInfo.getSize() : 0; if (templateInfo.getHypervisorType() == Hypervisor.HypervisorType.KVM) { volumeSize = templateSize; } else { volumeSize = (long)(templateSize + templateSize * (LOWEST_HYPERVISOR_SNAPSHOT_RESERVE / 100f)); } } return Math.max(volumeSize, SolidFireUtil.MIN_VOLUME_SIZE); }
Map<String, String> extraDetails = null; if (HypervisorType.VMware.equals(templateInfo.getHypervisorType())) { extraDetails = new HashMap<>(); if (HypervisorType.VMware.equals(templateInfo.getHypervisorType())) { disconnectHostFromVolume(hostVO, volumeInfo.getPoolId(), volumeInfo.get_iScsiName());
public TemplateObjectTO(TemplateInfo template) { this.path = template.getInstallPath(); this.uuid = template.getUuid(); this.id = template.getId(); this.origUrl = template.getUrl(); this.displayText = template.getDisplayText(); this.checksum = template.getChecksum(); this.hvm = template.isRequiresHvm(); this.accountId = template.getAccountId(); this.name = template.getUniqueName(); this.format = template.getFormat(); this.uniqueName = template.getUniqueName(); this.size = template.getSize(); if (template.getDataStore() != null) { this.imageDataStore = template.getDataStore().getTO(); } this.hypervisorType = template.getHypervisorType(); }