Saturday, July 12, 2025

Troubleshooting ESXi PSOD: A Quick Guide for SREs

When an ESXi host hits a Purple Screen of Death (PSOD), it’s more than just a crash - it’s a signal that something critical needs attention. Here’s how to handle it effectively.


What happens during a PSOD?

  • The ESXi server displays a purple diagnostic screen.
  • You’ll see alerts/ incidents for host connectivity, FC/ Ethernet link down, and related alarms.
  • The console screen confirms the purple screen.

Immediate actions

  • Capture screenshots of the PSOD from the console screen.
  • Check server hardware health via the out-of-band management interface like iDRAC/ RMC/ BMC.
  • Observe if the host is stuck or rebooting repeatedly.
    • If ESXi reloads successfully, immediately place the node in Maintenance Mode via vCenter.
    • If it keeps crashing, try to capture all PSOD instances.

Collecting logs

  • Generate a support bundle from vCenter once the host is online.
  • Collect server hardware logs.

Engage support

  • Broadcom/ VMware: Share PSOD screenshots and ESXi support bundle for RCA.
  • Hardware vendor: Attach server hardware logs, screenshots, and context for analysis.

Analyze crash dumps

  • Look for these keywords in the core dump logs: BlueScreen, Backtrace, Exception
  • In the ESXi support bundle you will find the crash dump logs under /var/core directory.
  • Analyzing the core dump files should help you find the root cause of the PSOD event. It could be due to some hardware issue, bugs in ESXi hypervisor, faults in device firmware or drivers, etc.
  • You may notice many vmkernel-zdump files, and to quickly filter out all the BlueScreen events, you can use the following PowerShell code snippet.
------------------------------------------------------------------
param(
    [string]$directoryPath,
    [string[]]$keywords
)

# Function to search for keywords in files
function Search-Files {
    param (
        [string]$path,
        [string[]]$keywords
    )

    # Get all files in the directory and subdirectories
    $files = Get-ChildItem -Path $path -Recurse -File

    # Loop through each file
    foreach ($file in $files) {
        # Read the content of the file
        $content = Get-Content -Path $file.FullName

        # Loop through each line in the file content
        foreach ($line in $content) {
            # Check if the line contains any of the keywords (case-insensitive)
            foreach ($keyword in $keywords) {
                if ($line -match "(?i)$keyword") {
                    # Print the file name and the matching line
                    Write-Output "File: $($file.FullName)"
                    Write-Output "Line: $line"
                    Add-Content -path out.txt -value $line
                    break
                }
            }
        }
    }
}

# Call the function with the provided parameters
Search-Files -path $directoryPath -keywords $keywords
------------------------------------------------------------------
  • Save the above code snippet to a .ps1 file (example: find.ps1) and you can run it as follows:
> .\find.ps1 -directoryPath "C:\esx-esxi1.xre.com-2025-04-18--13.05-2106842\var\core" -keywords "bluescreen"
> .\find.ps1 -directoryPath "C:\esx-esxi1.xre.com-2025-04-18--13.05-2106842\var\core" -keywords "bluescreen", "#PF Exception"
  • All the log lines that include the given keyword or keywords will be saved to out.txt file.
  • A sample output of the above-mentioned code snippet against an ESXi core dump is given below.

  • Once you identify the root cause of the PSOD event, you can start working towards the resolution which may involve replacing a faulty hardware component, updating firmware/ driver/ ESXi, etc.

References

Hope it was useful. Cheers!

Saturday, April 26, 2025

Azure AI Foundry - Part4 - Deploy and use a generative AI model

Azure AI Foundry supports deploying large language models (LLMs). In this article, we will see how to deploy a model and use it.

Azure AI Foundry Portal

  • Select your project - My assets - Models + endpoints - Deploy model
  • Click Deploy base model
  • Select the model you want to deploy (here I am selecting gpt-4.1) and click Confirm

  • You can see the deployment details like capacity (token per minute), resource location etc. 
  • Click on Create resource and deploy

  • Now it will start creating the resource and this step may take a minute or so.
  • Once it is done, it will take you to the following page where you can see the mode details on the model you just deployed.

  • Click on Open in playground to test the model.
  • Once the chat playground is open, you will see your deployment, and under that you will see a section where you can give the model instructions and context. An example is given in the following screenshot. Once the model instructions and context are provided make sure to click Apply changes button. 
  • Now you can click on Generate prompt, provide the query and click on Send.
  • You can also set values for limiting the maximum output token for the model response, temperature, frequency penalty etc. under the Parameters section.

  • A sample response is provided in the following screenshot.

  • To see the sample code, you can click on View code.
  • You can also see code samples and authentication using API key as shown below.

  • Metrics (total requests, token count, etc.) related to your LLM model deployment can be found on the following page.

 

Python


Sample code to interact with the model can be found in my GitHub repo.

Hope it was useful. Cheers!

Azure AI Foundry Blog Series

Azure AI Foundry is a comprehensive suite of tools and services designed to accelerate the development and deployment of AI solutions on the Azure platform. Throughout this blog series, we will cover various aspects of Azure AI Foundry.



Part1 - Create project
Part2 - Language translation using AI Services
Part3 - Abstractive text summarization
Part4 - Deploy and use a generative AI model


Tuesday, April 22, 2025

Azure AI Foundry - Part3 - Abstractive text summarization

In this article, I will show you how to use Azure Cognitive Services for text summarization. 

Azure AI Foundry portal

  • AI Services - Language + Translator


  • Summarize Information - Summarize text


  • Select a connected AI service resource or create a new one.


  • Playgrounds - Summarize Information - Summarize text


Python


