Remote Proof of Concept testing seems to be gaining in popularity recently. The major difference in on-site vs remote testing is the access to HW to test drive unplug or physical network failure. What I use in case of disk failure testing in a vSAN cluster is vSAN Disk Fault Injection script that is available on ESXi. There is no need to download anything, it is there by default, check your /usr/lib/vmware/vsan/bin path but use the script for POC/homelab only.
We need to have a device id do run the script, we can test a cache or capacity drive per chosen disk group. In the example below I picked mpx.vmhba2:C0:T0:L0 which was a cache drive (Is Capacity Tier:false).
You can use esxli vsan storage list for that:
Or check in the vCenter console under Storage Devices:
Or under Disk Management:
python vsanDiskFaultInjection.pyc has the following options:
I am using -u for injecting a hot unplug.
/var/log/vmkernel.log is the place you can verify the disk status:
vSAN-> Disk Management will also show what is going on with a disk group that faced a drive failure.
And now we can observe the status of the data and the process of resyncing objects due to “compliance”.
After we are done with the testing, simple scan for new storage devices on the host will solve the issue.
When you work with nested vSAN homelab installations that constantly suffer power loses and network issues you get to know tons of useful troubleshooting tricks ;-). vSAN data seems to survive all of these unexpected failures, it is just a cluster services that sometimes need a little help. But remember, feel free to explore new tricks in your homelab but always consult Technical Support when you are not sure about the results of the command you want to use in your production environment.
Recently I ran into an issue in my lab and I wanted to see if it is vSAN related. There is this option in ESXi to boot a host with selected modules disabled. When the host boots, you have to press Shift+O to be able to disable modules.
Here is how I disabled vsan module:
And how to verify if the module is loaded:
esxcli system module list
vCenter recognized that the host in the cluster does not have its vSAN service enabled.
How to make a host to load back the vSAN module? Simply by restarting it. Although this host did not have a vSAN module at that moment, it was still in my vSAN cluster. The nice thing is that I got an additional notification from the vCenter that I had a partition in my cluster before the restart. Good to know…?
This may often happen in a nested vSAN environments in our home labs. We play with networking, remove vSAN kernels, put vCenter down, remove hosts from vSAN cluster…and there is this one step too far that results in having all our objects inaccessible, including vCenter. To be able to access the data (it is stored securely on the disk groups) we need to re-create our cluster back again.
How this can be done without vCenter? vSAN works fine when vCenter is down, but what happens when vCenter IS actually down and cluster is broken or needs to be reconfigured?
vSAN Health in ESXi web interface is a good start to asses the “damage”. If all of the hosts are isolated, all of them will be masters of their own single-node vSAN. If we do not see any other hosts in Hosts tab, this means the host does not see any of its neighbors in the vSAN network.
What we could do next is to ssh to all esxi hosts and check the cluster status with the command: esxcli vsan cluster get.
This will confirm that hosts are isolated or will help us to determine how the cluster is partitioned.
vmkping -I vmkX x.x.x.x will always help us to check if this is a network problem of the nested host. In this scenario we assume network works fine, pings are successful but nested hosts somehow cannot form the cluster.
It is vCenter’s role to inform hosts about their vSAN neighbors when we form the cluster but in this case we need to do this manually.
We need to “inform” hosts about their neighborhood (vSAN uses unicast). On the screen below we see 4 vSAN 7.0 hosts with vmk2 tagged with vsan traffic.
Every host should have a list of other host in a cluster. We can check it using esxcli vsan cluster unicastagent list.
If the cluster runs fine, this command shows the complete list of the neighbors from the single host perspective. Here we can see esxi-13 seeing all three other hosts on their vSAN network on vmk2.
On the screen below we can see that the host esxi-10 sees only esxi-11 and esxi-12.
Assuming network is fine, vCenter is down and won’t help us with this issue, we need to fill gaps in the unicastagent lists manually. Just remember, never add the IP of the host whose table is being configured. Here is the command we have to use:
Brand new vSphere and vSAN 7.0 binaries are available to download on my.vmware.com.
Check out the small sneak peak of 7.0, freshly installed on 4 vSAN all-flash hosts. We say goodbye to the old flash-based web client, we welcome VM hardware version 17 with watchdog timer (resetting the VM if the guest OS is no longer responding) and support for Precision Time Protocol, new re-written workload – centric DRS with scalable shares, vSAN memory consumption dashboards and many more….
vSAN unlike vMotion does not have dedicated TCP/IP stack. This means it uses default gateway.
In clusters where vSAN uses a single L2 domain it is not a problem. In cases where there are multiple L2 domains within a cluster (stretched cluster, dedicated L2 domain per site, clusters that span racks in a Leaf and Spine topology) we need to define static routes to reach other L2 domains.
It is important to know that when you enter a dedicated gateway address for the vSAN network (Override default gateway for this adapter) it does not override the routing table on the ESXi host:
ESXi attempts to route all traffic through the default gateway of the default TCP/IP stack (Management) instead.
So far, the only option to route traffic via dedicated gateway for vSAN is to create a static route using this command:
esxcli network ip route ipv4 add --gateway IPv4_address_of_router --network IPv4_address
Let’s not forget about the most important one after every change in the network: vmkping:
If you have Jumbo Frames configured in your environment, run vmkping with -d (disable fragmentation) and -s (size).
Privacy & Cookies Policy
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.