def get_shortname(machine_type, index):
    """
    Given a number, return a hostname. Example:
        get_shortname('magna', 3) = 'magna003'

    Modify to suit your needs.
    """
    return machine_type + str(index).rjust(3, '0')