"Installed windows 2003 in ESXi5-1 in shared storage and when I restart ESXi5-1 the VM did not move to ESXi5-2."
HA will not trigger if you restart the ESXi host (VM in your case), HA will trigger if you "Power off" the ESXi VM or if you unplug the NW cable. When you restart a ESXi host, host will intimate the other host in the cluster that "I am going down and do not restart my VMs"
Note: HA will not migrate the VM. It will restart the virtual machines. again you cannot get a exact result from a "nested" ESXi