Skip to main content

VMware Cloud Foundation APIs: Deploying VCF Automation

 

VMware Cloud Foundation APIs: Deploying VCF Automation

Whilst VCF Automation is typically deployed during the initial VMware Cloud Foundation deployment phase via VCF Installer it is possible to skip the deployment initially for various reasons such as may you don’t have a use case initially or you want to deploy to a different network that is not available at the time. Under such scenarios you can easily deploy as a Day N task.

In this post we will look at how the VCF Automation component can be deployed using the public APIs, this is achieved via the VCF Fleet Lifecycle Service which is tightly integrated into VCF Operations.

VCF Fleet Lifecycle Service APIs Used

VCF Fleet LCM Service APIs

  • POST /api/v1/identity/token
  • GET /fleet-lcm/v1/sddc-lcms
  • POST /fleet-lcm/v1/components/validations
  • POST /fleet-lcm/v1/components
  • GET /fleet-lcm/v1/tasks/{taskId}

Procedure

  1. Connect to a system that has access to the infrastructure and is capable of running CURL.

  2. Replace the values in the sample code with values for your VCF Fleet Lifecycle Service and paste the commands in the console. If your not sure which endpoint this FQDN should be log into VCF Operations, go to Build > Lifecycle > VCF Management and select the Components tab and locate the component named Fleet lifecycle the FQDN is shown in the FQDN column.

export vcfFleetLifecycleFqdn='flt-fc01.rainpole.io'
export vcfFleetLifecycleUser='admin@vsp.local'
export vcfFleetLifecyclePass='VMw@re1!VMw@re1!'
  1. Authenticate to the VCF Fleet Lifecycle Service and obtain a token by running the following command:
vcfFleetLifecycleToken=$(curl -k -X POST "https://$vcfFleetLifecycleFqdn/api/v1/identity/token" \
    -H 'Content-Type: application/x-www-form-urlencoded' \
    --data "grant_type=password" \
    --data "username=$vcfFleetLifecycleUser" \
    --data "password=$vcfFleetLifecyclePass" \
    | jq -r '.access_token')
  1. Verify you successfully obtained an authentication token by running the following command:
echo $vcfFleetLifecycleToken

Example Output:

eyJhbGciOiJFZERTQSIsImtpZCI6Ilg4Mk5veGNJRlVCVEFiY0xPM1NUdU12UTF6Qlo4d01xeUxDTGNuOGZYdFUiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2ZsdC1mYzAxLnJhaW5wb2xlLmlvIiwic3ViIjoiYWRtaW5AdnNwLmxvY2FsIiwiYXVkIjpbInZzcCJdLCJleHAiOjE3ODM0MzU1NTIsImlhdCI6MTc4MzQyMTE1MiwianRpIjoiMjA3OTg0MDgtZGE3OC00N2UzLTgxMDctNDAyMThkNjM1ZThmIiwiYXpwIjoicGFzc3dvcmRfZ3JhbnRfY2xpZW50IiwiYWNjdCI6ImFkbWluQHZzcC5sb2NhbCIsImF1dGhvcml6YXRpb25fZGV0YWlscyI6bnVsbH0.OsXjW3cgwZaEMXwZC6MOqOped5MX1wdf3wpUmjZLaRiXeug4rtm9dnWHvPrp5pM74MNsVEjhbeT3u0TJjgIIBQ

  1. First we retrieve the unique ID of the SDDC instance by running the following command:
primarySddcLcms=$(curl -k -X GET "https://$vcfFleetLifecycleFqdn/fleet-lcm/v1/sddc-lcms" \
  --header "Authorization: Bearer ${vcfFleetLifecycleToken}" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  | jq -r '.sddcLcms[] | select(.isPrimary == true) | .id')
  1. Verify you successfully obtained the SDDC instance by running the following command:
echo $primarySddcLcms

Example Output:

3e8d0034-906b-49cb-9c47-3afa8d919192
  1. Replace the values in the sample code with values for the deployment of your VCF Automation instance and paste the commands in the console.
