'Returns a connection to the hypervisor
This method should be used to create and return a well
configured connection to the hypervisor.
:returns: a libvirt.virConnect object'

def get_connection(self):

    try:
        conn = self._get_connection()
    except libvirt.libvirtError as ex:
        LOG.exception(_('Connection    to    libvirt    failed:    %s'), ex)
        payload = dict(ip=CONF.my_ip, method='_connect', reason=ex)
        rpc.get_notifier('compute').error(nova_context.get_admin_context(), 'compute.libvirt.error', payload)
        raise exception.HypervisorUnavailable(host=CONF.host)
    return conn
