Ans.) If the virtual machine is running in a cluster of esx hosts, sometimes it won’t power on. Why because, the files that are associated with that VM are locked by the host at the time of running. So when you try to VMotion the vm from one host to another host, the first host releases those files and again locked by the second host.
So what is meant by locking here, and why it is happening?
Locking is nothing but, the registration of a vm with a host. This happens every time when the vm is hosted on a host. This is helpful to prevent the access to the same vm for remaining hosts in the cluster.
Why the vm fails when trying to power it on?
When the files associated with that VM are locked by a host it won’t powered on. At that time, you must unregister the vm from the host using vmware-cmd utility.
I have found the above on http://www2.isupportyou.net/2010/06/vmware-interview-questions-tips.html
I have a query on the above answer. (Italic marked) During VMotion the files are not moved from one host to another right? as we use a shared storage.
Can someone please tell, is the above answer right? If not, please share the right one?
Thanks,
Prashant
The files of a VM are locked by the ESXi host when it is powered on - vmotion should not have any affect on the locks on teh file all that will get changed is the ESXi host that holds those locks -
And if a VM can not power on because a file is locked the error message will contain that information - the most common reason for this error is someone has created another machine at one point and is using the VMDK file for it and when you tgry to power on the original VM the locked error message will appear -
In my experience the most common reasons why a VM cannot power on include:
The files of a VM are locked by the ESXi host when it is powered on - vmotion should not have any affect on the locks on teh file all that will get changed is the ESXi host that holds those locks -
And if a VM can not power on because a file is locked the error message will contain that information - the most common reason for this error is someone has created another machine at one point and is using the VMDK file for it and when you tgry to power on the original VM the locked error message will appear -
In my experience the most common reasons why a VM cannot power on include:
Thanks Einstein.
-Prashant
The lock is there on the important files of VM to avoid any concurrent changes from the ESX hosts. There could be the case when the VM moved from one host to another but the lock on the VM files could still be maintained by the previous host due to some reason.You can indentfy the host who holds the lock by its Mac address,and this lock must be released by the owning host.
I've seen that link referenced a number of times here and I should point out..
It's specific to ESX 4.0, and any business worth its salt would have moved or be moving away from that environment by now.
I couldn't imagine any of those questions being asked during a job interview.
