Upgrade the Virtual Appliance in Microsoft Azure

Upgrade the Virtual Appliance in Microsoft Azure by replacing virtual machines and restoring backed-up data.

Upgrading the Virtual Appliance involves:

  • Backing up and deleting the hard disks of the existing virtual machines.
  • Deploying new virtual machines by using VHD image.
  • Restoring the backup to their hard disks.
  • Attaching the new hard disks to the older virtual machines

Splunk AppDynamics On-Premises Virtual Appliance provides the reference script that helps in upgrading the Virtual Appliance.

Note: This document contains links to Microsoft Azure documentation. Splunk AppDynamics makes no representation as to the accuracy of Microsoft Azure documentation because Microsoft Azure controls its own documentation.

Follow the steps to upgrade the Virtual Appliance in Microsoft Azure.

Back Up the Virtual Appliance Data

Back up Virtual Appliance data before upgrading virtual machines in Microsoft Azure.

Before you begin the upgrade, complete the following steps:

  1. Download the Virtual Appliance upgrade VHD file:
    1. Log in to the Downloads portal using your credentials.
    2. In Downloads, select the Virtual Appliance tab.
    3. Select VHD from the Type list.
    4. Select Download.
    Note: The file available in the downloads portal is used for both installation and upgrade procedures.
  2. Shutdown the Secure Application, Anomaly Detection, and remaining services. Then, shutdown Splunk AppDynamics.
    CODE
    appdcli stop secureapp
    appdcli stop aiops
    appdcli stop [services]
    appdcli stop appd
    <<Wait for pods to terminate before deleting operators>>
    appdcli stop operators
    Note:
    • Ensure that there are no pods in the running state before you start the data backup.

    • Sometimes, IOException error occurs in the Controller UI. See Troubleshoot Virtual Appliance Issues
    .
  3. Optional: Create a migration script for custom actions. See Migrate Custom Actions.
  4. Generate a backup file.

Generate a Backup File

Generate a backup file and save it outside the Virtual Appliance cluster.

Generate a backup file and save it outside the Virtual Appliance cluster.
  1. Run the backup command:
    CODE
    appdcli platform backup
  2. Copy the generated <backup_tar> file outside the cluster. If you have custom certificates, copy them to the same external location.

Prepare the Microsoft Azure for the Upgrade

Prepare Microsoft Azure images, snapshots, and configuration details for the Virtual Appliance upgrade.

To upgrade virtual machines in Azure, you must create a image and snapshot from the new VHD. However, you can use the same Resource Group, Network Security Group, Virtual Network, and Storage Account that you have created at the time of deployment. See Deploy and Configure Virtual Machines in Microsoft Azure.

Note: To use Azure CLI, you require the reference scripts. Download these script from the Splunk AppDynamics GitHub repository. Ensure to update or verify the configuration details in config.cfg such as tags, deployment configuration, and IP addresses. Run these scripts in the given order.

For more information about Azure CLI, see Azure CLI Documentation.

Azure Resources Description Reference Scripts
1 Disk

Upload the VHD image to a storage account. Create a disk by using the URI of the VHD file.

05-azure-create-disk.sh
2 Image Gallery

An image is a copy of the disk. Image gallery is a place where you can store and share the image to create multiple virtual machines.

  1. Create an image gallery.

  2. Update the shared image definition and version.

See

See Store and share images in an Azure Compute Gallery.

06-azure-image-gallery.sh

07-azure-shared-image-def.sh

08-azure-shared-image-version.sh

Upgrade the Virtual Appliance

Upgrade the Virtual Appliance in Microsoft Azure by running the required upgrade scripts in order.

Note: Download the upgrade script from the Splunk AppDynamics

GitHub repository

. We recommend that you run the scripts in the given order.

Run the upgrade scripts in the given order:

Step Filename
1 Obtain the details of the virtual machine. 01-azure-get-vm-details.sh
2 Shutdown the virtual machine. 02-azure-power-off-vm.sh
3 Associate a NIC to the virtual machine 03-azure-associate-dummy-nic.sh
4

Disassociate the NIC from the virtual machine.

Detach the data disk from the virtual machine.

