When running the deploy-all
errand in Azure Log Analytics Nozzle version 4.0.9, the process fails with the following error:
Errand 'deploy-all' completed with error (exit code 1)
Instance deploy-all/26812383-b096-4b02-a8ac-c3ff41978e00
Exit Code 1
Stdout cf version 8.7.9+5d408bc.2024-03-06
cf api https://api.lab-tanzu.lab.com
cf auth
cf target -o system
cf create-space azure-log-analytics-nozzle-space
cf bind-security-group all_open system --space azure-log-analytics-nozzle-space
cf target -s azure-log-analytics-nozzle-space
Stderr -
Open Your Preferred Text Editor:
Use an editor like vim
, nano
, or any text editor to create a new file:
vim azure_nozzle_4.0.9.yaml
Add the Following Configuration:
Paste the YAML content below into the file. Update the deployment name (azure-log-analytics-nozzle-a0acd42e6bcc5c268dc4
) to match your specific Azure Log Analytics Nozzle deployment.
---
releases:
- name: os-conf
version: 22.3.1
url: https://bosh.io/d/github.com/cloudfoundry/os-conf-release?v=22.3.1
sha1: 9276888fc54d22950045a247d348142757ae9129
addons:
- name: azure-log-analytics-nozzle-temp-fix-for-v4.0.9
include:
deployments:
- azure-log-analytics-nozzle-a0acd42e6bcc5c268dc4
jobs:
- name: pre-start-script
release: os-conf
properties:
description: |
Edits a CAPI API query to retrieve the admin user GUID in /var/vcap/jobs/deploy-all/bin/run file.
script: |-
#!/bin/bash
sudo sed -i 's!^ ADMIN_GUID.*! ADMIN_GUID=$(_cf curl "/v3/users?usernames=system_services" | grep -o "guid\\\":\\\"[^\\\"]*" | awk -F \":\" "{print \\$2}" | sed "s/[^a-zA-Z0-9]//g")!g' /var/vcap/jobs/deploy-all/bin/run
sudo sed -i '/username": "system_services/d' /var/vcap/jobs/deploy-all/bin/run
sudo sed -i '/ grep organizations | awk -F /d' /var/vcap/jobs/deploy-all/bin/run
GUID Retrieval Update:
The script updates the ADMIN_GUID
value to correctly retrieve the system_services
user GUID using the Cloud Foundry API.
Legacy Code Removal:
It removes obsolete script lines related to the old lookup method.
Run the following command to apply the runtime configuration:
bosh update-runtime-config azure_nozzle_4.0.9.yaml --name=azure-log-analytics-nozzle-temp-fix-for-v4.0.9
Go to the Azure Log Analytics Nozzle Tile in Ops Manager.
Select Apply Changes.
Ensure the deploy-all errand is selected and click Apply Changes.
Upon successful completion, the deployment issue should be resolved.
If you upgrade the Tile to a version where this issue is fixed, remove the applied BOSH runtime configuration:
List Existing BOSH Configurations:
bosh configs
Delete the Specific Configuration:
Identify the runtime configuration related to the fix and delete it:
bosh delete-config --type=runtime --name=azure-log-analytics-nozzle-temp-fix-for-v4.0.9
Note: If the older configuration for version 4.0.8 is present, you can delete it similarly.