avoid error if domain has no template

Templates are optional for domains in cloubed YAML file. This patch should
avoid error to raise when a domain has no template.
enable autoport for spice

If graphics for a Domain is spice, autoport allocation for spice server is now
enable. The TCP ports are allocated sequentially starting from 5900.