04-azure-disassociate-nic-and-data-disk.sh
5 Delete the virtual machine. 05-azure-delete-vms.sh
6 Create a virtual machine. 06-azure-create-vms.sh

Verify whether the data directories exist in the following location:

CODE
/var/appd/data

Verify the Deployment Status

Verify the deployment status of Virtual Appliance virtual machines and services in VMware Esxi.

Verify the deployment of virtual machines:

  1. Verify whether the deployment of virtual machines is successful:
    CODE
    appdctl show boot
    Note: Ensure that the services in each node is active. If any service appears as Failed, restart that virtual machine. You might have to redeploy the virtual machine if it is still failing.
  2. Create a three-node cluster:
    CODE
    appdctl cluster init <Node-2-IP> <Node-3-IP>
  3. Verify node and MicroK8s status:
    CODE
    appdctl show cluster
    microk8s status
    Confirm that RUNNING is true for all three voter nodes.
    Note: You must re-login to the terminal if the following error appears:
    CODE
    Insufficient Permissions to Access Microk8s

Restore Data in the Virtual Appliance

Restore backed-up data to the Virtual Appliance after completing a VMware ESXi upgrade.

  1. Copy the previously generated <backup_tar> file to one cluster node. See Prerequisites.
  2. Restore the persistent-volume specifications.
    CODE
    appdcli platform restore <backup_tar>
  3. Respond to the prompt for self-signed ingress CA certificates:
    • Choose 0 if certificates are configured for DNS.
    • Choose 1 to restore and configure the self-signed certificates.
  4. Verify that all PVCs are in the Bound state:
    CODE
    kubectl get pvc -A
  5. Start the following services and operators:
    CODE
    appdcli start appd [Profile]
    appdcli start aiops [Profile]
    appdcli start secureapp [Profile]
    appdcli start [Services] [Profile]
    Note: Sometimes, the MySQL Router pods might fail to start. See MySQL Router Pods Fail to Start.
  6. Sync to running controller.
    CODE
    appdcli controller actions-sync
After the upgrade, the cluster uses the existing data disk and becomes functional.

Generate the Hybrid Configuration File

Generate the hybrid configuration file when custom certificates are not used for Ingress and Kafka clusters.

Hybrid deployments only: Generate this file when custom certificates are not used for the Ingress and Kafka clusters

Ensure that you have the latest CA certificates obtained after installing services. If not, update the CA certificates and regenerate the hybrid configuration file after restarting the service.

  1. On the Virtual Appliance, generate the hybrid configuration:
    CODE
    cd ~/appd-charts/utils
    bash prepare-hybrid.sh

    Sample output:

    CODE
    Writing Kafka CA Cert
    Writing Schema registry CA Cert
    Writing AnomalyDetectionKafkaSSLProducer
    Writing AnomalyDetectionKafkaConsumerSSL
    Writing configure script
    Creating archive of hybrid config
    hybrid-config/
    hybrid-config/kafka-ca.crt
    hybrid-config/AnomalyDetectionKafkaConsumerSSL
    hybrid-config/configure.sh
    hybrid-config/schema-registry-ca.crt
    hybrid-config/AnomalyDetectionKafkaSSLProducer
    Completed

    The script creates hybrid-config.tar, containing Kafka and Schema Registry CA certificates, producer and consumer SSL configuration, and configure.sh.

  2. Copy the hybrid-config.tar file to the standalone Controller.
  3. Extract and run the configuration script:
    CODE
    tar -xvf hybrid-config.tar
  4. Change to the extracted configuration directory and run the script:
    CODE
    cd ~/hybrid-config
    bash configure.sh
  5. Enter the actual Controller home when prompted:
    CODE
    Controller home [/opt/appdynamics/platform/product/controller]: /path/to/platform/controller
    Note:

    Virtual Appliance certificates expire after five years. Regenerate the hybrid configuration and copy updated certificates to the Classic Controller as part of certificate rotation.

    For more information on how to audit and rotate certificates in Virtual Appliance, see Manage Virtual Appliance Certificates.

  6. Restart the classic Controller.

Configure the Standalone Controller for Hybrid Connectivity

