data.put(StartAnswer.IMAGE_FORMAT, Storage.ImageFormat.VHD.toString());
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); }
String userSelectedFormat = uploadEntity.getFormat().toString(); if (uploadedFileExtension.equals("zip") || uploadedFileExtension.equals("bz2") || uploadedFileExtension.equals("gz")) { userSelectedFormat += "." + uploadedFileExtension; String extension = uploadEntity.getFormat().getFileExtension(); String templateName = ""; if (extension.equals("iso")) {
if (template.getFormat().equals(ImageFormat.ISO)) { throw new InvalidParameterValueException("Please provide a valid template"); if (!template.getFormat().equals(ImageFormat.ISO)) { throw new InvalidParameterValueException("Please provide a valid iso"); if (!template.getFormat().equals(ImageFormat.ISO) && !_accountMgr.isRootAdmin(caller.getId())) { throw new InvalidParameterValueException("Only ROOT admins are allowed to modify isExtractable attribute."); } else {
RegisterVolumePayload payload = new RegisterVolumePayload(volumeHost.getDownloadUrl(), volumeHost.getChecksum(), vol.getFormat().toString()); vol.addPayload(payload); createVolumeAsync(vol, store);
_accountMgr.checkAccess(caller, null, true, template); if (isISO) { if (!template.getFormat().equals(ImageFormat.ISO)) { throw new InvalidParameterValueException("Invalid ISO id provided to restore the VM "); if (template.getFormat().equals(ImageFormat.ISO)) { throw new InvalidParameterValueException("Invalid template id provided to restore the VM ");
if (template.getFormat().equals(ImageFormat.ISO)) { eventType = EventTypes.EVENT_ISO_DELETE; } else {
String extension = dnld.getFormat().getFileExtension(); String templateName = ""; if (extension.equals("iso")) {
imgfmt = ImageFormat.valueOf(format.toUpperCase()); } catch (IllegalArgumentException e) { s_logger.debug("ImageFormat IllegalArgumentException: " + e.getMessage()); throw new IllegalArgumentException("Image format: " + format + " is incorrect. Supported formats are " + EnumUtils.listValues(ImageFormat.values()));
if (!ImageFormat.QCOW2.equals(volumeInfo.getFormat())) { throw new CloudRuntimeException("When using managed storage, you can only create a template from a volume on KVM currently.");
String fileName = templateName + "." + srcFormat.getFileExtension(); String destFileFullPath = destFile.getAbsolutePath() + File.separator + fileName; s_logger.debug("copy snapshot " + srcFile.getAbsolutePath() + " to template " + destFileFullPath); processor = new RawImageProcessor(); } else { throw new ConfigurationException("Unknown image format " + srcFormat.toString());
.getChecksum(), tmpl.getType().toString(), template.getUniqueName(), template.getFormat().toString(), templateOnStore.getDataStore().getUri(), templateOnStore.getDataStore().getRole().toString());
if (template.getFormat().equals(ImageFormat.ISO)) { copyEventType = EventTypes.EVENT_ISO_COPY; } else {
String extension = null; if (srcData.getObjectType() == DataObjectType.TEMPLATE) { extension = ((TemplateObjectTO)srcData).getFormat().getFileExtension(); } else if (srcData.getObjectType() == DataObjectType.VOLUME) { extension = ((VolumeObjectTO)srcData).getFormat().getFileExtension();
String uuid = UUID.randomUUID().toString() + "." + template.getFormat().getFileExtension(); // adding "." + vhd/ova... etc. CreateEntityDownloadURLCommand cmd = new CreateEntityDownloadURLCommand(((ImageStoreEntity)store).getMountPoint(), path, uuid, null); Answer ans = ep.sendMessage(cmd);
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(),