Virtual machines do not appear in the Items page after upgrading from vRA Automation 6.2.x to 7.x
search cancel

Virtual machines do not appear in the Items page after upgrading from vRA Automation 6.2.x to 7.x

book

Article ID: 317103

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

These instructions are for fixing machines in your vRA 6.2.x environment that would otherwise be left as unassigned up on migration or upgrade to a vRA 7.x environment.


Symptoms:
  • The machines affected were imported into vRA 6.2.x.
  • In the Infrastructure > Managed Machines page, you see that:
     
    • The Component is set to Unassigned.
    • The Blueprint is set to system_blueprint_vsphere instead of the appropriate blueprint.
       
  • The virtual machine disappears from the Item page if Day-2 operations are performed on the machine.


Environment

VMware vRealize Automation 6.2.x
VMware vRealize Automation 7.x
VMware vRealize Automation 7.2.x
VMware vRealize Automation 7.1.x
VMware vRealize Automation 7.0.x
VMware vRealize Automation 7.3.x
VMware vRealize Automation 6.2
VMware vRealize Automation Desktop 6.2.x
VMware vRealize Automation Desktop 6.2
VMware vRealize Automation 6.x

Cause

This issue is caused due to bulk importing machines to an unpublished blueprint in vRA 6.2.x. Subsequent upgrade or migration to vRA 7.x causes the machines to lose their link to the blueprint.

 

 

Resolution

Note: This KB is applicable only if the vRealize Production Test Tool (version 1.7.1 or later) flags errors for virtual machines associated with an unpublished blueprint. Refer to KB2134520 on how to download and run the tool.
Download the vRealize Product Test 1.7.1 from VMware Downloads .

To resolve this issue, publish any unpublished blueprints that are associated with machines and then run a script to recreate the missing link between the machines and blueprints.
 
Perform these steps in the vRA 6.2.x system before upgrading or migrating to vRA 7.x:

Note: This procedure modifies the vPostgres database. Ensure to take a backup of the vPostgres database before proceeding. For more information, see How to backup or export embedded Postgres DB from vRealize Automation appliance (2074214).
  1. Download the KB2150515_FixScripts.zip file attached to the KB article and Unzip on your local machine where SQL database exists.
  2. Run the GenerateUnpublishedBlueprints.sql (contained in the KB2150515_FixScripts.zip) against vRA Microsoft SQL database to get a list of unpublished blueprints.
  3. Log on to the vRA console and publish each blueprint identified in step #2.
  4. Generate a CSV file containing all machines in the system.
    1. Run the GatherMachines.sql (contained in the KB2150515_FixScripts.zip) SQL against vRA Microsoft SQL database.
    2. Right click on the result table and select "Save the result as..." then give it a name and select CSV type file, for example, machines.csv.

      Note: This file contains all machines in the system so expect it to be large. The python script in step 6 uses this file as a reference to find the blueprints for the affected machines.
       
  5. You will need to supply this file to the python fix script. Copy it out of the system to where the python script will be executed.
  6. Fix the machines in the virtual appliance postgres database using the fixmachines.py (also contained in the KB2150515_FixScripts.zip) python script. The python script needs a connection to the PostgreSQL database and the CSV file that was generated above.
    Run these scripts on the system where your postgres database resides that is configured in your 6.2 vRA Appliance. If your PostgreSQL appliance is configured in HA mode, run the script on the Master PostgreSQL appliance.
     
    1. Create a workspace folder under the root home directory on your vRA appliance.

      For example, /root/fixmachines.
       
    2. Use SCP or any other file transfer client to copy the following files to this folder:
       
      1. fixmachines.py
      2. The exported CSV file ( machines.csv).
         
    3. Connect to the vRA appliance through SSH and go to the workspace folder created in step #a.
    4. Install the python package manager by following these steps:
      1. Download and copy the attached pg8000.tar file from the KB article to vRA appliance and place it in the same workspace folder created in Step 6(a).
      2. Navigate to the workspace folder created in Step 6(a).
      3. Extract and install the pg8000 package by running the command: tar xvf pg8000.tar -C /usr/lib64/python/site-packages/

        Note: The fixmachines.py script uses the pg8000 python library for postgres connectivity.
    5. Enable execution mode on the python script by running the command:

      chmod +x fixmachines.py
       
    6. The script can now be executed to see the help text.

      For example: ./fixmachines.py
       
    7. Run this command to get a preview of the machines that will be updated:

      ./fixmachines.py --host="localhost" --dbname="vcac" --user="vcac" --machines_csv="machines.csv" --do_update
       
    8. After confirming the list of machines, run this command to update the machines:

      ./fixmachines.py --host="localhost" --dbname="vcac" --user="vcac" --machines_csv="machines.csv" --do_update --do_commit
       
    9. To confirm that all relevant machines were updated, run the command from step g above. It should respond with "Found problem machines: 0"
 
The vRA system is now ready to be upgraded or migrated to vRA 7.x.
 
If you are migrating to vRA 7.3, VMware recommends to apply the patch from KB2150759 on the target vRA 7.3 system before migration as detailed in the KB article.


Additional Information

Virtual machines show their blueprint component to be unassigned after upgrade or migration from vRealize Automation 6.2.x to 7.3

Impact/Risks:
Since this fix involves direct manipulation of the vPostgres database we recommend taking a backup of the database prior to performing. Please see https://kb.vmware.com/kb/2074214 if you are unfamiliar with the procedure.

Attachments

KB2150515_FixScripts.zip get_app
pg8000.tar get_app