Complete these checks before running the script:

  • Extract the generated hybrid-config archive on the Controller host.
  • Run the script from inside the extracted hybrid-config directory.
  • Identify the actual Controller home: The directory containing db/, tools/, and appserver/.

    Tip: /home/appdynamics/appdynamics/platform/controller. The suggested default is /opt/appdynamics/platform/product/controller, but the installation path can vary.
  • Obtain the DNS name configured as hybrid.mysql.dbHost in the Virtual Appliance.
  • Use an account with permission to update the Controller and MySQL certificate files.

Controller home example: /home/appdynamics/appdynamics/platform/controller. The suggested default is /opt/appdynamics/platform/product/controller, but the installation path can vary.

  1. Change to the extracted configuration directory and run the script:
    CODE
    cd ~/hybrid-config
    bash configure.sh
  2. Enter the actual Controller home when prompted:
    CODE
    Controller home [/opt/appdynamics/platform/product/controller]: /path/to/platform/controller
    Note: If the Controller home is rejected, verify that the directory contains db/db.cnf.
  3. Review the proposed changes, then enter y to continue:
    CODE
    This operation will:
      - Replace the Kafka and Schema Registry client truststores
      - Update the Controller CA truststore
      - Write obfuscated Kafka producer and consumer configuration
      - Replace the MySQL server certificate after creating a backup
    
    Continue? [y/N]: y
  4. Confirm the reachable Controller address.
    The script detects a local IPv4 address. Confirm that the Virtual Appliance cluster can reach this address. Enter n to provide a different address.
    PYTHON
    Detected Controller IP: 192.0.2.10
    Is this address reachable from the Virtual Appliance cluster? [Y/n]: y
  5. Provide the hybrid database DNS name.
    Enter the exact hostname configured as hybrid.dbHost. The script adds this value to the MySQL certificate Subject Alternative Name (SAN).
    CODE
    DNS name [192.0.2.10.nip.io]: controller.example.com

Keystore password behavior: The script first tries the standard keystore password, changeit. If that password cannot open the existing Controller CA truststore, the script prompts securely for the configured password. Typed password characters are not displayed.

The selected password is used consistently for:

  • The Kafka client truststore.
  • The Schema Registry client truststore.
  • The existing Controller CA truststore.
  • The truststore-password fields in the obfuscated producer and consumer configurations.
Note: If the keystore password is rejected, provide the password currently configured for appserver/jetty/etc/cacerts.jks.

Changes made by the script:

Item Location relative to Controller home Action
Kafka client truststore pi-kafka-ssl-config/kafka.client.truststore.jks Created or replaced using kafka-ca.crt.
Schema Registry client truststore pi-kafka-ssl-config/schema-registry.client.truststore.jks Created or replaced using schema-registry-ca.crt.
Controller CA truststore appserver/jetty/etc/cacerts.jks Replaces the k8s-cluster alias with schema-registry-ca.crt.
Kafka client configurations pi-kafka-ssl-config/AnomalyDetectionKafka* Writes obfuscated producer and consumer configuration.
MySQL server certificate Database data directory from db/db.cnf Generates a 365-day certificate containing the supplied DNS SAN.
Before replacement, the script creates timestamped backups of the Controller CA truststore and the existing MySQL server certificate. The final summary displays the complete backup paths.
Note: Use the timestamped backup paths printed by the script when following an approved rollback procedure.

If the configuration is successful, the following message will be displayed:

CODE
Hybrid Controller configuration completed successfully.
Important:

After the script completes successfully, restart the Controller and its MySQL service. The Controller truststore and MySQL certificate changes do not take effect until the affected services are restarted.

Restart the Standalone Controller

Restart the Standalone Controller and MySQL service after completing configuration changes.

  • Run the following command to restart the standalone Controller:
    CODE
    cd ~/appdynamics/platform/product/controller/bin/
    ./controller.sh stop
    ./controller.sh start

    This command also restarts the MySQL service.

    Alternatively, you can restart the controller from Enterprise Console. See Start or Stop the Controller.

  • For high-availability scenario, you must use Enterprise Console to restart the controller. See Start or Stop the Controller.