To register a virtual machine from a command line on an ESXi host:
Log in as root to the ESXi host with an SSH client. For information on using Tech Support mode, see Using Tech Support Mode in ESXi 4.1 (1017910).
Run the command:
# vim-cmd solo/registervm /vmfs/volumes/datastore_name/VM_directory/VM_name.vmx
#vim-cmd vmsvc/power.getstate VMID
#vim-cmd vmsvc/power.off VMID