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