'Create a unique short host name under 16 characters.
:param host_name: long host name
:returns: truncated host name'

def generate_unique_trunc_host(self, host_name):

    if (host_name and (len(host_name) > 16)):
        host_name = host_name.lower()
        m = hashlib.md5()
        m.update(host_name.encode('utf-8'))
        uuid = m.hexdigest()
        new_name = ('%(host)s%(uuid)s' % {'host': host_name[(-6):], 'uuid': uuid})
        host_name = self.truncate_string(new_name, 16)
    return host_name
