AI-assisted attackers can discover, exploit, and chain infrastructure vulnerabilities faster than ever, and operational security can no longer be treated as an annual or quarterly event. Malicious actors use automated tooling to weaponize zero-days and newly disclosed security flaws within […]
VMware Cloud Foundation (VCF) provides the operational elasticity and resource efficiency required for modern, scalable AI environments and helps transform an AI hardware system into an enterprise-grade private, flexible, AI-ready infrastructure. With the sharp increase in costs for data center [..]
If you’ve been working with VMware vSphere in a memory-tiered environment, you’ve probably run into two concepts that sound similar but behave very differently in practice, VM Memory Reservation and Memory Tier-Disabled VMs. What each one means, how they interact, and why the combination […]
This blog covers the overview of NUMA architecture and best practices for configuring vCPU for a vSphere virtual machine.
NUMA Architecture
Modern multi-socket servers divide memory among the processor sockets. Each socket has fast access to a local subset of memory and slower access to memory attached to other sockets. This design is called Non-Uniform Memory Access (NUMA), where each CPU socket with its local subset of memory forms a single physical NUMA node (pNUMA node).
ESXi keeps a VM’s vCPUs and memory within a single physical NUMA node if the VM’s configured vCPUs and memory do not exceed that NUMA node’s CPU cores and memory boundaries. This arrangement provides the lowest memory access latency. When a VM’s vCPU count exceeds the cores in one pNUMA node, ESXi treats it as a NUMA wide VM and exposes a vNUMA (virtual NUMA) topology to the guest OS, allowing the guest scheduler to make NUMA-aware decisions.
ESXi NUMA scheduling is enabled by default on hosts that have at least four CPU cores and at least two cores per pNUMA node.
With this background, let us review the best practices for configuring vCPU for a vSphere virtual machine.
Best practices for configuring vCPU for a vSphere virtual machine:
Try to stay within pNUMA boundaries: When configuring vCPUs and memory for a virtual machine, try to keep the VM’s vCPU count and memory within the boundaries of a single pNUMA node (physical NUMA node). For example, If your ESXi host has 2 sockets with 32 physical cores per socket and 256 GB RAM per physical NUMA (pNUMA) node, a VM with less than or equal to 32vCPUs and less than or equal to 256 GB RAM will fit inside a single pNUMA node with local memory access and zero inter-node latency
Recommendation for NUMA wide VMs: If you must configure more vCPUs than the physical cores in a pNUMA node, or if you need to assign more memory than a pNUMA node contains, evenly divide the vCPU count across the minimum number of pNUMA nodes.
Recommendations based on Virtual Hardware Version:
VMs with Virtual Machine Hardware version < 20: When configuring the number of vCPUs for a VM, set the cores per socket to evenly divide the number of vCPUs across the pNUMA nodes. For a sample configuration, please refer to the KB article340277 and the VMware blog virtual-machine-vcpu-and-vnuma-rightsizing-rules-of-thumb.
VMs with Virtual Hardware ≥ 20 (vSphere 8+): From vSphere 8 onwards, the enhanced CPU topology featureis available for virtual machines running with virtual hardware version greater than or equal to 20. In vSphere 8, you only need to assign the desired CPU count to a virtual machine and the system automatically assigns cores per socket. The hypervisor automatically determines the virtual machine’s CPU topology (number of virtual sockets, cores per socket, vNUMA nodes, etc.) when powered on. The “CPU Topology” parameter (a new feature in vSphere 8) is set to “Assigned at power on”. When active, the system considers the physical server’s CPU topology, physical NUMA nodes, and the requested vCPUs for the virtual machine. This data automatically determines the optimal virtual CPU topology and vNUMA nodes. This automatic default behaviour ensures that the virtual CPU topology and vNUMA topology of the virtual machine are best aligned with the physical CPU topology and NUMA architecture of the underlying server. For more details, you may refer to the email attached.
vCPU Hot Add and vNUMA: Enabling vCPU Hot add for virtual machines disables vNUMA. This could lead to performance issues, especially for NUMA wide VMs. This limitation does not apply to virtual machines with virtual hardware version greater than or equal to 20. For more details, please refer to the KB article –2040375. Therefore, avoid enabling vCPU Hot Add unless it is necessary, especially for VMs with virtual hardware version < 20.
Avoid odd vCPU count: Avoid assigning an odd number of vCPUs when your virtual machine’s size exceeds a physical NUMA node, either by vCPU count or configured memory.
Limit based on physical core count: Avoid assigning more vCPUs to a single VM than the total number of physical cores on the ESX host.
Leverage the right sizing feature: Use the right size feature available in VCF Operations 9.1and Aria Operations 8.18.xto identify undersized and oversized VMs and optimize resource allocation (vCPU and Memory allocation)
Key performance metrics to monitor for analysing and addressing performance issues:
CPU Metrics
Guest VM CPU Utilization: The“CPU Net Run %” metric for a Guest OS must be 80% or below during normal operation. The same 80% guideline applies to host CPU utilization (“CPU Utilization %” metric). Sustained saturation near 100% indicates undersizing and typically causes application slowness even when the ESX host has spare capacity.
CPU Ready (%RDY in esxtop / “Ready” in vSphere Client Performance charts): As per industry standards, the CPU Ready value should be below 5% per vCPU. Levels between 5% and 10% require investigation, and values above 10% impact performance, signaling host-level CPU contention.
Co-Stop (%CSTP): This metric is applicable only to SMP VMs (Symmetric Multiprocessor VMs with two or more vCPUs).Maintain below 3% per vCPU for multi-vCPU VMs. Sustained higher values indicate the VM has more vCPUs than it can effectively use; reducing the vCPU count usually helps.
Memory Metrics
Active and Consumed Memory: These metrics show how much memory the guest VM is actually using versus how much it has been allocated. A consistently low active-to-allocated ratio suggests oversizing.
Ballooning (MCTL/SZ and MCTL/TGT in esxtop): Non-zero ballooning indicates host memory pressure forcing ESXi to reclaim memory from the guest, signaling a need to review VM Memory allocation or host memory capacity.
Swap Activity (SWCUR, SWR/s, SWW/s in esxtop, swap-in and swap-out rates in performance charts): Non-zero swap-in or swap-out at the ESX host level usually indicates memory contention severe enough to impact VM performance. The goal must be to sustain zero swap activity at the ESX host level.
Guest Swap (In-Guest Paging): Use in-guest tools, since ESXi cannot see what the guest’s own swap subsystem is doing. Active in-guest paging suggests the VM itself is undersized for its workload.
In this blog, let us understand how one can leverage some of the key inbuilt capabilities available within the vSphere platform to analyse and troubleshoot vSAN performance issues.
vSAN Performance Top contributors
You can identify the top contributors to performance issues by navigating to the vSAN cluster object>monitor>vSAN >Performance tab. As shown in the screenshot below, top contributors can be checked at the VM, host (frontend and backend), and disk group levels.
Additionally, for a selected object (VM, host frontend, host backend, Disk Group), the top contributors can be sorted based on the Ready Latency, Write Latency, Read IOPs, Write IOPs, Read Throughput and Write Throughput.
The vSAN Performance Top Contributorscapability could serve as a starting point in analysing performance issues, as it helps to identify Virtual Machines, Hosts or Disk groups which may be contributing the most towards to the overall latency observed at the vSAN cluster or vSAN datastore level. Thus, it helps to narrow down the issue and aids in identifying the root cause of the issue.
Additionally, with this capability, you can check the values of two different interrelated metrics at the same time. For instance, you can check both Write Latency and Write IOPs for a given virtual machine at the same time interval and determine if a large number of Write IOPs or a sudden surge in Write IOPs resulted in Write latency.
I/O Trip Analyzer
To use the I/O Trip analyzer, navigate to the vSAN cluster object>monitor>vSAN >Performance tab. In the I/O Trip analyzer tab, click on ‘RUN NEW TEST’ and select the time interval and the target VM to run the test. You can run the I/O Trip analyser test from 5 minutes to 60 minutes. As shown in the screenshot below, the I/O Trip analyzer test can also be scheduled to run on an hourly, daily or weekly basis. This capability could be immensely useful if a given VM is experiencing read or write latency at a particular time interval on a daily or weekly basis. In such cases, the I/O trip analyser could be scheduled to run around the same time, so that required statistics can be collected during the problematic time interval.
Once the time interval and VM are selected, click on FINISH to run the test.
Once the test completes, you can view the results by clicking on VIEW RESULTS.
As shown in the screenshot below, the results show the latency at the different stages through the journey of the I/O path. Thus, it enables determining a point of contention which could be contributing towards performance issues.
For instance, when you click on each of the stages (dots), it provides a latency value with a probable cause. For details, please refer to the screenshots below.
ESXTOP Utility
The esxtop utility could be used to monitor the relevant metrics of virtual machine, disks and HBA in real time
esxtop – option v to monitor statistics for virtual machines
esxtop – option d to monitor statistics for HBA
esxtop – option u to monitor statistics for lun devices
In a large vSphere private cloud environment, comprising of several hundred ESXi hosts and several thousand virtual machines, it is often a challenge to monitor and audit critical VM (virtual machine) events such as VM reconfiguration events, VM powered-on events, VM powered-off events, VM deletion events, etc. So, let us understand how the Aria Operations for Logs could be used to monitor, track and audit such critical virtual machine events across multiple virtual machines.
The objective is to monitor and capture the following data for all the critical operations performed on virtual machines:
Username of the user who performed the operation.
What operation (Reconfiguration, Powered Off, Powered On, Delete, Suspend) was performed on the VM.
Name of the VM on which the operation was performed.
Date and time at which the operation was performed.
The ESXi host on which the VM was running when the operation was performed.
Virtual Machine Reconfiguration Events
In the Explore Logs tab, define the filters as shown below.
Once you have the desired outcome, add the query to a Dashboard by clicking an option next to the Bell icon, as shown in the image above. Select the following columns when you add this query to the Dashboard.
Virtual Machine Powered Off Events
In the Explore Logs tab, define the filters as shown below.
Add this query to the same dashboard and select the following columns
Virtual Machine Powered On Events
In the Explore Logs tab, define the filters as shown below.
Add this query to the same dashboard and select the following columns
VM Suspend Events
In the Explore Logs tab, define the filters as shown below.
Add this query to the same dashboard and select the following columns
Virtual Machine Delete Events
In the Explore Logs tab, define the filters as shown below.
Add this query to the same dashboard and select the following columns
If you now navigate to the Dashboard tab, under the shared dashboards, you should see the VM Critical Events dashboard with all the critical VM events .
In most financial institutions, including banks, there is often a requirement to comply with security guidelines defined by governing and regulatory authorities. While working for one of the large private banks, I came across one such security requirement that mandated monitoring and auditing of critical security events on the vSphere platform. The security event could be an intruder making an unauthorised login attempt to the vSphere private cloud components like vCenter Server and ESXi hosts or a privileged escalation event, where a user is assigned administrator privileges.
With this background, let us now understand how the Log Forwarding capability of Aria Operations for Logs could be used to filter and forward selected security events to a SIEM (Security Information and Event Management) solution for the purpose of monitoring and auditing.
In this blog, I’ve shared the filter definitions of a few critical security events that need to be monitored from the security and compliance standpoint. Of course, the list of security events is not limited to the ones detailed below; you could define more custom filters to fetch and forward security events based on your requirements.
For all the log forwarding destinations detailed below, in the Host field, enter the IP address of a destination SIEM server to which you intend to forward the security events. The Host field is not shown in the screenshots below for security reasons.
Failed Login attempt to vCenter Server from an AD user:
In the Log Management tab, under Log Forwarding, click New Destination and define the filter as shown below. In this case, it is assumed that the AD user ID begins with a keyword ban.
With the above set of filters, click the “Run in Explore Logs page” option to confirm the result of the filter defined in the log forwarding destination.
As you can see from the screenshot below, this filter provides the following details:
Details of the AD user who attempted to login to the vCenter Server
Date and time at which an attempt was made to login to the vCenter Server
FQDN of the vCenter Server to which the AD user was trying to login
The source IP address from where an attempt was made to log in to the vCenter Server
While some of the fields above are partially masked for security reasons, when you run this filter in the Explore Logs page, it will essentially provide all the details that are required to monitor and audit failed login attempts to the vCenter Server from AD users. The SIEM team can use this security event to monitor failed login attempts to vCenter Server from AD user.
Failed login attempt to vCenter Server from an admin user (administrator@vsphere.local):
In the Log Management tab, under Log Forwarding, click New Destination and define the filter as shown below.
With the above set of filters, click the “Run in Explore Logs page” option to confirm the result of the filter defined in the log forwarding destination.
As you can see from the screenshot above, this filter provides the following details:
Details of the administrator@vsphere.local user that was used to login to the vCenter Server
Date and time at which an attempt was made to login to the vCenter Server
FQDN of the vCenter Server to which the AD user was trying to login
The source IP address from where an attempt was made to log in to the vCenter Server
ESXi host authentication events
In the Log Management tab, under Log Forwarding, click New Destination and define the Filter as shown below. This Filter definition can be used to monitor and audit the login attempts to ESXi hosts using the SSH protocol.
With the above set of filters, click the “Run in Explore Logs page” option to confirm the result of the filter defined in the log forwarding destination.
This Filter definiton provides the following details:
The user name of the user (root user) that was used to login to the ESXi host.
Date and time at which an attempt was made to login to the ESXi host
The source IP address from where an SSH session was initiated to login to the ESXi host
The hostname of the ESXi host to which the user logged in using root credentials
This security event can be incredibly useful when access to ESXi hosts is allowed only from a certain whitelisted set of IP addresses, for example, gateway IP addresses of a Privileged Access Management solution such as CyberArk or ARCOS.
In such a case, you can forward the ESXi host authentication events to a SIEM server and have an SOC (Security Operations Centre) incident raised if an attempt is made to login to ESXi hosts using any IP address which is outside of the set of whitelisted IP addresses.
USB Arbitrator service events
As per VMware KB article 314362, the USB arbitrator service needs to be disabled to use a USB device locally on an ESXi host. This essentially means that a locally connected USB device on the ESXi host can be used to copy data directly from the local disk on the host after the USB arbitrator service has been stopped or disabled. Therefore, it becomes important to monitor any attempts that are made to stop or disable the USB arbitrator service across ESXi hosts.
The Filter definition below can be used to monitor the event which gets logged when an attempt is made to stop the USB arbitrator service.
With the above set of filters, click the “Run in Explore Logs page” option to confirm the result of the Filter defined in the log forwarding destination.
This Filter provides the following details:
Hostname of the ESXi host on which the command to stop the usbarbitrator service was run.
The data and time at which the command to stop the usbarbitrator service was run.
The root user with which the command was run to stop the usbarbitrator service.
While these are some of the security and compliance use cases which can be accomplished using Aria Operations for Logs, you could define your custom Filters to extract and monitor many more such security-relevant events.
In this blog, I’ve attempted to define the procedure, along with key commands and checks, that may come in handy in troubleshooting network-related issues in a vSAN cluster.
Before we get into troubleshooting network issues, let us first understand what a healthy vSAN cluster looks like.
In case of any issues relevant to vSAN, the first thing to check is the vSAN Skyline Health. The vSAN Skyline health is an inbuilt utility used to monitor the status of all vSAN cluster components, diagnose cluster health and troubleshoot issues.
As shown in a snippet below, in the vSphere client, navigate to a vSAN cluster object and click on vSAN>Skyline Health under the monitor tab. The snippet below is from a lab environment, where there a few minor issues relevant to cluster capacity and SCSI contoller firmware version. Therefore, the vSAN cluster health score shows up as 97%. In an ideal scenario, the vSAN Skyline Health score should be 100%, which indicates that all the vSAN cluster components are healthy. To fetch the latest status of cluster components, you can rerun the vSAN Skyline Health test by clicking on the RETEST icon.
You could also run the command below to check the health of all vSAN cluster components, including the network. In case of a network-relevant issue, the status of network checks may show up as red or yellow. However, under an ideal scenario, the status of network checks should show up as green as indicated in the snippet below.
esxcli vsan health cluster list
The command below could be used to confirm if all the vSAN nodes are part of the cluster.
The Sub-Cluster Member count in the output of the command below should always be equal to the total number of nodes in a cluster.
esxcli vsan cluster get
Now let us relook at the vSAN Skyline health and the output of commands above in case of a network issue in a vSAN cluster.
In case of a network issue between the vSAN nodes, the vSAN Skyline health would typically indicate the vSAN cluster partition error. The vSAN cluster partition error indicates that one or more nodes in a vSAN cluster are not able to communicate over the unicast with other nodes in the cluster. This essentially means that a vSAN cluster is partitioned into more than one sub-group of nodes, which are not able to communicate with each other over the network.
The vSAN cluster partition error is often accompanied by vSAN Basic (unicast) connectivity check and vSAN MTU check errors.
If you now query the vSAN cluster health using the esxcli command, you would notice that the status of vSAN cluster partitioning, vSAN Basic unicast connectivity check and vSAN MTU check shows up as red.
Let us now understand how to diagnose and troubleshoot a vSAN cluster partitioning issue.
The vSAN Skyline health comes with this amazing feature, where one can click on the TROUBLESHOOT option from within the error window to further diagnose and identify the root cause of the issue.
When you click on TROUBLESHOOT option and view the Hosts list or Partition list, it indicates the number of partitions and hosts in the partition.
As shown in the screenshot below, in this case, the vSAN cluster is split into two partitions or sub-groups with one ESXi host esx-01a in one sub-group and the remaining three ESXi hosts (esx-02a, esx-03a and esx-04a) in another sub-group.
You could also verify the no of cluster partitions by running the esxcli command below on the cluster nodes and refer to the sub-cluster membership count.
esxcli vsan cluster get
So, now we understand that ESXi host esx-01a is possibly not able to communicate with the remaining nodes in a vSAN cluster.
There could be several reasons leading to such network issues, including misconfiguration issues, such as a misconfigured VLAN ID or an issue with the physical network adapter or issue within the physical network layer.
As a next logical step, let us identify the VMkernel adapter configured for vSAN on the esx-01a host by running the command below.
esxcli vsan network list
Now, let us run the command below to identify the IP address associated with the VMkernel adapter vmk2.
esxcli network ip interface ipv4 get
So, we can now run the vmkping command below and test the connectivity along the data path between the vSAN nodes in a cluster.
Let us attempt to ping the vSAN IP address of esx01-a host from the ESXi host esx02-a.
The ping test shows 100% packet loss, which could be due to some issue along the physical network path, including issues with the physical network adapter or some issue in the physical network layer.
Let us now identify the uplinks or physical network adapters associated with the VMkernel adapter vmk2.
You could either use the esxtop command followed by an option ‘n’ to identify the association between the VMkernel adapter and the physical uplink network adapter, or login to the vSphere client, navigate to the vSphere distributed switch and view the vSAN port group configuration.
esxtop – (option n)
From the esxtop command above, we understand that the vmk2 vmkernel adapter is associated with a physical network adapter vmnic0.
As a next step, check the physical network adapter status by running the command below
esxcli network nic list
In case of an issue with the physical network layer or a physical network adapter, the link status would show up as Down, as shown in the snippet above. So, now we have identified why the ESXi host esx-01a was not able to communicate and exchange unicast traffic with other nodes in a vSAN cluster.
If the link status of a physical network adapter is down, please involve the physical network team to investigate further. The link status could be down due to several factors, including issues with the physical network adapter, physical network cables, and physical switches.
The Admin status is the logical status of the network adapter that can be switched using the command below. In a lab environment, the Admin status of a VMNIC0 was disabled to simulate the network issue. Therefore, in the screenshot above, the Admin status shows up as Down.
esxcli network nic up -n <vmnic id> or esxcli network nic down -n <vmnic id>
Also, in a production environment, there would usually be two uplink network adapters configured a NIC teaming policy. Therefore, if the link status of one of the network path goes down, the other physical network path would serve the traffic.
“Many companies have started to figure out that there is a better approach which is called Cloud Smart. Fundamentally, Cloud Smart means taking an architectural and planned approach to digital transformation and multi-cloud.” – Raghu Raghuram, CEO, VMware
If you are looking to learn more about the multi-cloud approach from the experts, be a part of exciting activities, and network with peers from the industry VMware Explore happening in Mumbai, India on April 11th and 12th is the place to be. Register now!
VMware Explore is coming to Mumbai, India for the first time ever, on April 11th & 12th, 2023. Here’s a glimpse of what you can expect at this insightful and exhilarating 2-day event. Check out the video on the link below.
VMware is proud to announce the general availability of VMware Ransomware Recovery for VMware Cloud DR. VMware Ransomware Recovery is a purpose-built ransomware recovery-as-a-service solution that enables businesses to recover from ransomware attacks faster and with more predictability & confidence.