Clear HA alarm on all VMs

Recently I ran into an issue where HA triggered on a cluster but failed. This generated an alert on several hundred VMs. Hating to click each one to reset the alarm that wasn’t clearing I found the following solution.

  1. PowerCLI to vCenter
  2. Run the following command to disable the alarm
  3. Get-AlarmDefinition "vSphere HA virtual machine failover failed" |Set-AlarmDefinition -Enabled:$false
  4. The alarm should clear almost instantly for all VMs
  5. Re-enable the alarm
  6. Get-AlarmDefinition "vSphere HA virtual machine failover failed" |Set-AlarmDefinition -Enabled:$true

Bi-Directional Packet Capture on ESXi

I recently ran into an issue where we needed to capture some packets from the vmk interface on a Nutanix/vSphere host. I found this great utility for that, pktcap-uw, however it only captures traffic in one direction by default. Thankfully I found someone with the info on how to run both incoming and outgoing captures at the same time.

  1. SSH to the host
  2. Update the cmd below to reflect your vmk port or whatever you are trying to capture
  3. Run this cmd
  4. pktcap-uw --vmk vmk0 --dir 0 -o /tmp/vmk0_in.pcap & pktcap-uw --vmk vmk0 --dir 1 -o /tmp/vmk0_out.pcap &
  5. Shut down the capture after your done with this cmd
  6. kill $(lsof |grep pktcap-uw |awk '{print $1}'| sort -u)
  7. Use WinSCP to connect to the host
  8. Copy vmk0_in.pcap & vmk0_out.pcap files from /tmp/*
  9. Save them somewhere useful
  10. Open in wireshark
  11. Click File > Merge > pick the 2nd file
  12. And you should be presented with a capture with both incoming and outgoing packets.

Using the pktcap-uw tool in ESXi 5.5 and later (2051814)

@beandrew – his reply is what got this working for me

Fix: User running the upgrade does not have ‘Replace a process level token’ privilege.

While migrating Windows vCenter Server 5.5 to VCSA 6.5u2c this error was observed and corrected using the following steps.

  1. Open Administrative Tools > Local Security Policy
  2. Navigate in the tree to Local Polices > User Rights Assignment0014
  3. Open the ‘Replace a process level token’ policy
  4. Add the migration user, in this case I added ‘Domain Admins’0015
  5. Click OK, there is no need to restart the server before re-attempting the migration

Related KB: https://kb.vmware.com/s/article/2148010