VCF Installer: Retrieve Component Passwords from VCF Installer

When the auto-generate passwords options is selected within the VCF Installer UI, there maybe a scenario where you need to perform troubleshooting and a need to login to one of the underlying component appliances. Of course this is only possible if you know the passwords that were auto-generated, its relatively simple to retrieve the JSON specification used to perform the implementation from the VCF Installer appliance itself.

The following procedure demonstrates how you can retrieve a specific section of the JSON specification.

VCF Installer APIs Used

  • POST /v1/tokens
  • GET /v1/sddcs/latest
  • GET /v1/sddcs/{id}/spec

NOTE

Supported component deployment specs include: vcfOperationsSpec, vcfOperationsFleetManagementSpec, vcfOperationsCollectorSpec, sddcManagerSpec, nsxtSpec,vcenterSpec.

This PowerShell procedure assumes that you have VCF.PowerCLI 9.0 installed.


Retrieve a Section of the Deployment Specification using Curl

Procedure

  1. Connect to the VCF Installer appliance over SSH.

  2. Replace the values in the sample code with values for your VCF Operations instance and run the commands in the SSH session.

1vcfInstallerFqdn=$'sfo-ins01.sfo.rainpole.io'
2vcfInstallerUser=$'admin@local'
3vcfInstallerPass=$'VMw@re1!VMw@re1!'
4vcfComponentSpec=$'vcfOperationsSpec'
  1. Authenticate to VCF Installer and obtain a token by running the following command:
1TOKEN=$(curl -k -X POST https://$vcfInstallerFqdn/v1/tokens -H 'Content-Type:application/json' -d '{"username": "'$vcfInstallerUser'","password": "'$vcfInstallerPass'"}' | jq -r '.accessToken')
  1. Retrieve the ID of the latest deployment into the $sddcId variable by running the following command:
1sddcId=$(curl -k -X GET "https://$vcfInstallerFqdn/v1/sddcs/latest" -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" | jq -r '.id')
  1. Retrieve the VCF Operations Deployment Specification by running the following command:
1curl -k -X GET "https://$vcfInstallerFqdn/v1/sddcs/$sddcId/spec" -H "Authorization: Bearer $TOKEN" -H "Accept: application/json" -H "Content-Type: application/json" | jq -r '.'$vcfComponentSpec''
  1. Review the output, which will look something like below:
 1{
 2  "nodes": [
 3    {
 4      "hostname": "flt-ops01a.rainpole.io",
 5      "rootUserPassword": "VMw@re1!VMw@re1!",
 6      "type": "master"
 7    },
 8    {
 9      "hostname": "flt-ops01b.rainpole.io",
10      "rootUserPassword": "VMw@re1!VMw@re1!",
11      "type": "replica"
12    },
13    {
14      "hostname": "flt-ops01c.rainpole.io",
15      "rootUserPassword": "VMw@re1!VMw@re1!",
16      "type": "data"
17    }
18  ],
19  "adminUserPassword": "VMw@re1!VMw@re1!",
20  "applianceSize": "medium",
21  "loadBalancerFqdn": "flt-ops01.rainpole.io",
22  "useExistingDeployment": false
23}

Retrieve a Section of the Deployment Specification using PowerShell

Procedure

  1. Start Windows PowerShell.

  2. Replace the values in the sample code with values for the instance of VMware Cloud Foundation and run the commands in the PowerShell console.

1$vcfInstallerFqdn = "sfo-ins01.sfo.rainpole.io"
2$vcfInstallerUser = "admin@local"
3$vcfInstallerPass = "VMw@re1!VMw@re1!"
4$vcfComponentSpec = "vcfOperationsSpec"
  1. Authenticate to the VCF Installer appliance by running the following command:
1Connect-VcfInstallerServer -Server $vcfInstallerFqdn -User $vcfInstallerUser -Password $vcfInstallerPass | Select-Object Name, Version, IsConnected
  1. Retrieve the VCF Operations Deployment Specification by running the following command:
1Invoke-VcfInstallerGetSddcSpecByID -Id (Invoke-VcfInstallerGetLatestSddcTask).Id | Select-Object $vcfComponentSpec | ConvertTo-Json -Depth 10
  1. Review the output, which will look something like below:
 1{
 2  "VcfOperationsSpec": {
 3    "Nodes": [
 4      {
 5        "Hostname": "flt-ops01a.rainpole.io",
 6        "RootUserPassword": "VMw@re1!VMw@re1!",
 7        "Type": "master",
 8        "SslThumbprint": null
 9      },
10      {
11        "Hostname": "flt-ops01b.rainpole.io",
12        "RootUserPassword": "VMw@re1!VMw@re1!",
13        "Type": "replica",
14        "SslThumbprint": null
15      },
16      {
17        "Hostname": "flt-ops01c.rainpole.io",
18        "RootUserPassword": "VMw@re1!VMw@re1!",
19        "Type": "data",
20        "SslThumbprint": null
21      }
22    ],
23    "AdminUserPassword": "VMw@re1!VMw@re1!",
24    "ApplianceSize": "medium",
25    "LoadBalancerFqdn": "flt-ops01.rainpole.io",
26    "UseExistingDeployment": false,
27    "Version": null
28  }
29}

Posts in this Series