Sunday, February 22, 2009

.vmx file not stored on a NAS or VMFS

This is kind-of a test post and also something I've tripped on a couple times.

After creating new datastores and registering some VMs, you attempt power one on, and get:
Attempt to power on a virtual machine with the .vmx file not stored on a NAS or VMFS version 3 datastore. The virtual machine files must be relocated or VMFS upgraded.

In my situation, NFS datastores were added via ESX CLI (esxcfg-nas), but this could also happen when VMFS are added by rescanning via CLI (esxcfg-rescan) or created by vmkfstools. Then VMs were created/registered in the new datastore by CLI or script that calls vmware-cmd.

The VMs will appear in the VI Client without any special action to refresh. The problem is they live on a datastore that vCenter doesn't yet know about.

To fix it, refresh storage in VC either by clicking the server --> Configuration --> Storage --> Refresh or in the CLI with
[root@esx5 root]# vmware-vim-cmd internalsvc/refresh_datastores

Refresh is a little less harsh than restarting the management service. You'll need to refresh all the ESX servers, although sometimes, when VC finds a new datastore on one server, it checks the rest and discovers it on all of them.

Related posts
http://communities.vmware.com/thread/83202;jsessionid=1CAD7C5CF977682FAF78DEBAEF75F34C?tstart=60
http://communities.vmware.com/message/876520;jsessionid=4F546B51E2081127B947133B2B2F723D

1 comments:

  1. Thanks mate !! This was amazingly helpful for us.
    We have a large number of LUNs and NFS mappings presented to our ESX hosts . Running a rescan everytime we added a datastore took ages , and we were forced to do it because of that error.

    The refresh datastore command solved the problem for us.

    ReplyDelete