restapi : Creating template by specifing vm name, does not work (#915285)

Creating template by specifing vm name, does not work,
works only when vm id is specified.

This patch lets the user create a template from a VM
by specifying the vm name.

Change-Id: Ibe6ff6059c22a853c76a0720e5c9e330f600712b
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=915285
Signed-off-by: Ravi Nori <rnori@redhat.com>