def get_size_opt(size):
    """
    Generate size option for LVM utitlites 1024|512GiB|50%|100%
    :param str size: size of volume
    :returns: options string
    :rtype: str
    """
    if size is None:
        return '--extents=100%FREE'
    elif size[-1:] == '%':
        return '--extents={}FREE'.format(size)
    else:
        return '--size={}'.format(size)