WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud Foundation
  • VKS
  • Homelab
    • Resources
    • Nested Virtualization
  • VMware Nostalgia
  • Apple
You are here: Home / Automation / Get notified when VMware Cloud Foundation (VCF) Bringup has completed

Get notified when VMware Cloud Foundation (VCF) Bringup has completed

02.05.2024 by William Lam // 2 Comments

While updating and testing my Automated Lab Deployment Script for VMware Cloud Foundation (VCF), I often found myself checking whether the bringup process has completed or not using the Cloud Builder UI.


Ideally, I could configure some type of notification that would alert me immediately when the deployment has finished or if it ran into an issue and has failed.

Since Cloud Builder is just a Photon OS VM, that gave me an idea for a quick workaround ... 🤔

I can just setup a basic shell script that would run periodically using cron and when it detects the deployment has finished, it would then send a notification using the solution of my choice.

Step 1 - Copy the following content below into a file called vcf-bringup-notification.sh (or whatever name you wish to use). In my example, I will be sending a notification to Google Chat Space using an incoming webhook and you can do the same with Microsoft Teams or Slack, but you will need to make some edits to MESSAGE variable based on the required format.

#!/bin/bash

WEBHOOK_URL="FILL_ME_IN"

grep 'End of Orchestration' /var/log/vmware/vcf/bringup/*.log > /dev/null 2>&1
if [ $? -eq 0 ]; then
        BRINGUP_LOGENTRY=$(grep 'End of Orchestration' /var/log/vmware/vcf/bringup/*.log | head -1 | awk '{print $1}')
        BRINGUP_COMPLETE_TIME=$(echo ${BRINGUP_LOGENTRY#*.log:})

        MESSAGE="{\"text\":\"VCF Bringup Completed at ${BRINGUP_COMPLETE_TIME}\"}"
        echo ${MESSAGE} > /tmp/file

        curl -X POST -H 'Content-Type: application/json' ${WEBHOOK_URL} -d @/tmp/file
        rm -f /var/spool/cron/root
fi

Note: I would recommend testing the shell script separately before proceeding to the next step.

Step 2 - SSH to the Cloud Builder appliance using the "admin" account and then switch to the root user by running the following command:

su -

Step 3 - Add the following below to /var/spool/cron/root and add the following entry, which will run our script every 15 minutes. If you would like to change the interval, you can use crontab.guru to help with the configuration.

*/15 * * * * /root/vcf-bringup-notification.sh

The script should now run on the desired interval and only when it detects that the deployment has finished, will it then call the webhook and then clean itself up by removing the cronjob. If the deployment is still running, then nothing happens and it will re-run based on your schedule.

Here is an example output when the deployment is successful and the notification it send to a Google Chat Space


If you are using my latest Automated Lab Deployment Script for VMware Cloud Foundation (VCF), I have already included this capability as part of enhancing my deployment script. If you look at L114-117, you can now define and create your own notification shell script and it will automatically upload that to the Cloud Builder appliance and configure the cronjob for you!

More from my site

  • VMware Cloud Foundation (VCF) Homelab Hardware Options
  • Quick Tip - Character Limits for VMware Cloud Foundation (VCF) Objects
  • PowerCLI automation for VMware Private AI Foundation with NVIDIA (PAIF-N)
  • Automated VMware Cloud Foundation (VCF) host commission using ESXi Kickstart
  • Determining new VMware vSphere Foundation (VVF) & VMware Cloud Foundation (VCF) license usage in vSphere 8.0 Update 2b

Categories // Automation, VMware Cloud Foundation Tags // VCF, VMware Cloud Foundation

Comments

  1. *protectedMichael Zenzmaier says

    02/05/2024 at 4:50 pm

    hello william,

    i'm working on the same toppic at the same time, but it's already getting quite late here in europe. 🙂

    I would like to share an approach/thought.
    Wouldn't it also be "simply" possible to build out your API query L803-L833 and use the "requests" to query the API status?
    I don't (yet) have the skills to do this, but it should work?

    Thanks for your great work, keep it up.

    Reply
    • William Lam says

      02/05/2024 at 5:55 pm

      Yes, that did cross my mind but the challenge is that Mgmt Domain bring up is usually couple of hours which means you’ve got a long period where something could happen on machine running the check. The cronjob would remove the risk and you can even use Cloud Builder API to track same info, but I opted for a quick/dirty solution 🙂

      Reply

Leave a Reply to Michael ZenzmaierCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search

Thank Author

Author

William is Distinguished Platform Engineering Architect in the VMware Cloud Foundation (VCF) Division at Broadcom. His primary focus is helping customers and partners build, run and operate a modern Private Cloud using the VMware Cloud Foundation (VCF) platform.

Connect

  • Bluesky
  • Email
  • GitHub
  • LinkedIn
  • Mastodon
  • Reddit
  • RSS
  • Twitter
  • Vimeo

Recent

  • Programmatically accessing the Broadcom Compatibility Guide (BCG) 05/06/2025
  • Quick Tip - Validating Broadcom Download Token  05/01/2025
  • Supported chipsets for the USB Network Native Driver for ESXi Fling 04/23/2025
  • vCenter Identity Federation with Authelia 04/16/2025
  • vCenter Server Identity Federation with Kanidm 04/10/2025

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2025

 

Loading Comments...