@Override public void run(final FlowTrigger trigger, Map data) { final ParamOut out = (ParamOut) data.get(ParamOut.class); CreateTemporaryVolumeFromSnapshotMsg msg = new CreateTemporaryVolumeFromSnapshotMsg(); msg.setPrimaryStorageUuid(paramIn.getPrimaryStorageUuid()); msg.setSnapshot(paramIn.getSnapshot()); msg.setTemporaryVolumeUuid(paramIn.getImage().getUuid()); msg.setHypervisorType(hvtype.toString()); bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, paramIn.getPrimaryStorageUuid()); bus.send(msg, new CloudBusCallBack(trigger) { @Override public void run(MessageReply reply) { if (!reply.isSuccess()) { trigger.fail(reply.getError()); } else { CreateTemporaryVolumeFromSnapshotReply r = reply.castReply(); ctx.tempInstallPath = r.getInstallPath(); out.setActualSize(r.getActualSize()); out.setSize(r.getSize()); trigger.next(); } } }); }
ask.setImageUuid(paramIn.getImage().getUuid()); ask.setBackupStorageUuid(paramIn.getBackupStorageUuid()); ask.setImageMediaType(paramIn.getImage().getMediaType()); bus.makeTargetServiceIdByResourceUuid(ask, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); MessageReply ar = bus.call(ask);
ask.setImageUuid(paramIn.getImage().getUuid()); ask.setBackupStorageUuid(paramIn.getBackupStorageUuid()); ask.setImageMediaType(paramIn.getImage().getMediaType()); bus.makeTargetServiceIdByResourceUuid(ask, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); MessageReply ar = bus.call(ask); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); msg.setBackupStorageInstallPath(bsInstallPath); msg.setImageUuid(paramIn.getImage().getUuid()); bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, paramIn.getPrimaryStorageUuid());
BackupStorageAskInstallPathMsg ask = new BackupStorageAskInstallPathMsg(); ask.setBackupStorageUuid(paramIn.getBackupStorageUuid()); ask.setImageMediaType(paramIn.getImage().getMediaType()); ask.setImageUuid(paramIn.getImage().getUuid()); bus.makeTargetServiceIdByResourceUuid(ask, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); MessageReply areply = bus.call(ask); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); msg.setBackupStorageInstallPath(bsInstallPath); msg.setImageUuid(paramIn.getImage().getUuid()); bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, paramIn.getPrimaryStorageUuid());
ask.setImageUuid(paramIn.getImage().getUuid()); ask.setBackupStorageUuid(paramIn.getBackupStorageUuid()); ask.setImageMediaType(paramIn.getImage().getMediaType()); bus.makeTargetServiceIdByResourceUuid(ask, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); MessageReply ar = bus.call(ask); msg.setBackupStorageUuid(paramIn.getBackupStorageUuid()); msg.setBackupStorageInstallPath(bsInstallPath); msg.setImageUuid(paramIn.getImage().getUuid()); bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, paramIn.getPrimaryStorageUuid()); bus.send(msg, new CloudBusCallBack(trigger) {
ask.setImageUuid(paramIn.getImage().getUuid()); ask.setBackupStorageUuid(paramIn.getBackupStorageUuid()); ask.setImageMediaType(paramIn.getImage().getMediaType()); bus.makeTargetServiceIdByResourceUuid(ask, BackupStorageConstant.SERVICE_ID, paramIn.getBackupStorageUuid()); MessageReply ar = bus.call(ask); msg.setImageUuid(paramIn.getImage().getUuid()); msg.setPrimaryStorageUuid(paramIn.getPrimaryStorageUuid()); msg.setHypervisorType(hvType.toString());
@Override public void run(final FlowTrigger trigger, final Map data) { CreateTemporaryVolumeFromSnapshotMsg msg = new CreateTemporaryVolumeFromSnapshotMsg(); msg.setSnapshot(paramIn.getSnapshot()); msg.setPrimaryStorageUuid(paramIn.getPrimaryStorageUuid()); msg.setImageUuid(paramIn.getImage().getUuid()); bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, paramIn.getPrimaryStorageUuid()); bus.send(msg, new CloudBusCallBack(trigger) { @Override public void run(MessageReply reply) { if (!reply.isSuccess()) { trigger.fail(reply.getError()); } else { ParamOut out = (ParamOut) data.get(ParamOut.class); CreateTemporaryVolumeFromSnapshotReply r = reply.castReply(); out.setActualSize(r.getActualSize()); out.setSize(r.getSize()); ctx.temporaryInstallPath = r.getInstallPath(); ctx.hostUuid = r.getHostUuid(); trigger.next(); } } }); }
@Override public void run(final FlowTrigger trigger, final Map data) { CreateTemporaryVolumeFromSnapshotMsg msg = new CreateTemporaryVolumeFromSnapshotMsg(); msg.setHypervisorType(hvType.toString()); msg.setPrimaryStorageUuid(paramIn.getPrimaryStorageUuid()); msg.setTemporaryVolumeUuid(paramIn.getImage().getUuid()); msg.setSnapshot(paramIn.getSnapshot()); bus.makeTargetServiceIdByResourceUuid(msg, PrimaryStorageConstant.SERVICE_ID, paramIn.getPrimaryStorageUuid()); bus.send(msg, new CloudBusCallBack(trigger) { @Override public void run(MessageReply reply) { if (!reply.isSuccess()) { trigger.fail(reply.getError()); } else { ParamOut paramOut = (ParamOut) data.get(ParamOut.class); CreateTemporaryVolumeFromSnapshotReply ar = reply.castReply(); ctx.temporaryInstallPath = ar.getInstallPath(); paramOut.setSize(ar.getSize()); paramOut.setActualSize(ar.getActualSize()); trigger.next(); } } }); }