Skip to content

Latest commit

 

History

History
83 lines (61 loc) · 4.64 KB

howto-access-source-vm.md

File metadata and controls

83 lines (61 loc) · 4.64 KB

How to access the source VM when image build CI/CD failed

Normally, the image build CICD (ihs CICD, twas-base CICD and twas-nd CICD) workflow will provision the source VM, install software package, execute integration test and finally generate SAS urls for OS disk and data disk which will be used for creating/updating Azure virtual machine offer(s) in Azure Partner Center.

However, if the CICD workflow failed at step of installing software package due to unknown issues, user usually needs to access the source VM to triage the issue, and/or collect logs for issue reporting. Here're instructions on how to access the source VM.

Find out the source VM from Azure Portal

Follow steps below to find out where the source VM is from Azure Portal.

  1. Go to Actions.
  2. Find out the workflow you kicked off before. Click to open.
  3. Copy URL from browser address bar, which looks like https://github.com/WASdev/azure.websphere-traditional.image/actions/runs/<run-id>. Copy <run-id>.
  4. Go to Azure Portal > Type "Resource groups" in the search bar > Select "Resource groups" from the list of service.
  5. In the page of "Resource groups", paste copied <run-id> into the filter box. Wait a few seconds and click the resource group listed in the page. Log down the resource group name.
  6. In the page of selected resource group, find out the VM resource with type "Virtual machine". Click to open.
  7. In the page of selected virtual mainche, log down value of "Public IP address".

Access the source VM

In order to connect to the source VM, you also need VM administrator credentials that you configured as GitHub action repository secrets VM_ADMIN_ID and VM_ADMIN_PASSWORD. Find out and log down the credentials.

Follow steps below to connect to the source VM and inspect the issue.

  1. Open a command line interface where ssh command is supported.
  2. Exceute ssh <VM_ADMIN_ID>@<Public_IP_address> and follow the prompts to complete ssh login with VM_ADMIN_PASSWORD. If you can't connect to the source VM with ssh, you must resolve the issue and return here to continue.
  3. After you successfully logging into the source VM with ssh
    1. Run the shell with root privilidges.

      sudo -i
    2. View and export environment variables defined in /datadrive/virtualimage.properties.

      cat /datadrive/virtualimage.properties
      source /datadrive/virtualimage.properties

      Common to all CICDs:

      • IM_INSTALL_DIRECTORY is the directory where IBM Installation Manager is installed.
      • Export IBM Installation Manager installation data: ${IM_INSTALL_DIRECTORY}/eclipse/tools/imcl exportinstalldata imagent.zip

      For twas-nd CICD:

      • WAS_ND_INSTALL_DIRECTORY is the directory where IBM WebSphere Application Server Network Deployment is installed.

      For twas-base CICD:

      • WAS_BASE_INSTALL_DIRECTORY is the directory where IBM WebSphere Application Server is installed.

      For ihs CICD:

      • IHS_INSTALL_DIRECTORY is the directory where IBM HTTP Server is installed.
      • PLUGIN_INSTALL_DIRECTORY is the directory where Web Server Plug-ins for IBM WebSphere Application Server is installed.
      • WCT_INSTALL_DIRECTORY is the directory where WebSphere Customization Toolbox is installed

      For twas-nd CICD and twas-base CICD:

      • /opt/BESClient is the directory where BigFix client is installed.
    3. Change directory to the working directory of VM extension execution.

      cd /var/lib/waagent/custom-script/download/0/
    4. List all files.

      ls
      BESAgent-10.0.8.37-rhe6.x86_64.rpm agent.installer.linux.gtk.x86_64.zip  im_installer  install.sh  stderr  stdout

      Note:

      • install.sh is the script responsible for installing software packages.
      • stdout is the log file including text output sent from the shell commands in install.sh.
      • stderr is the log file including error messages sent from the shell commands in install.sh.
      • BESAgent-10.0.8.37-rhe6.x86_64.rpm is the BigFix client RPM downloaded for twas-nd CICD and twas-base CICD.

Clean up

Once you completed the trouble shooting of the source VM, clean up the Azure resources to avoid Azure charges:

az group delete --name <resource-group-of-source-vm> --yes