Hi Devta,
To list all the VMs on the host you are interested in, you don't have to get the rootFolder of the host. Once have the HostSystem object, you can get its vm property for all the virtual machines running on the host. If you use open source vijava api (http://vijava.sf.net), you just one line:
VirtualMachine[] vms = host.getVms();
Good luck!
Steve Jin, author of VMware VI and vSphere SDK, http://www.doublecloud.org
Steve JIN
Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org