So far in this series of articles I've covered the following items.Part 1 - initial setup and creating a VMPart 2 - add a license key, enable VM automatic startup and shutdown and unregister a VMPart 3 - create a virtual switch and configure a firewall VMPart 4 - install an update for ESXiPart 5 - Creating a datastore and migrating VMs

This article started from a need to add a VMDK to a VM for some performance testing. Part of the process was to hot add the disk to a VM and when I found that I couldn't I choose to reset the license for the host back to evaluation mode to accomplish this.

1) I created a folder for disk file and then ran the below command to create the VMDK.

vmkfstools -c 255G -d eagerzeroedthick -a lsilogic IOMETER.vmdk

2) If the VM had been powered down, I could have added the below to the VMX file for the VM and then powered it on.

3) Instead I wanted to hot-add the disk so I ran the below commands. The first run shows the syntax of the command and with the second command I added the VMDK to the VM as device 1 on SCSI controller 0. If I had wanted to remove the virtual disk from the VM I would have used the device.diskremove option as shown below.

5) As shown above I was not able to add the disk as my license was not configured for hot add, so I decided to change the ESXi temporarily back to evaluation mode. Using what I had done in Part 2, I did the following:

a) Edited /etc/vmware/vmware.lic and deleted the license key.

b) Deleted the file /etc/vmware/license.cfg

c) Ran the command services.sh restart

d) I then queried the license information to check the status. The file /etc/vmware/license.cfg was automatically recreated. You'll note that for the 1st attempt of the command I got the "514 Error connecting" error. This was due to the services restart sequence completing, but the hostd service not yet being fully up yet.

After the host was in evaluation mode I reran the command to hot add the disk and it appeared in the VM. I then was able to set my license config back to the proper serial number.