export automationFqdn='flt-auto01.rainpole.io'
export automationPlatformFqdn='flt-vcfa-sr01.rainpole.io'
export automationIpRangeStart='10.11.10.46'
export automationIpRangeEnd='10.11.10.50'
export automationSize='small'
export automationAdminPass='VMw@re1!VMw@re1!'
export automationSystemPass='VMw@re1!VMw@re1!'
  1. Create the JSON payload for the VCF Automation instance deployment by running the following command:
cat << EOF > automation-deploy.json
{
  "componentSpecs": [
    {
      "componentType": "VCFA",
      "deploymentType": "VspComponentSpec",
      "sddcLcmId": "${primarySddcLcms}",
      "fqdn": "${automationFqdn}",
      "version": "9.1.0.0",
      "configSpec": {
        "size": "${automationSize}",
        "adminSystemPassword": "${automationAdminPass}"
      },
      "vspClusterSpec": {
        "deploymentType": "VspClusterSpec",
        "sddcLcmId": "${primarySddcLcms}",
        "platformFqdn": "${automationPlatformFqdn}",
        "systemUserPassword": "${automationSystemPass}",
        "size": "${automationSize}",
        "ipv4Pool": {
          "ipRange": {
            "startIpAddress": "${automationIpRangeStart}",
            "endIpAddress": "${automationIpRangeEnd}"
          }
        }
      }
    }
  ]
}
EOF
  1. Verify the JSON payload has been populated correctly by running the following command:
cat automation-deploy.json

Example Output:

{
  "componentSpecs": [
    {
      "componentType": "VCFA",
      "deploymentType": "VspComponentSpec",
      "sddcLcmId": "3e8d0034-906b-49cb-9c47-3afa8d919192",
      "fqdn": "flt-auto01.rainpole.io",
      "version": "9.1.0.0",
      "configSpec": {
        "size": "small",
        "adminSystemPassword": "VMw@re1!VMw@re1!"
      },
      "vspClusterSpec": {
        "deploymentType": "VspClusterSpec",
        "sddcLcmId": "3e8d0034-906b-49cb-9c47-3afa8d919192",
        "platformFqdn": "flt-vcfa-sr01.rainpole.io",
        "systemUserPassword": "VMw@re1!VMw@re1!",
        "size": "small",
        "ipv4Pool": {
          "ipRange": {
            "startIpAddress": "10.11.10.46",
            "endIpAddress": "10.11.10.50"
          }
        }
      }
    }
  ]
}

  1. Validate the JSON payload by running the following command:
validationId=$(curl -k -X POST "https://$vcfFleetLifecycleFqdn/fleet-lcm/v1/components/validations" \
  --header "Authorization: Bearer ${vcfFleetLifecycleToken}" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
   -d @automation-deploy.json | jq -r ".id")
  1. Check the status of the validation by running the following command:
curl -k -X GET "https://$vcfFleetLifecycleFqdn/fleet-lcm/v1/tasks/$validationId" \
    --header "Authorization: Bearer ${vcfFleetLifecycleToken}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    | jq
  1. The command in step 11 may need to be run multiple times, alternatively you can run the command over and over by running the following command:
while curl -k -X GET "https://$vcfFleetLifecycleFqdn/fleet-lcm/v1/tasks/$validationId" \
    --header "Authorization: Bearer ${vcfFleetLifecycleToken}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    | jq '{status: .status}' \
    | grep -q "RUNNING"; do
    echo "Still in 'RUNNING' state... waiting 2 seconds."
    sleep 2
done
  1. Start the deployment by running the following command:
deploymentId=$(curl -k -X POST "https://$vcfFleetLifecycleFqdn/fleet-lcm/v1/components" \
  --header "Authorization: Bearer ${vcfFleetLifecycleToken}" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  -d @automation-deploy.json | jq -r ".id")
  1. Check the status of the deployment by running the following command:
