public void logDisconnect() { s_logger.warn("Unable to monitor download progress of " + object.getType() + ": " + object.getId() + " at host " + _ssAgent.getId()); }
public void log(String message, Level level) { s_logger.log(level, message + ", " + object.getType() + ": " + object.getId() + " at host " + _ssAgent.getId()); }
private Long findAgentIdForImageStore(final DataStore dataStore) throws ResourceUnavailableException { EndPoint endpoint = _ep.select(dataStore); if (endpoint == null) { throw new ResourceUnavailableException("Config drive creation failed, secondary store not available", dataStore.getClass(), dataStore.getId()); } return endpoint.getId(); }
public void sendCommand(RequestType reqType) { if (getJobId() != null) { if (s_logger.isTraceEnabled()) { log("Sending progress command ", Level.TRACE); } try { EndPoint ep = _epSelector.select(sserver); if (ep == null) { String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; s_logger.error(errMsg); return; } ep.sendMessageAsync(new UploadProgressCommand(getCommand(), getJobId(), reqType), new Callback(ep.getId(), this)); } catch (Exception e) { s_logger.debug("Send command failed", e); setDisconnected(); } } }
public void sendCommand(RequestType reqType) { if (getJobId() != null) { if (s_logger.isTraceEnabled()) { log("Sending progress command ", Level.TRACE); } try { DownloadProgressCommand dcmd = new DownloadProgressCommand(getCommand(), getJobId(), reqType); if (object.getType() == DataObjectType.VOLUME) { dcmd.setResourceType(ResourceType.VOLUME); } _ssAgent.sendMessageAsync(dcmd, new UploadListener.Callback(_ssAgent.getId(), this)); } catch (Exception e) { s_logger.debug("Send command failed", e); setDisconnected(); } } }
protected void attachCluster(DataStore store) { // send down AttachPrimaryDataStoreCmd command to all the hosts in the // cluster List<EndPoint> endPoints = selector.selectAll(store); CreatePrimaryDataStoreCmd createCmd = new CreatePrimaryDataStoreCmd(store.getUri()); EndPoint ep = endPoints.get(0); HostVO host = hostDao.findById(ep.getId()); if (host.getHypervisorType() == HypervisorType.XenServer) { ep.sendMessage(createCmd); } endPoints.get(0).sendMessage(createCmd); AttachPrimaryDataStoreCmd cmd = new AttachPrimaryDataStoreCmd(store.getUri()); for (EndPoint endp : endPoints) { endp.sendMessage(cmd); } }
@Override public void extractVolume(UploadVO uploadVolumeObj, DataStore secStore, VolumeVO volume, String url, Long dataCenterId, String installPath, long eventId, long asyncJobId, AsyncJobManager asyncMgr) { uploadVolumeObj.setUploadState(Upload.Status.NOT_UPLOADED); _uploadDao.update(uploadVolumeObj.getId(), uploadVolumeObj); start(); UploadCommand ucmd = new UploadCommand(url, volume.getId(), volume.getSize(), installPath, Type.VOLUME); UploadListener ul = new UploadListener(secStore, _timer, _uploadDao, uploadVolumeObj, this, ucmd, volume.getAccountId(), volume.getName(), Type.VOLUME, eventId, asyncJobId, asyncMgr); _listenerMap.put(uploadVolumeObj, ul); try { EndPoint ep = _epSelector.select(secStore); if (ep == null) { String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; s_logger.error(errMsg); return; } ep.sendMessageAsync(ucmd, new UploadListener.Callback(ep.getId(), ul)); } catch (Exception e) { s_logger.warn("Unable to start upload of volume " + volume.getName() + " from " + secStore.getName() + " to " + url, e); ul.setDisconnected(); ul.scheduleStatusCheck(RequestType.GET_OR_RESTART); } }
return null; ep.sendMessageAsync(ucmd, new UploadListener.Callback(ep.getId(), ul)); } catch (Exception e) { s_logger.warn("Unable to start upload of " + template.getUniqueName() + " from " + secStore.getName() + " to " + url, e);
continue; Host host = _hostDao.findById(ep.getId()); UploadStatusCommand cmd = new UploadStatusCommand(volume.getUuid(), EntityType.Volume); if (host != null && host.getManagementServerId() != null) { continue; Host host = _hostDao.findById(ep.getId()); UploadStatusCommand cmd = new UploadStatusCommand(template.getUuid(), EntityType.Template); if (host != null && host.getManagementServerId() != null) {
s_logger.warn("Copy may not be handled correctly by agent(id: " + (ep != null ? ep.getId() : "\"unspecified\"") + ")." + " Delete " + cacheType + " cache(id: " + cacheId + ", uuid: " + cacheUuid + ")");
ep.sendMessageAsync(dcmd, new UploadListener.Callback(ep.getId(), dl)); } catch (Exception e) { s_logger.warn("Unable to start /resume download of template " + template.getId() + " to " + store.getName(), e);
continue; Host host = _hostDao.findById(ep.getId()); if (host != null && host.getManagementServerId() != null) { if (_serverId == host.getManagementServerId().longValue()) { continue; Host host = _hostDao.findById(ep.getId()); if (host != null && host.getManagementServerId() != null) { if (_serverId == host.getManagementServerId().longValue()) {
ep.sendMessageAsync(dcmd, new UploadListener.Callback(ep.getId(), dl)); } catch (Exception e) { s_logger.warn("Unable to start /resume download of volume " + volume.getId() + " to " + store.getName(), e);