VMware vSphere & ESXi

Installing, upgrading and managing VMware vSphere and ESXi hosts.

VMWare - Delete inaccessible datastore

Rename the store

Use the web client to rename each store and a DEL in front of the name

Access the shell of the appliance server and then the database

VMware vCenter Server 8.0.2.00300

Type: vCenter Server with an embedded Platform Services Controller

Connected to service
* List APIs: "help api list"
* List Plugins: "help pi list"
* Launch BASH: "shell"

Command> shell
Shell access is granted to root
root@vcenter [ ~ ]#
shell;/opt/vmware/vpostgres/current/bin/psql -d VCDB -U postgres

View the stores

This will give you the ID that is needed to clean up

SELECT * FROM vpx_entity; 

Delete the store

This is the delete for cleaning up the inaccessible datastore

DELETE FROM vpx_ds_assignment WHERE ds_id=1015;
DELETE FROM vpx_datastore WHERE id=1015;
DELETE FROM vpx_vm_ds_space WHERE ds_id=1015;
DELETE from vpx_entity where id=1015;

Change the ID and then run the following 

DELETE FROM vpx_ds_assignment WHERE ds_id=5015;DELETE FROM vpx_datastore WHERE id=5015;DELETE FROM vpx_vm_ds_space WHERE ds_id=5015;DELETE from vpx_entity where id=5015;

Restart the services

\q;service-control --stop --all && service-control --start --all

VMWare - Install Windows 11 on vCenter 8 without TMP 2.0

Create a VMWare to host Windows 11 without having a virtual TMP or device installed.

Once you are at this step you have to hit "Shift-F10" to open up the command prompt

image.png

Once the command prompt window is opened type "regedit"

image.png

Once opened then navigate to "HKEY_LOCAL_MACHINE, SYSTEM, Setup" and then right-click and add a "New, Key"

image.png

Add the key called "LabConfig" then right-click on the "LabConfig" and add a new "DWORD Value"

image.png

Add the new value called "ByPassTPMCheck" with a hexdecimal of "1"

image.png

Close every window then click on "Install Now" but do not reboot or the new added key will be lost.

image.png

VMWare - Copy and Paste from Console to VM

On any Powered Off VM, click the "Advanced Parameters" tab.

      1. Click filter icon of Attribute column. Search for 3 items' names, check if they already exist. If yes, edit their corresponding values. If not, add them from the textboxs above.
        Name Value
        isolation.tools.copy.disable FALSE
        isolation.tools.paste.disable FALSE
        isolation.tools.setGUIOptions.enable TRUE
      2. Click "OK".
  1. Power on the VM
  2. Then use Copy/Paste directly on Windows/Linux/any other platform. 

VMWare - Fix VMware View Horizon the redo log of .vmdk is corrupt

image.png

To disable the VAAI on the host follow the following steps:

  1. Open Vsphere Client and connect to Vcenter Server.
  2. Navigate to the ESXi Host and then Click on the Configuration Tab.
  3. Click on Advanced Settings.
  4. Click on DataMover.
  5. Change the value of DataMover.HardwareAcceleratedMove setting from 1 to 0.
  6. Change the value of DataMover.HardwareAcceleratedInit setting from 1 to 0. 
  7. Click on VMFS3.
  8. Change the value of VMFS3.HardwareAcceleratedLocking setting from 1 to 0. 
  9. Click Ok.
  10. Repeat the steps 1-9 on all ESXi Hosts in the cluster.

This should resolve the error once and for all. More info about VAAI can be found here.

ESXi - UPS Nut Installation

Vmware ESXi NUT Client Installation and Configuration


Requirements

Download

Download the latest NutClient-ESXi-x.x.x-x.x.x-offline_bundle.zip package from: https://github.com/rgc2000/NutClient-ESXi/releases.

Install

esxcli software acceptance set --level=CommunitySupported

If you get the following error:

 [AcceptanceConfigError]
 Secure Boot enabled: Cannot change acceptance level to community.
 Please refer to the log file for more details.

You must disable Secure Boot in your computer BIOS and re-try the installation again.

esxcli software vib install -d /tmp/NutClient-ESXi-x.x.x-x.x.x-offline_bundle.zip

Installation Result

   Message: Operation finished successfully.

   Reboot Required: false

   VIBs Installed: Margar_bootbank_upsmon_x.x.x-x.x.x

   VIBs Removed:

   VIBs Skipped:

ESXi Configuration

Figure 1

image-1647104283497.png

NutUpsName: Name of the UPS on the NUT server (in the form of inverter_name@server_name or server_ip). Several inverters can be entered separated by a space. There will be no system shutdown until the last UPS still standing has given the shutdown command.

NutUser: Name of the NUT server login account

NutPassword: NUT Server Connection Account Password

NutFinalDelay: Seconds to wait after receiving the low battery event to shut down the system

NutSendMail: Set to 1 for the NUT client to send an e-mail to each important event of the UPS

NutMailTo: E-mail address to send UPS events to

Figure 2

image-1647104294686.png

Figure 3

image-1647104306878.png

Tips

esxcli software vib remove -n upsmon
esxcli software vib update -d /tmp/NutClient-ESXi-x.x.x-x.x.x-offline_bundle.zip
/opt/nut/sbin/upsmon -c fsd
2019-09-22T13:28:07Z upsmon[2111424]: Communications with UPS ups@UPSHOST established