'Set the VMAX extra specs.
The pool_name extra spec must be set, otherwise a default slo/workload
will be chosen. The portgroup can either be passed as an extra spec
on the volume type (e.g. \'storagetype:portgroupname = os-pg1-pg\'), or
can be chosen from a list provided in the xml file, e.g.:
<PortGroups>
<PortGroup>OS-PORTGROUP1-PG</PortGroup>
<PortGroup>OS-PORTGROUP2-PG</PortGroup>
</PortGroups>.
:param extra_specs: extra specifications
:param pool_record: pool record
:returns: dict -- the extra specifications dictionary'

def _set_vmax_extra_specs(self, extra_specs, pool_record):

    extra_specs[utils.SRP] = pool_record['srpName']
    extra_specs[utils.ARRAY] = pool_record['SerialNumber']
    if (not extra_specs.get(utils.PORTGROUPNAME)):
        extra_specs[utils.PORTGROUPNAME] = pool_record['PortGroup']
    if (not extra_specs[utils.PORTGROUPNAME]):
        error_message = _("Port    group    name    has    not    been    provided    -    please    configure    the    'storagetype:portgroupname'    extra    spec    on    the    volume    type,    or    enter    a    list    of    portgroups    to    the    xml    file    associated    with    this    backend    e.g.<PortGroups>                <PortGroup>OS-PORTGROUP1-PG</PortGroup>                <PortGroup>OS-PORTGROUP2-PG</PortGroup></PortGroups>.")
        LOG.exception(error_message)
        raise exception.VolumeBackendAPIException(data=error_message)
    extra_specs[utils.INTERVAL] = self.interval
    LOG.debug('The    interval    is    set    at:    %(intervalInSecs)s.', {'intervalInSecs': self.interval})
    extra_specs[utils.RETRIES] = self.retries
    LOG.debug('Retries    are    set    at:    %(retries)s.', {'retries': self.retries})
    if ('pool_name' in extra_specs):
        pool_name = extra_specs['pool_name']
        pool_details = pool_name.split('+')
        slo_from_extra_spec = pool_details[0]
        workload_from_extra_spec = pool_details[1]
        if (workload_from_extra_spec == pool_record['srpName']):
            workload_from_extra_spec = 'NONE'
    elif pool_record.get('ServiceLevel'):
        slo_from_extra_spec = pool_record['ServiceLevel']
        workload_from_extra_spec = pool_record.get('Workload', 'None')
        LOG.info('Pool_name    is    not    present    in    the    extra_specs    -    using    slo/    workload    from    xml    file:    %(slo)s/%(wl)s.', {'slo': slo_from_extra_spec, 'wl': workload_from_extra_spec})
    else:
        slo_list = self.rest.get_slo_list(pool_record['SerialNumber'])
        if ('Optimized' in slo_list):
            slo_from_extra_spec = 'Optimized'
        elif ('Diamond' in slo_list):
            slo_from_extra_spec = 'Diamond'
        else:
            slo_from_extra_spec = 'None'
        workload_from_extra_spec = 'NONE'
        LOG.warning('Pool_name    is    not    present    in    the    extra_specsand    no    slo/    workload    information    is    present    in    the    xml    file    -    using    default    slo/    workload    combination:    %(slo)s/%(wl)s.', {'slo': slo_from_extra_spec, 'wl': workload_from_extra_spec})
    if (workload_from_extra_spec.lower() == 'none'):
        workload_from_extra_spec = 'NONE'
    if (slo_from_extra_spec.lower() == 'none'):
        slo_from_extra_spec = None
    extra_specs[utils.SLO] = slo_from_extra_spec
    extra_specs[utils.WORKLOAD] = workload_from_extra_spec
    if self.rest.is_compression_capable(extra_specs[utils.ARRAY]):
        if extra_specs.get(utils.DISABLECOMPRESSION):
            if (not strutils.bool_from_string(extra_specs[utils.DISABLECOMPRESSION])):
                extra_specs.pop(utils.DISABLECOMPRESSION, None)
    else:
        extra_specs.pop(utils.DISABLECOMPRESSION, None)
    LOG.debug('SRP    is:    %(srp)s,    Array    is:    %(array)s    SLO    is:    %(slo)s,    Workload    is:    %(workload)s.', {'srp': extra_specs[utils.SRP], 'array': extra_specs[utils.ARRAY], 'slo': extra_specs[utils.SLO], 'workload': extra_specs[utils.WORKLOAD]})
    return extra_specs
