logWarning("System container found but is OFF. Starting."); startSystemContainer(existingContainerState, null); } else if (existingContainerState.powerState == PowerState.PROVISIONING) { inspectContainerWithCallback(existingContainerState, (o, e) -> { if (e != null) { logWarning("Failed to deploy system container on host: %s. Will try again.", containerHostLink); recreateSystemContainer(existingContainerState, containerHostLink); return; logWarning("System container is up and running. Patch the state from provisioning" + " to running on host %s", containerHostLink); .setCompletion((op, ex) -> { if (ex != null) { logWarning("Fail to patch the state from provisioning to running of" + " system container state on host %s", containerHostLink);
logWarning("'containerHostLink' is required"); op.setStatusCode(Operation.STATUS_CODE_NOT_MODIFIED); op.complete();
private void unlockCurrentDataCollectionForHost(String containerHostLink) { ContainerListCallback body = new ContainerListCallback(); body.containerHostLink = containerHostLink; body.unlockDataCollectionForHost = true; sendRequest(Operation .createPatch(getUri()) .setBodyNoCloning(body) .setCompletion((o, ex) -> { if (ex != null) { logWarning("Self patch failed: %s", ex instanceof CancellationException ? ex.getMessage() : Utils.toString(ex)); } })); }
.query(containerQuery, (r) -> { if (r.hasException()) { logWarning("Failed to retrieve containers for host: %s", containerHostLink); } else { logFine("Found %s containers for container host: %s", .query(systemContainerQuery, (result) -> { if (result.hasException()) { logWarning("Failed to retrieve system containers for host: %s", containerHostLink); } else {
.setCompletion((o, e) -> { if (e != null) { logWarning("Failure deleting system container.Error %s", Utils.toString(e)); return;
.setCompletion((o, e) -> { if (e != null) { logWarning("Failure provisioning system container: %s", Utils.toString(e)); return;
private void installSystemContainerToHost(String containerHostLink, String systemContainerName, ContainerDescription containerDesc) { if (DeploymentProfileConfig.getInstance().isTest()) { logWarning("No system containers will be installed in test mode..."); return;
if (ex != null) { if (OperationUtil.isServiceAlreadyStarted(ex, o)) { logWarning("Container state already exists for container (id=%s)", containerState.id); } else {
.query(containerQuery, (r) -> { if (r.hasException()) { logWarning("Failed to retrieve system container state: %s", containerState.documentSelfLink); } else if (r.hasResult()) { .setCompletion((o, e) -> { if (e != null) { logWarning("Failure creating system container: %s", Utils.toString(e)); return;
.setCompletion((op, ex) -> { if (ex != null) { logWarning("Failed deleting ContainerState of missing container: %s", containerState.documentSelfLink, ex); return; containerState.documentSelfLink); } else if (ex != null) { logWarning("Failed to mark container %s as missing: %s", containerState.documentSelfLink, Utils.toString(ex)); } else {
logWarning("Failure retrieving system container: %s", r.getException() instanceof CancellationException ? r.getException().getMessage() .setCompletion((o, e) -> { if (e != null) { logWarning("Failure creating system container: %s", Utils.toString(e)); return;
private void startSystemContainer(ContainerState containerState, ServiceTaskCallback serviceTaskCallback) { AdapterRequest adapterRequest = new AdapterRequest(); adapterRequest.resourceReference = UriUtils .buildUri(getHost(), containerState.documentSelfLink); adapterRequest.operationTypeId = ContainerOperationType.START.id; if (serviceTaskCallback == null) { String systemContainerName = isSystemContainer( SystemContainerDescriptions.getSystemContainerNames(), containerState.names); startAndCreateCallbackHandlerService(systemContainerName, createSystemContainerReadyHandler(containerState), (callback) -> startSystemContainer(containerState, callback)); return; } adapterRequest.serviceTaskCallback = serviceTaskCallback; sendRequest(Operation .createPatch(getHost(), containerState.adapterManagementReference.toString()) .setBodyNoCloning(adapterRequest) .setCompletion((o, e) -> { if (e != null) { logWarning("Failure starting system container: %s", Utils.toString(e)); return; } logInfo("Starting system container: %s with name: %s ...", containerState.documentSelfLink, containerState.names); })); }
if (e != null) { if (retryCount > 0) { logWarning("Retrying with count %s after error importing system" + " container SSL certificate from '%s':\n%s", retryCount, request.hostUri, Utils.toString(e));