def get_datastore_for_server(server):
    """
    Given a server, return its datastore based on its first disk.
    """
    root_disk = server.disks.first()
    if root_disk:
        return root_disk.cast().datastore

    return None