What is VMware Heap Size? How to Clear VMware Heap Size ?

Heap size in a VMware infrastructure refers to a portion of memory used to manage virtual machines and VMware-specific operations. The heap is dynamically allocated memory that can be released back to the operating system. It is used to store runtime data required for virtual machines, applications, and system processes.

Factors Increasing Heap Usage:

  • Virtual Machine Density: More VMs increase heap usage.
  • Application Requirements: Applications with high memory needs can raise heap usage.
  • Memory Leaks: Leaks in applications or processes can consume heap memory.
  • System and Service Updates: Updates may temporarily increase heap usage.
  • Configuration Changes: Adjustments in settings can impact heap usage.

Monitoring heap usage is crucial to prevent performance issues and maintain system health.

Methods to Clear VMware Heap Size:

You might need to clear the heap space on your VMware ESXi servers. Usually, the heap space is automatically managed to enhance the functionality of ESXi servers and prevent memory leaks. However, manual intervention might be necessary in certain situations. Here are some methods to consider:

  • Restart the ESXi Host: This is the simplest and most effective method if possible. It clears all memory and resets the heap space.
  • Restart Services: If restarting the host is not an option, you can clear the heap space by restarting key services. For example, use the commands /etc/init.d/hostd restart and /etc/init.d/vpxa restart to restart the management network service.
  • Check Advanced Settings: Some advanced settings, like Config.HostAgent.plugins.solo.enableMob, can affect heap size. Adjusting these settings as specified in VMware’s knowledge base might resolve issues.
  • Manage Memory Resources: Identify and address virtual machines or applications causing high memory usage to indirectly reduce heap usage.
  • Check Log Files: Log files in the /var/log directory, especially vmkernel.log and hostd.log, can help identify and troubleshoot heap issues.

If the methods above do not resolve the problem, you will need to contact VMware support for further assistance.

 

Have a nice day !

How to Upgrade Failover Cluster Functional Level

When you add new nodes with a higher operating system to your Windows Failover cluster environment, you will receive warnings about "Functional Level" mismatch in your failover cluster logs.

The main reason for these warnings is that the operating systems and functional levels of the clusters connected to the nodes in your environment are different from each other.

You can follow the steps below to change the functional level compatibility;

  • To view the Failover Cluster Functional Level version
    Get-Cluster | select ClusterFunctionalLevel
  • To upgrade the Failover Cluster Functional Level version
    Update-ClusterFunctionalLevel
  • To view the upgrade process of the Failover Cluster Functional Level version
    Get-Cluster | select ClusterFunctionalLevel
  • In Windows Server 2019 the Clustering team introduced a new PowerShell cmdlet to check how many nodes of the cluster are running on which level
    "Get-ClusterNodeSupportedVersion" helps you to identify the Cluster Functional Level and the Cluster Upgrade Version.

The table below shows the values and each corresponding functional level:

 

For more detailed information;

Have a nice day!

How to Fix Failed While Applying Switch Port Settings ‘Ethernet Switch Port VLAN Settings’

If you get the following error when you want to make a VLAN change on your virtual server that you use on Hyperv;

"Error applying Network Adapter changes"
"The operation failed. Failed while applying switch port settings 'Ethernet Switch Port VLAN Settings' on switch 'Vs': One or more arguments are invalid (0x80070057)."

The root cause of this problem is the network mode you use on your virtual server, for example F5 virtual server appliance.
Let’s continue with the example there are more than one ethernet card over the F5 virtual server appliance, some of which are trunk and some are access mode.

You will get an error when you make the VLAN change on the Trunk mode card from the Hyper V Failover Cluster gui.

To fix this problem, you can follow the steps below;

  • First of all, we view the cards and their modes on the virtual server.
    Get-VMNetworkAdapterVlan -VMName servername
  • The tag is removed the network card with trunk mode.
    Set-VMNetworkAdapterVlan -VMName servername -VMNetworkAdapterName NIC3 -untagged
  • We define access mode and VLAN ID.
    Set-VMNetworkAdapterVlan -VMName servername -VMNetworkAdapterName NIC3 -Access -VlanId 715
  • To view the change made.
    Get-VMNetworkAdapterVlan -VMName servername

