Adding A License File
The VMs on the host had been running for some time
without any issues, but were powered off due to a power failure so I had
to login and start them manually.
1) I tried to power on the VM and received the below error about the evaluation period being over.
~ # vim-cmd vmsvc/power.on 96
Powering on VM:
(vim.fault.LicenseExpired) {
dynamicType =,
faultCause = (vmodl.MethodFault) null,
faultMessage = (vmodl.LocalizableMessage) [
(vmodl.LocalizableMessage) {
dynamicType =,
key = "com.vmware.vim.license.error.evalPeriodOver",
arg = (vmodl.KeyAnyValue) [
(vmodl.KeyAnyValue) {
dynamicType =,
key = "info",
value = "notinstalled",
}
],
message = "Evaluation period is over, Please install a license.",
}
],
licenseKey = "00000-00000-00000-00000-00000",
msg = "License key has expired."
}
~ #
Powering on VM:
(vim.fault.LicenseExpired) {
dynamicType =
faultCause = (vmodl.MethodFault) null,
faultMessage = (vmodl.LocalizableMessage) [
(vmodl.LocalizableMessage) {
dynamicType =
key = "com.vmware.vim.license.error.evalPeriodOver",
arg = (vmodl.KeyAnyValue) [
(vmodl.KeyAnyValue) {
dynamicType =
key = "info",
value = "notinstalled",
}
],
message = "Evaluation period is over, Please install a license.",
}
],
licenseKey = "00000-00000-00000-00000-00000",
msg = "License key has expired."
}
~ #
2) The command vim-cmd includes a license option
within the /vimsvc node. The license option includes both a set and
switch option. Running vim-cmd vimsvc/license --show displayed similar information as when I tried to power on the VM.
~ # vim-cmd vimsvc/license --show
[200] Sending request for installed licenses...[200] Complete, result is:
serial: 00000-00000-00000-00000-00000
vmodl key: eval
name: Evaluation Mode
total: 0
used: 0
unit: host
Properties:
[expirationHours] = 0
[expirationMinutes] = 0
[diagnostic] = Evaluation period has expired, please install license.
[200] Sending request for installed licenses...[200] Complete, result is:
serial: 00000-00000-00000-00000-00000
vmodl key: eval
name: Evaluation Mode
total: 0
used: 0
unit: host
Properties:
[expirationHours] = 0
[expirationMinutes] = 0
[diagnostic] = Evaluation period has expired, please install license.
3) I tried to set the license with vim-cmd vimsvc/license --set,
but kept getting an error shown below. I did try the license serial
with both single and double quotes and also without quotes and dashes,
but always got the same error.
/etc/vmware # vim-cmd vimsvc/license --set="M0025-*****-*****-*****-0D040"
[500] Unexpected operation, aborting command.
[500] Unexpected operation, aborting command.
Update: the help for vim-cmd incorrectly includes an equal sign. The command should be entered as: vim-cmd vimsvc/license --set "M0025-*****-*****-*****-0D040"
4) So to set the license I edited the license file with the command vi /etc/vmware/vmware.lic.
I replaced 00000-00000-00000-00000-00000 with my serial number and
then saved the file. I then querried the license data and got this
response.
/etc/vmware # vim-cmd vimsvc/license --show
[200] Sending request for installed licenses...[200] Complete, result is:
serial: M0025-*****-*****-*****-0D040
vmodl key: esxBasic
name: ESXi 4 Single Server
total: 0
used: 1
unit: cpuPackage:6core
Properties:
[ProductName] = VMware ESX Server
[ProductVersion] = 4.0
[feature] = maxRAM:256g ("Up to 256 GB of memory")
[feature] = vsmp:4 ("Up to 4-way virtual SMP")
[count_disabled] = This license is unlimited
[200] Sending request for installed licenses...[200] Complete, result is:
serial: M0025-*****-*****-*****-0D040
vmodl key: esxBasic
name: ESXi 4 Single Server
total: 0
used: 1
unit: cpuPackage:6core
Properties:
[ProductName] = VMware ESX Server
[ProductVersion] = 4.0
[feature] = maxRAM:256g ("Up to 256 GB of memory")
[feature] = vsmp:4 ("Up to 4-way virtual SMP")
[count_disabled] = This license is unlimited
[200] End of report.
5) I then tried to power on a VM and got this error. So I ran services.sh restart
vim-cmd vmsvc/power.on 96
Powering on VM:
(vim.fault.LicenseExpired) {
dynamicType =,
faultCause = (vmodl.MethodFault) null,
faultMessage = (vmodl.LocalizableMessage) [
(vmodl.LocalizableMessage) {
dynamicType =,
key = "com.vmware.vim.license.error.evalPeriodOver",
arg = (vmodl.KeyAnyValue) [
(vmodl.KeyAnyValue) {
dynamicType =,
key = "info",
value = "notinstalled",
}
],
message = "Evaluation period is over, Please install a license.",
}
],
licenseKey = "M0025-*****-*****-*****-0D040",
msg = "License key has expired."
Powering on VM:
(vim.fault.LicenseExpired) {
dynamicType =
faultCause = (vmodl.MethodFault) null,
faultMessage = (vmodl.LocalizableMessage) [
(vmodl.LocalizableMessage) {
dynamicType =
key = "com.vmware.vim.license.error.evalPeriodOver",
arg = (vmodl.KeyAnyValue) [
(vmodl.KeyAnyValue) {
dynamicType =
key = "info",
value = "notinstalled",
}
],
message = "Evaluation period is over, Please install a license.",
}
],
licenseKey = "M0025-*****-*****-*****-0D040",
msg = "License key has expired."
6) I could then power on the VM. I got an error on the first power on attempt, but things were fine after that.
/etc/vmware # vim-cmd vmsvc/power.on 96
Failed to connect: 514 Error connecting to hostd-vmdb service instance.
/etc/vmware # vim-cmd vmsvc/power.on 96
Powering on VM:
Failed to connect: 514 Error connecting to hostd-vmdb service instance.
/etc/vmware # vim-cmd vmsvc/power.on 96
Powering on VM:
Enabling VM Auto Start and Shutdown Options
The configuration values for VM automatic startup and shutdown is stored in the file /etc/vmware/hostd/vmAutoStart.xml.
1) By default auto start is not enabled and the configuration file will look like this.
<_length>0
<_type>vim.host.AutoStartManager.AutoPowerInfo[]
<_type>vim.host.AutoStartManager.SystemDefaults
2) The first step taken in the VI client is to enable
the option "Allow virtual machines to start and stop automatically with
the system". When you enable this option the file changes as shown
below.
<_length>0
<_type>vim.host.AutoStartManager.AutoPowerInfo[]
<_type>vim.host.AutoStartManager.SystemDefaults
3) To control the shut down options you can change
both stopDelay and stopAction. stopDelay is the time in seconds (120
second by default) that ESXi should wait for each VM to power down. You
can set stopAction to PowerOff, GuestShutdown or Suspend.
4) For VM startup you can also set the startDelay option and also the waitForHeartbeat option.
5) Once VMs are enable for autostart, the
vmAutoStart.xml file will grow much larger. The below file shows 4 VMs
enabled for auto start. Two VMs have been specified to start first and
second, and the other two can start in any order. There are a number of
things to note.
a) The section has been added above the SystemDefaults section.
b) The length parameter should equal the number of VMs enable for auto startup (four in this case).
c) Each VM is referenced by the VM ID. You can get this with the command vim-cmd vmsvc/getallvms.
d) VM ID 144 is set to start first. You can see the startOrder value set to 1. VM ID 128 is set to start second and has a value of 2. The other 2 VMs have a value of -1 which means that they can be started in anyorder.
e) For all the VMs but VM ID 144, they are set to use the system setting for startup and shutdown. Thus startDelay and stopDelay are set to -1 and likewise stopAction and waitForHeartBeat are set to systemDefault. VM ID 144 has custom values for those 4 settings.
a) The section
b) The length parameter should equal the number of VMs enable for auto startup (four in this case).
c) Each VM is referenced by the VM ID. You can get this with the command vim-cmd vmsvc/getallvms.
d) VM ID 144 is set to start first. You can see the startOrder value set to 1. VM ID 128 is set to start second and has a value of 2. The other 2 VMs have a value of -1 which means that they can be started in anyorder.
e) For all the VMs but VM ID 144, they are set to use the system setting for startup and shutdown. Thus startDelay and stopDelay are set to -1 and likewise stopAction and waitForHeartBeat are set to systemDefault. VM ID 144 has custom values for those 4 settings.
<_length>4
<_type>vim.host.AutoStartManager.AutoPowerInfo[]
<_type>vim.host.AutoStartManager.AutoPowerInfo
<_type>vim.VirtualMachine
<_type>vim.host.AutoStartManager.AutoPowerInfo
<_type>vim.VirtualMachine
<_type>vim.host.AutoStartManager.AutoPowerInfo
<_type>vim.VirtualMachine
<_type>vim.host.AutoStartManager.AutoPowerInfo
<_type>vim.VirtualMachine
<_type>vim.host.AutoStartManager.SystemDefaults
6) The file was saved after make the below changes and the server was rebooted to test things out.
Unregistering a VM
I had one VM that I was pretty much done using, but
wasn't quick ready to delete. As it was a domain controller I wanted to
ensure that it wasn't accidentally started so I wanted to unregister it.
1) I used vim-cmd vmsvc/getallvms to get the VM ID for the virtual machine.
2) I then ran vim-cmd vmsvc/unregister VMID to remove
it. The VM was no longer listed in the output of getallvms, but the
virtual hard drive and VMX file were still in the datastore should I
need to access the VM in the future. Otherwise I would have deleted the
folder for the VM and it would gone.
Thanks
for the tip about adding the license. I actually ran into the exact
same scenario and since I had a couple mildly important VMs I needed to
boot I just cheated and used the client to add the license and boot
them. Great to know there is a command line workaround, I was actually
going to ask the question in the forum but I found this post first.
No comments:
Post a Comment
Thank You for your Comments, We will read and response you soon...