@classmethod
def from_hostname(cls, hostname):
    """Retrieve virtual machine id associated to a hostname."""
    result = cls.list({'hostname': str(hostname)})
    if result:
        return result[0]['id']