curl -k -X GET "https://$vcfFleetLifecycleFqdn/fleet-lcm/v1/tasks/$deploymentId" \
    --header "Authorization: Bearer ${vcfFleetLifecycleToken}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    | jq
  1. The command in step 11 would need to be run multiple times, alternatively you can run the command over and over by running the following command:
while curl -k -X GET "https://$vcfFleetLifecycleFqdn/fleet-lcm/v1/tasks/$deploymentId" \
    --header "Authorization: Bearer ${vcfFleetLifecycleToken}" \
    --header "Accept: application/json" \
    --header "Content-Type: application/json" \
    | jq '{status: .status}' \
    | grep -q "RUNNING"; do
    echo "Still in 'RUNNING' state... waiting 60 seconds."
    sleep 60
done

Comments

Popular posts from this blog

Step-by-Step Explanation of Ballooning, Compression & Swapping in VMware

 ðŸ”¹ Step-by-Step Explanation of Ballooning, Compression & Swapping in VMware ⸻ 1️⃣ Memory Ballooning (vmmemctl) Ballooning is the first memory reclamation technique used when ESXi detects memory pressure. ➤ Step-by-Step: How Ballooning Works  1. VMware Tools installs the balloon driver (vmmemctl) inside the guest OS.  2. ESXi detects low free memory on the host.  3. ESXi inflates the balloon in selected VMs.  4. Balloon driver occupies guest memory, making the OS think RAM is full.  5. Guest OS frees idle / unused pages (because it believes memory is needed).  6. ESXi reclaims those freed pages and makes them available to other VMs. Why Ballooning Happens?  • Host free memory is very low.  • ESXi wants the VM to release unused pages before resorting to swapping. Example  • Host memory: 64 GB  • VMs used: 62 GB  • Free: 2 GB → ESXi triggers ballooning  • VM1 (8 GB RAM): Balloon inflates to 2 GB → OS frees 2 GB → ESXi re...

ESXi Host Troubleshooting Checklist

  🛠️ ESXi Host Troubleshooting Checklist (With Complete Log Locations) ✅ 1. Host Status & Connectivity Check host state in vCenter (Connected / Not Responding / Disconnected) Review CPU, RAM, and datastore usage Validate HA/DRS recommendations ✅ 2. Hardware Health Monitor hardware sensors (CPU, DIMMs, fans, PSU, RAID) Check RAID controller logs via vendor tools View hardware status in: vCenter → Monitor → Hardware Health DCUI → Hardware Status ✅ 3. Network Validation Verify vSwitches, Port Groups, NIC teaming, VLAN tagging Check vmkernel ports (mgmt, vMotion, iSCSI, vSAN) Test reachability using: Shell vmkping < IP > Show more lines Validate physical NIC status and link speed ✅ 4. Storage & Datastore Checks Confirm datastore accessibility Rescan storage adapters (iSCSI/FC/NFS) Validate multipathing (Round Robin / Fixed / MRU) Check datastore latency with esxtop ✅ **5. Critical Logs & Their Locations (Full List) Here are key ESXi log files that every VMware adm...
  vCenter Troubleshooting Tips, Common Issues & Log Locations 🚀 1. General Troubleshooting Approach A. Check service health first For vCenter Server Appliance (VCSA): Shell https : / / < vcenter - FQDN > : 5480 Show more lines Go to Services → Health to verify: vCenter Server ESXi hosts vSphere Client DNS, NTP, DB connections vpxd, vpxd-svcs, vsphere-ui B. DNS & NTP checks vCenter is highly dependent on correct DNS & time sync. Check: Shell nslookup < vcenter - fqdn > nslookup < esxi - host - fqdn > Show more lines Time drift > 5 minutes causes: Login failures vpxd crashes PSC authentication issues C. Check storage/database health Slow DB/storage = UI slow, tasks hung. For VCSA: Shell df - h du - sh / storage / log / * / var / log Show more lines Free up space if partitions hit >80%. D. Restart critical services safely On VCSA: Shell service - control - - status service - control - - stop - - all service - control - - start - - all ...