vSphere Resource Rename for VIDB 9.0.x or VCFA 9.0.x
search cancel

vSphere Resource Rename for VIDB 9.0.x or VCFA 9.0.x

book

Article ID: 424638

calendar_today

Updated On:

Products

VMware Cloud Foundation VCF Automation

Issue/Introduction

If vCenter resources (datacenter, cluster, folder, template folder or resource pool) are renamed after deploying VCF components (VCFA / VIDB ), stored vSphere inventory paths in appliance cluster become invalid, potentially causing any of the following related issues:

  • VCFA or VIDB having issues with normal operations
  • Day 2 operations like Scale, Upgrade or Patch fail
  • Issues with attaching and detaching disks to appliance machines
  • Appliance machines getting created in older invalid locations

This guide provides steps to identify, potentially remediate for any issues and update appliance configurations for any vSphere resource renaming scenario.

Please NOTE the following before proceeding with this article:

  • This guide only supports renaming of existing resources and NOT deletion of resources or moving to a new resource
  • Datastore and Network resources are NOT supported

Environment

  • vCenter Server 8.0 or 9.0
  • VCF Operations 9.0.x
  • VMware Identity Broker (VIDB) 9.0.x
  • VCF-Automation (VCFA) 9.0.x 

Resolution

Pre-Requisites

Before starting to use and execute this run-book guide, ensure the following is available:

  1. vCenter Server access to get updated resource names
  2. SSH access to VIDB or VCFA Primary appliance with vmware-system-user credentials 
  3. Common working knowledge of SSH access and bash script execution
  4. Provided bash script "update_vc_paths.sh" with this guide

Following are possible scenarios and remediations for this issue:

Scenario 1: vSphere resource is not changed

In this scenario, vSphere resource names are not changed yet.

Remediation 

This supports automated resolution using the following provided bash script (update_vc_paths.sh), which updates appliance cluster configuration to reflect updated vSphere resource paths for the changed resources. 

Follow below steps to successfully update vSphere resources and corresponding appliance cluster configuration:

Step 1: SSH into VCFA or VIDB Primary appliance using root credentials

  1. Identify a VCFA or VIDB Primary appliance with SSH access. This is appliance we will use to run scripts and commands as part of this article
  2. Refer to existing KB on how to SSH https://knowledge.broadcom.com/external/article?articleNumber=412001

Step 2: Copy and prepare provided bash script in VCFA or VIDB Primary appliance and execute it in dry-run mode

# assuming bash script file is copied into appliance vm

# make sure to change to root user in appliance vm
sudo -i

# update bash script file permission
chmod +x update_vc_paths.sh 
 
# run help command to get details on how to use the script
$ ./update_vc_paths.sh -h
Usage: ./update_vc_paths.sh [OPTIONS]

Updates appliance cluster configuration with new vCenter resource paths.

OPTIONS:
  --vc-server SERVER          vCenter server (optional: will be retrieved from the appliance if not provided)
  --vc-username USERNAME       vCenter username (required)
  --vc-password PASSWORD       vCenter password (required)
  --vc-datacenter DATACENTER   vCenter Datacenter name or path (optional)
  --vc-cluster CLUSTER         vCenter Cluster name or path (optional)
  --vc-folder FOLDER           vCenter Folder name or path (optional)
  --vc-template-folder FOLDER  vCenter Template folder name or path (optional)
  --vc-resource-pool POOL      vCenter Resource pool name or path (optional)
  --dry-run [true|false]       Enable/disable dry run mode (default: true). Use --dry-run false to apply changes.
  --backup-dir DIR             Backup directory (default: ./backups)
  -h, --help                   Show this help message

EXAMPLES:
  # Dry run (default)
  ./update_vc_paths.sh --vc-username 'admin' --vc-password 'password' --vc-datacenter 'NewDatacenterName'

  # Apply changes
  ./update_vc_paths.sh --dry-run false --vc-username 'admin' --vc-password 'password' --vc-datacenter 'NewDatacenterName'

  # With vCenter server and credentials (required)
  ./update_vc_paths.sh --vc-server 'vcenter.example.com' --vc-username 'admin' --vc-password 'password' --vc-datacenter 'NewDatacenterName'

Note: Only resources with explicit arguments will be updated. Resources will be validated in vCenter before updating.

Step 3: Update resources in vSphere

  1. Go ahead and manually update required vSphere resources using vCenter UI as needed
  2. Note down the updated name(s)

Step 4: Execute bash script to update vSphere resource paths in appliance configuration

 
# THIS IS JUST AN EXAMPLE - Apply changes by passing '--dry-run false' and renamed resource names
./update_vc_paths.sh --dry-run false --vc-username 'admin' --vc-password 'password' --vc-datacenter 'NewDatacenterName' --vc-cluster "cluster1" 

 

Scenario 2: vSphere resource is already changed

In this scenario, vSphere resources are already changed and appliance needs to be remediated for any issues and updated for the changes.

Remediation 

Follow the steps below to identify the specific issue, remediate it, and update the cluster configuration for vSphere resource changes.

STEP 1: Revert the vSphere resource changes if possible and/or Run the cluster health check and remediate issues if any

  • If possible, revert the vSphere resource changes. In most cases, this will remediate the cluster and restore it to a healthy state.
  • Using existing following KB article, run health checks and remediate if any issues
  • Complete this step and confirm the cluster is healthy before moving to Step 2.

STEP 2: Update appliance cluster configuration with new vSphere resource paths

  • Once the appliance cluster is healthy, go to "Scenario 1" above and execute the required steps under that section to run provided bash script
  • This step ensures that appliance cluster use the correct vCenter resource paths after the rename, preventing future failures and restoring full cluster functionality.

Attachments

update_vc_paths.sh get_app