String preDetach(PrimaryStorageVO vo, String clusterUuid) throws PrimaryStorageException { PrimaryStorageInventory inv = PrimaryStorageInventory.valueOf(vo); for (PrimaryStorageDetachExtensionPoint extp : detachExts) { try { extp.preDetachPrimaryStorage(inv, clusterUuid); } catch (PrimaryStorageException pe) { logger.debug(String.format("%s refused to detach primary storage[uuid:%s, name: %s] because %s", extp.getClass().getName(), inv.getUuid(), inv.getName(), pe.getMessage())); throw pe; } catch (Exception e) { logger.warn("Exception happened when calling preDetach of PrimaryStorageDetachExtensionPoint", e); } } return null; }
@Override public void run(List<MessageReply> replies) { if (!action.isActionCode(CascadeConstant.DELETION_FORCE_DELETE_CODE)) { for (MessageReply r : replies) { if (!r.isSuccess()) { completion.fail(r.getError()); return; } } } List<String> uuids = new ArrayList<>(); for (MessageReply r : replies) { PrimaryStorageInventory inv = prinvs.get(replies.indexOf(r)); uuids.add(inv.getUuid()); logger.debug(String.format("delete primary storage[uuid:%s, name:%s]", inv.getUuid(), inv.getName())); } dbf.removeByPrimaryKeys(uuids, PrimaryStorageVO.class); completion.success(); } });
+ "version[%s]. qemu-img version greater than %s is incompatible with versions less than %s, this will causes volume snapshot operation " + "to fail. Please avoid attaching a primary storage to clusters that have different Linux distributions, in order to prevent qemu-img version mismatch", inv.getUuid(), inv.getName(), clusterUuid, versionInCluster, otherVersion, QCOW3_QEMU_IMG_VERSION, QCOW3_QEMU_IMG_VERSION );
@Override public void fail(ErrorCode errorCode) { String err = String.format("failed to downloaded iso[uuid:%s, name:%s] from backup storage[uuid:%s] to primary storage[uuid:%s, name:%s]", img.getUuid(), img.getName(), msg.getIsoSpec().getSelectedBackupStorage().getBackupStorageUuid(), pinv.getUuid(), pinv.getName()); logger.warn(err); reply.setError(errorCode); bus.reply(msg, reply); } }, ImageCacheInventory.class);
@Override public void success(ImageCacheInventory returnValue) { logger.debug(String.format("successfully downloaded iso[uuid:%s, name:%s] from backup storage[uuid:%s] to primary storage[uuid:%s, name:%s], path in cache: %s", img.getUuid(), img.getName(), msg.getIsoSpec().getSelectedBackupStorage().getBackupStorageUuid(), pinv.getUuid(), pinv.getName(), returnValue.getInstallUrl())); reply.setInstallPath(returnValue.getInstallUrl()); bus.reply(msg, reply); }