Have a nice day!

 

How to Find Servers are Using VMXNET3 Adapter

If you want to list the adapters used by the virtual servers in your VMware virtualization platform, you can use the commands below.

By the way first of all you need to connect to vCenter and vmware tools must also be installed on your virtual servers.

For example to list servers with VMXNET3 adapters;

Get-Vm | Get-NetworkAdapter | Where-object {$_.Type -eq "Vmxnet3"} | Select @{N="VM";E={$_.Parent.Name}},Name,Type

 

For example to list servers without VMXNET3 adapters you can changing the -eq parameter;
Get-Vm | Get-NetworkAdapter | Where-object {$_.Type -ne "Vmxnet3"} | Select @{N="VM";E={$_.Parent.Name}},Name,Type

 

If you want to export these lists into .csv file usage Export-Csv command;
Export-Csv C:\VMXNET3_Adapter.csv -NoTypeInformation

The final state of the command;

Get-Vm | Get-NetworkAdapter | Where-object {$_.Type -eq "Vmxnet3"} | Select @{N="VM";E={$_.Parent.Name}},Name,Type | Export-Csv C:\VMXNET3_Adapter.csv -NoTypeInformation

Have a nice day !

How to Connect VMware from Powershell

I know it sounds like a very simple process.It is usually told that you can open the powershell application and access it with the “Connect-VIserver” command sets.
This information is correct but incomplete because the need to required install the powershell module.

Install-Module -Name VMware.PowerCLI

If you have installed the module, you can now connect to VMware vCenter via Powershell.

Connect-VIserver -Server vCenter -Port 443

If you get an error like the one below while connecting, you can use the command below to ignore the warning.

Error: Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you’d like to connect once or to add a permanent exception for this server. Additional Information: Could not establish trust relationship for the SSL/TLS secure channel with authority

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

Now you can connect

Have a nice day !

Hyper-V Virtual Switches

The structures Virtual Network and Virtual Switch, these are the components that our virtual servers running on virtualization platforms need for network communication.

Virtual switches also work exactly like physical switches ones. However, the type of your virtual switches will determine which function it will implement.

Virtual switches are very important and necessary for your virtual servers to communicate with your environment.
Therefore, all server virtualization platforms have virtual network technology.
Only the configuration parts can be different.
As a result, they all consist of 3 virtual network types.

  • External Virtual Switch
  • Internal Virtual Switch
  • Private Virtual Switch

External Virtual Switch
This switch type should be used when virtual machines are required to communicate with systems on the physical network.

It can be systems on a physical network, physical servers in your environment, virtual servers on Hyper-V or other servers & services outside.

“External Virtual Switch” are used for your virtual servers to communicate with the external environment.

In order for the External Virtual Switch you created to communicate with the physical network, it must be plugged into the physical network port.
Your virtual servers connected to Virtual Switch use your physical port as a common connection.

Internal Virtual Switch
It can only access your virtual servers in its host.
Therefore, it will only communicate with the host and other virtual servers in the host.
If you connect your virtual servers to Internal Virtual Switch, can’t communication to physical networks.
If you are going to use “Internal Virtual Switch”, you must also add a virtual network card connected to this switch on the Hyper-V host.
Your virtual servers with this type of virtual switch can run at 10Gbps.
Because communication is provided with VMBus protocol.
The existence of any physical port is not required.

Private Virtual Switch
It is used for your virtual servers on an existing host that you want to communication to only among themselves.
With Private Virtual Switches, you create a completely isolated network.
The existence of any physical port is not required.

For more information

Have a nice day!

How to Fix Hyper-V Failover Cluster Node Quarantine

In case you see quarantine status on your nodes in your Hyper-V Failover Clustering system,you should first examine the Cluster Events.

If the error code you will encounter while examining the cluster events is 1676, the action details you need to do are included in the error code. Don’t look for a different solution.

Open Windows Powershell –> Start-ClusterNode -ClearQuarantine

Check Cluster Node state –> Get-ClusterNode

Then go back to Failover Cluster Manager console and resume the paused node , taking fail roles back or don’t fail roles back.

Have a nice day!