VCF 9.1 fleet DR: "Fleet LCM password is empty" when re-registering VCF Automation

By 6 min read

This one is easy to miss, because the task tells you it worked.

I was near the end of the VCF Automation failover in my lab, at Update VCF Automation Registration to VCF Operations in Broadcom's failover plan. I ran Update-VcfmsVcfaRegistration from my jump host. Steps 1 to 5 of the script went fine. Then step 6 printed this:

== Step 6: Re-register VCFA with VCF Operations
  /home/vmware-system-user/update_registration_in_ops.sh: line 169: /dev/tty: No such device or address
  /home/vmware-system-user/update_registration_in_ops.sh: line 170: /dev/tty: No such device or address
  /home/vmware-system-user/update_registration_in_ops.sh: line 171: /dev/tty: No such device or address
  ERROR: Fleet LCM password is empty
  ERROR step 6 (VCF Operations re-registration) failed (see above).

PowerShell output of Update-VcfmsVcfaRegistration: step 6 fails with "Fleet LCM password is empty"

A few lines further down, the same run ended with this:

WARNING: step 6 (VCF Operations re-registration) reported errors above -
         VCF Operations will keep showing a stale component until resolved.
[INFO] [10.2.1.142] Script completed successfully
[NOTE] [RDServer01] Completed Task Update-VcfmsVcfaRegistration in 0 minutes and 21 seconds

The end of the same run, with "Script completed successfully" in green under the error and the warning

"Script completed successfully", in green, right under an error. If you only look at the last lines, you'd move on, and VCF Operations would keep showing an old VCF Automation entry that points at the dead site.

Why it happens

The script behind step 6 needs the Fleet LCM password. It didn't get one, and it had no way to ask me for it.

Update-VcfmsVcfaRegistration copies its scripts to a services runtime node and runs them over SSH. Step 6 runs update_registration_in_ops.sh, which talks to two systems, VCF Operations and Fleet LCM. The error only mentions the Fleet LCM password, so that's the one that was missing.

When the script has no password, it tries to prompt for one on the terminal. The cmdlet's SSH session has no terminal attached, and that's what the three /dev/tty: No such device or address lines mean. With no terminal there is nobody to ask, so step 6 fails. The cmdlet still reports success at the end.

I didn't dig into why the cmdlet doesn't pass the password in. What I did confirm is that when I ran the same script myself in a normal interactive SSH session, with both passwords set, it went through.

What you need

What Where I got it
The node the cmdlet ran on The cmdlet's log shows it in brackets: [10.2.1.142] Script completed successfully
update_registration_in_ops.sh The cmdlet deletes its copy when it finishes (Temporary scripts removed), so copy it again from the supporting scripts zip attached to KB 443506
The VCF Automation component ID Also in the cmdlet's output: Component ID : 6024533f-...
The VCF Operations FQDN Same place: Ops FQDN : ops-a.site-a.bridgetocloud.net
VCF Operations admin password Your runbook
Fleet LCM admin password Your runbook

The fix: run step 6 yourself

You don't have to redo the whole cmdlet. Steps 1 to 5 already worked, so run the step 6 script by hand, in a session that has a terminal.

  1. Copy the script to the node. From the jump host, in the folder where you extracted the KB 443506 scripts:

    scp .\scripts\update_registration_in_ops.sh vmware-system-user@10.2.1.142:/home/vmware-system-user/
  2. Open an interactive SSH session. The -t gives you a real terminal, which is the whole point:

    ssh -t vmware-system-user@10.2.1.142
    sudo -i
    export KUBECONFIG=/etc/kubernetes/admin.conf
  3. Load the two passwords without showing them. read -s keeps them off the screen and out of your shell history:

    read -rsp 'VCF Operations admin password: ' OPS_ADMIN_PASSWORD;   echo; export OPS_ADMIN_PASSWORD
    read -rsp 'Fleet LCM password: '            FLEET_ADMIN_PASSWORD; echo; export FLEET_ADMIN_PASSWORD
  4. Run the script with the values from the cmdlet's output:

    bash /home/vmware-system-user/update_registration_in_ops.sh \
      --ops-fqdn ops-a.site-a.bridgetocloud.net \
      --component-id 6024533f-5a35-4a2e-b7fd-1c0ac3cf7127

This time it went all the way through:

Running update_registration_in_ops.sh by hand in an interactive SSH session: acquire the Ops token, delete the stale record, get a Fleet LCM token, trigger the refresh

The script deletes the old VCF Automation record from VCF Operations, then asks Fleet LCM to send a fresh one. That's what step 6 was meant to do in the first place.

The delete can take longer than the script waits

The script waits two minutes for VCF Operations to finish deleting the old record. In my lab that wasn't enough:

== Step 2b: Wait for component to be deleted from Ops
  still present (HTTP 200) - waiting 15s (0/120s elapsed)
  ...
  still present (HTTP 200) - waiting 15s (105/120s elapsed)
  WARN component still present in Ops after 120s - proceeding anyway, but the
       Fleet LCM refresh below may race with an unfinished delete.

So the refresh was triggered while the delete was still running. To see how that played out, I opened Control Panel > Management Tasks in VCF Operations:

VCF Operations Management Tasks: the delete of the VCF Automation configurations completed at 1:33 PM, then Fleet LCM's Configure Component task for VCF Automation completed at 1:38 PM

Read it from the bottom up. The delete took 3 minutes 58 seconds, so the script's two-minute wait was never going to be enough. The refresh went ahead anyway, and it worked: Fleet LCM's own service account (svc-vcf-fleet-lcm-OPS-3c2) ran Configure Component for VCF Automation, and it completed at 1:38 PM. That task is the re-registration.

If you don't see that second task, this is how I'd read the screen:

What you see What it means What to do
Delete still running It's just slow Wait for it to finish
Delete completed, then a completed Configure Component task for VCF Automation The refresh landed after all Nothing, you're done
Delete completed, but no Configure Component task, or VCF Automation missing or showing errors The refresh probably got lost in the race Run the script again. I haven't had to, so I can't say how it behaves the second time

If you do run it again in the same root session, the two passwords are still exported, so it won't ask for them again.

Check it worked

SDDC LCM looks for new components on a cycle of about 15 minutes, so give it one or two cycles, then check:

  • The VCF Automation component in VCF Operations shows the current FQDN and version, and its configuration page loads without errors.
  • There is only one VCF Automation entry. If you ever see two, stop and look into it before you delete anything.
  • Management Tasks shows the delete as completed, followed by a completed Configure Component task for VCF Automation, created by Fleet LCM.

When you're done, clear the passwords from that root shell:

unset OPS_ADMIN_PASSWORD FLEET_ADMIN_PASSWORD

What I'll do next time

  • Not trust the last line of Update-VcfmsVcfaRegistration. Scroll up and read what step 6 said.
  • Keep the Fleet LCM admin password next to the VCF Operations one in the runbook, because this step needs both.
  • If step 6 fails, run update_registration_in_ops.sh by hand in an ssh -t session, as above.
  • Check Management Tasks afterwards, to see whether the delete finished and the Configure Component task ran.

I hit another problem earlier in the same failover test, at the restore step. It's covered in VCF 9.1 fleet DR: fixing the SSH fingerprint error that stops the restore.

Sources

Related guides