private void setVmdk(SnapshotInfo snapshotInfo, VolumeInfo volumeInfo) { if (!ImageFormat.OVA.equals(volumeInfo.getFormat())) { return; } String search = "]"; String path = volumeInfo.getPath(); int startIndex = path.indexOf(search); SnapshotDetailsVO snapshotDetail = new SnapshotDetailsVO(snapshotInfo.getId(), DiskTO.VMDK, path.substring(startIndex + search.length()).trim(), false); snapshotDetailsDao.persist(snapshotDetail); }
StorageVol vol = getVolume(libvirtPool.getPool(), uuid); s_logger.debug("Instructing libvirt to remove volume " + uuid + " from pool " + pool.getUuid()); if(Storage.ImageFormat.DIR.equals(format)){ deleteDirVol(libvirtPool, vol); } else {
if (rootVolume != null && ImageFormat.QCOW2.equals(rootVolume.getFormat())) { PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO) rootVolume.getDataStore(); KVMPhysicalDisk rootDisk = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(),
if (!ImageFormat.QCOW2.equals(srcVolumeInfo.getFormat())) { throw new CloudRuntimeException("Currently, only the KVM hypervisor type is supported for the migration of a volume " + "from managed storage to non-managed storage.");
VMTemplateVO tmpl = _templateDao.findByIdIncludingRemoved(volume.getTemplateId()); if (tmpl != null && !ImageFormat.ISO.equals(tmpl.getFormat())) { allocatedSizeWithTemplate = _capacityMgr.getAllocatedPoolCapacity(poolVO, tmpl);
if (!ImageFormat.QCOW2.equals(srcVolumeInfo.getFormat())) { throw new CloudRuntimeException("Currently, only the KVM hypervisor type is supported for the migration of a volume " + "from managed storage to non-managed storage.");
if (ImageFormat.DIR.equals(volume.getFormat())) { throw new InvalidParameterValueException("Snapshot not supported for volume:" + volumeId);
if (template.getFormat().equals(ImageFormat.OVA)) { if (!createOvaDataDiskTemplates(template)) { template.processEvent(ObjectInDataStoreStateMachine.Event.OperationFailed);
ImageFormat imageFormat = destVolumeInfo.getFormat(); if (!ImageFormat.QCOW2.equals(imageFormat)) { String errMsg = "The 'StorageSystemDataMotionStrategy' does not support this upload use case (non KVM).";
/** * Storage plug-ins for managed storage can be designed in such a way as to store a template on the primary storage once and * make use of it via storage-side cloning. * * This method determines how many more bytes it will need for the template (if the template is already stored on the primary storage, * then the answer is 0). */ private long getAskingSizeForTemplateBasedOnClusterAndStoragePool(Long templateId, Long clusterId, StoragePoolVO storagePoolVO) { if (templateId == null || clusterId == null || storagePoolVO == null || !storagePoolVO.isManaged()) { return 0; } VMTemplateVO tmpl = _templateDao.findByIdIncludingRemoved(templateId); if (tmpl == null || ImageFormat.ISO.equals(tmpl.getFormat())) { return 0; } HypervisorType hypervisorType = tmpl.getHypervisorType(); // The getSupportsResigning method is applicable for XenServer as a UUID-resigning patch may or may not be installed on those hypervisor hosts. if (_clusterDao.getSupportsResigning(clusterId) || HypervisorType.VMware.equals(hypervisorType) || HypervisorType.KVM.equals(hypervisorType)) { return getBytesRequiredForTemplate(tmpl, storagePoolVO); } return 0; }
@Override protected boolean templateIsCorrectType(VirtualMachineTemplate template) { return !template.getFormat().equals(ImageFormat.ISO); }
@Override protected boolean templateIsCorrectType(VirtualMachineTemplate template) { return template.getFormat().equals(ImageFormat.ISO); }
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()); }
private boolean isSupportedImageFormatForCluster(VolumeInfo volume, HypervisorType rootDiskHyperType) { ImageFormat volumeFormat = volume.getFormat(); if (rootDiskHyperType == HypervisorType.Hyperv) { if (volumeFormat.equals(ImageFormat.VHDX) || volumeFormat.equals(ImageFormat.VHD)) { return true; } else { return false; } } else { return volume.getFormat().equals(getSupportedImageFormatForCluster(rootDiskHyperType)); } }
private void verifyDiskTypeAndHypervisor(VolumeInfo volumeInfo) { ImageFormat imageFormat = volumeInfo.getFormat(); Volume.Type volumeType = volumeInfo.getVolumeType(); if (ImageFormat.OVA.equals(imageFormat) && Volume.Type.ROOT.equals(volumeType)) { throw new CloudRuntimeException("The hypervisor type is VMware and the disk type is ROOT. For this situation, " + "recover the data on the snapshot by creating a new CloudStack volume from the corresponding volume snapshot."); } }
@Override public StrategyPriority canHandle(Snapshot snapshot, SnapshotOperation op) { if (SnapshotOperation.REVERT.equals(op)) { long volumeId = snapshot.getVolumeId(); VolumeVO volumeVO = volumeDao.findById(volumeId); if (volumeVO != null && ImageFormat.QCOW2.equals(volumeVO.getFormat())) { return StrategyPriority.DEFAULT; } return StrategyPriority.CANT_HANDLE; } return StrategyPriority.DEFAULT; }