# 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

```shell
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
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

```shell
SELECT * FROM vpx_entity; 
```

### Delete the store

This is the delete for cleaning up the inaccessible datastore

<table border="1" id="bkmrk-delete-from-vpx_ds_a" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>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;</td></tr></tbody></table>

Change the ID and then run the following

```bash
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

```shell
\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 "<span style="color: rgb(241, 196, 15);">Shift-F10</span>" to open up the command prompt

[![image.png](https://docs.thehomestack.io/uploads/images/gallery/2024-09/scaled-1680-/VQCimage.png)](https://docs.thehomestack.io/uploads/images/gallery/2024-09/VQCimage.png)

Once the command prompt window is opened type "<span style="color: rgb(241, 196, 15);">regedit</span>"

[![image.png](https://docs.thehomestack.io/uploads/images/gallery/2024-09/scaled-1680-/7voimage.png)](https://docs.thehomestack.io/uploads/images/gallery/2024-09/7voimage.png)

Once opened then navigate to "<span style="color: rgb(241, 196, 15);">HKEY\_LOCAL\_MACHINE, SYSTEM, Setup</span>" and then right-click and add a "<span style="color: rgb(241, 196, 15);">New, Key</span>"

[![image.png](https://docs.thehomestack.io/uploads/images/gallery/2024-09/scaled-1680-/b4Uimage.png)](https://docs.thehomestack.io/uploads/images/gallery/2024-09/b4Uimage.png)

Add the key called "<span style="color: rgb(241, 196, 15);">LabConfig</span>" then right-click on the "<span style="color: rgb(241, 196, 15);">LabConfig</span>" and add a new "<span style="color: rgb(241, 196, 15);">DWORD Value</span>"

[![image.png](https://docs.thehomestack.io/uploads/images/gallery/2024-09/scaled-1680-/VBpimage.png)](https://docs.thehomestack.io/uploads/images/gallery/2024-09/VBpimage.png)

Add the new value called "<span style="color: rgb(241, 196, 15);">ByPassTPMCheck</span>" with a hexdecimal of "<span style="color: rgb(241, 196, 15);">1</span>"

[![image.png](https://docs.thehomestack.io/uploads/images/gallery/2024-09/scaled-1680-/HRNimage.png)](https://docs.thehomestack.io/uploads/images/gallery/2024-09/HRNimage.png)

Close every window then click on "<span style="color: rgb(241, 196, 15);">Install Now</span>" but do not reboot or the new added key will be lost.

[![image.png](https://docs.thehomestack.io/uploads/images/gallery/2024-09/scaled-1680-/d1Zimage.png)](https://docs.thehomestack.io/uploads/images/gallery/2024-09/d1Zimage.png)

# VMWare - Copy and Paste from Console to VM

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

1. 1. 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.![](https://api-broadcomcms-software.wolkenservicedesk.com/attachment/get_attachment_content?uniqueFileId=1732620817612)<table border="1"><tbody><tr><td>Name</td><td>Value</td></tr><tr><td>`isolation.tools.copy.disable`</td><td>`FALSE`</td></tr><tr><td>`isolation.tools.paste.disable`</td><td>`FALSE`</td></tr><tr><td>`isolation.tools.setGUIOptions.enable`</td><td>`TRUE`</td></tr></tbody></table>
        2. Click "**OK**".

3. Power on the VM
4. 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](https://docs.thehomestack.io/uploads/images/gallery/2026-09/scaled-1680-/image.png)](https://docs.thehomestack.io/uploads/images/gallery/2026-09/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](https://www.vmware.com/techpapers/2012/vmware-vsphere-storage-apis-array-integration-10337.html).

Source link [here](https://oceansls.com/fix-vmware-view-horizon-the-redo-log-of-vmdk-is-corrupt/)

# ESXi - UPS Nut Installation

# Vmware ESXi NUT Client Installation and Configuration

<div id="bkmrk-">  
</div>#### Requirements

- You must have a NUT server connected to a UPS and configured in your environment.
- SSH must be enabled on your ESXi installation
- Community acceptance level must be enabled on your ESXi installation in order to install the client

#### Download

Download the latest **NutClient-ESXi-x.x.x-x.x.x-offline\_bundle.zip** package from: [https://github.com/rgc2000/NutClient-ESXi/releases](https://github.com/rgc2000/NutClient-ESXi/releases).

#### Install

- Secure copy the **NutClient-ESXi-x.x.x-x.x.x-offline\_bundle.zip** to your ESXi server’s /tmp directory by either using WinSCP/pscp in Windows or scp in Linux.
- Set ESXi Community Acceptance level:

```bash
esxcli software acceptance set --level=CommunitySupported
```

If you get the following error:

<table border="1" id="bkmrk-%C2%A0%5Bacceptanceconfiger" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td> \[AcceptanceConfigError\]  
 Secure Boot enabled: Cannot change acceptance level to community.  
 Please refer to the log file for more details.</td></tr></tbody></table>

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

- Install bundle:

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

- If installation was successful you should see the following output:

<table border="1" id="bkmrk-installation-result-" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td>Installation Result

 Message: Operation finished successfully.

 Reboot Required: false

 VIBs Installed: Margar\_bootbank\_upsmon\_x.x.x-x.x.x

 VIBs Removed:

 VIBs Skipped:

</td></tr></tbody></table>

- You can now delete the files in the /tmp directory and disable the SSH service if desired.

#### ESXi Configuration

- In the ESXi Web client, navigate to **Host —&gt; Manage —&gt; System —&gt; Advanced Settings**. In the **Search** box enter **UserVars**.**Nut** **(Figure 1).**

**Figure 1**

[![image-1647104283497.png](https://docs.deeztek.com/uploads/images/gallery/2022-03/scaled-1680-/image-1647104283497.png)](https://docs.deeztek.com/uploads/images/gallery/2022-03/image-1647104283497.png)

- Configure the following variables:

**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

- In the ESXi Web client, navigate to **Host —&gt; Manage —&gt; Services —&gt; NutClient —&gt;** **Actions —&gt; Policy —&gt; Start and Stop with Host (Figure 2).**

**Figure 2**

[![image-1647104294686.png](https://docs.deeztek.com/uploads/images/gallery/2022-03/scaled-1680-/image-1647104294686.png)](https://docs.deeztek.com/uploads/images/gallery/2022-03/image-1647104294686.png)

- In the ESXi Web client, navigate to **Host —&gt; Manage —&gt; Services —&gt; NutClient —&gt;** **Actions —&gt; Start (Figure 3).**

**Figure 3**

[![image-1647104306878.png](https://docs.deeztek.com/uploads/images/gallery/2022-03/scaled-1680-/image-1647104306878.png)](https://docs.deeztek.com/uploads/images/gallery/2022-03/image-1647104306878.png)

#### Tips

- Use the ESXi host configuration tab in the vSphere Client to decide how to start and stop (or suspend) virtual machines. This order will be respected by the UPS shutdown procedure.
- The clean shutdown of the OS in the virtual machines is only possible if the vmware tools are installed.
- To uninstall the NUT client, use the following command:

```bash
esxcli software vib remove -n upsmon
```

- To update the NUT client, use the following command:

```bash
esxcli software vib update -d /tmp/NutClient-ESXi-x.x.x-x.x.x-offline_bundle.zip
```

- To estimate the time needed for the server to shut down on UPS alert, type the command below on the host ESXi (by ssh or on the console). The shutdown procedure is immediately started:

```bash
/opt/nut/sbin/upsmon -c fsd
```

- If the NUT Client is configured correctly, the ESXi /var/log/syslog.log should have a message similar to below where ups@UPSHOST is the ups name and the UPS host you setup earlier :

```bash
2019-09-22T13:28:07Z upsmon[2111424]: Communications with UPS ups@UPSHOST established
```