The VMware Tanzu for Microsoft Azure Log Analytics errand fails
search cancel

The VMware Tanzu for Microsoft Azure Log Analytics errand fails

book

Article ID: 387416

calendar_today

Updated On:

Products

VMware Tanzu Application Service

Issue/Introduction

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     -  

Resolution

Solution: Apply a BOSH Runtime Configuration

Step 1: Create the Runtime Configuration File

  1. 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
  2. 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

Explanation of the Script

  • 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.


Step 2: Apply the Runtime Configuration

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

Step 3: Apply Changes to the Azure Log Analytics Nozzle Tile

  1. Go to the Azure Log Analytics Nozzle Tile in Ops Manager.

  2. Select Apply Changes.

  3. Ensure the deploy-all errand is selected and click Apply Changes.

Upon successful completion, the deployment issue should be resolved.


Step 4: Clean Up After Upgrading the Tile

If you upgrade the Tile to a version where this issue is fixed, remove the applied BOSH runtime configuration:

  1. List Existing BOSH Configurations:

    bosh configs
  2. 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.