Sample code to summarize a PDF can be found in my GitHub repo. Following is an example of a resume summary: 


Hope this was useful. Cheers!

Tuesday, April 15, 2025

Azure AI Foundry - Part2 - Language translation using AI Services

In this article, I will show you how to use an Azure AI Service available within the Azure AI Foundry project. We'll use the language translator as an example.

Azure AI Foundry portal

  • Select AI Services. 
    • Click on Language + Translator.


  • Select Translation.

  • Select Text Translation.

  • Click on Try with your own.

  • Here I am translating language from English to Malayalam. Take a look at the Connected Azure AI Services, you can see it is already connected to one. Incase if it is not connected to an Azure AI Services resource, you can click on Create a new AI Services resource, select a region, provide an AI Services name if you like to and click Create and connect

  • You can also view the sample code by clicking on View code.

  • Here is the sample code in Python and when you scroll down you can find the Resource key and Region details.

Python

import os, requests, uuid, json

resource_key = 'resource_key_here'
region = 'region_here'
endpoint = 'https://api.cognitive.microsofttranslator.com/'

# If you encounter any issues with the base_url or path, make sure
# that you are using the latest endpoint: https://docs.microsoft.com/azure/cognitive-services/translator/reference/v3-0-translate
path = '/translate?api-version=3.0'
params = '&to=ml'
constructed_url = endpoint + path + params

headers = {
    'Ocp-Apim-Subscription-Key': resource_key,
    'Ocp-Apim-Subscription-Region': region,
    'Content-type': 'application/json',
    'X-ClientTraceId': str(uuid.uuid4())
}

# You can pass more than one object in body.
body = [{
    'text' : 'where are you right now?'
}]
request = requests.post(constructed_url, headers=headers, json=body)
response = request.json()

print(json.dumps(response, sort_keys=True, indent=4, separators=(',', ': ')))


Sample output:

What you see is a unicode string and once it is converted you will see the corresponding Malayalam text. 

Curl

curl -X POST "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=ml" \
> -H "Ocp-Apim-Subscription-Key: your_key_here" \
> -H "Ocp-Apim-Subscription-Region: your_region_here" \
> -H "Content-Type: application/json" \
> -d "[{'Text':'where are you now?'}]" -v


Sample output:

Hope this was useful. Cheers!

References

Monday, April 14, 2025

Azure AI Foundry - Part1 - Create project

Azure AI Foundry is a unified platform that helps you design, customize, build, test, deploy, and manage generative AI applications. In this article, I will show you how to create a project and a hub, which are the first steps to building your AI solution. Let's get started!

Create project using the portal


  • Click Create project.
    • The project will have an auto generated name or you can provide one. 
    • You can also notice that it creates a new Hub, and Storage account, Key Vault and AI Services under a new resource group.
    • Click Create.
  • The project is getting created now. This may take a minute or two.


  • Once it's done, it will take you to this overview page.


  • On the Azure AI Foundry portal, you can use the Management center to configure/ get more details about your project, connected resources, models, endpoints etc.


  • Under the Hub or Project properties, if you select the Resource Group, it will open a new browser tab and navigate to the Azure portal where you can see all the Azure resources that have been created to support your hub and project.


Create project using Azure CLI


Note: Remove any existing installation of the ml and azure-cli-ml extensions and install new.
  • az extension remove -n azure-cli-ml
  • az extension remove -n ml
  • az extension add -n ml
  • az extension update -n ml

  • az login
  • az account set --subscription "subscription_id"
  • az group create --name "resource_group_name" --location "location_name"

  • az ml workspace create --kind hub --resource-group "resource_group_name" --name "hub_name"


  • $hub_id = "you will get this id from the output of previous step"
  • az ml workspace create --kind project --hub-id $hub_id --resource-group "resource_group_name" --name "project_name"

Saturday, January 18, 2025

VMware PowerCLI 101 - part12 - Get uptime and boot time of ESXi nodes and VMs

You can use the following PowerCLI commandlets to get the uptime and boot time of ESXi hosts and VMs.

  • Get ESXi boot time.
> Get-Cluster | Get-VMHost | Select Name, @{Name="Boot time";Expression={$_.ExtensionData.Runtime.BootTime}}

Name                                  Boot time
----                                  ---------
esxi1.wxxxxx.com                      2/27/2025 10:13:45 AM
esxi2.wxxxxx.com                      6/18/2025 2:39:38 PM

  • Get ESXi uptime.
> Get-Cluster | Get-VMHost | Select Name, @{Name="Uptime (Days)";Expression={(Get-Date) - $_.ExtensionData.Runtime.BootTime | Select-Object -ExpandProperty Days}}

Name                                  Uptime (Days)
----                                  -------------
esxi1.wxxxxx.com                      116
esxi2.wxxxxx.com                      5

  • Get VM boot time.
> Get-Cluster | Get-VM | Select Name, @{Name="Boot time";Expression={$_.ExtensionData.Runtime.BootTime}}

Name                                      Boot time
----                                      ---------
test-vineeth
rhel84-vineeth
VMware vCenter Server                     2/25/2025 11:28:13 AM
vCLS-50a1b507-5a1d-5e00-8410-7599fc72e5b5 6/18/2025 2:51:59  PM
  • Get VM uptime.
> Get-Cluster | Get-VM | Select Name, @{Name="Uptime (Days)";Expression={(Get-Date) - $_.ExtensionData.Runtime.BootTime | Select-Object -ExpandProperty Days}}

Name                                      Uptime (Days)
----                                      -------------
test-vineeth
rhel84-vineeth
VMware vCenter Server                     118
vCLS-50a1b507-5a1d-5e00-8410-7599fc72e5b5 5

Hope it was useful. Cheers!