dell_storagecenter_driver/dell_storagecenter_api.py
def map_volume(self, scvolume, scserver):
        """Maps the Dell backend volume object to the Dell server object.

        The check for the Dell server object existence is elsewhere;  does not
        create the Dell server object.

        :param scvolume: Storage Center volume object.
        :param scserver: Storage Center server opbject.
        :returns: SC mapping profile or None
        """
        # Make sure we have what we think we have
        serverid = self._get_id(scserver)
        volumeid = self._get_id(scvolume)
        if serverid is not None and volumeid is not None:
            # If we have a mapping to our server return it here.
            mprofiles = self.find_mapping_profiles(scvolume)
            for mprofile in mprofiles:
                if self._get_id(mprofile.get('server')) == serverid:
                    return mprofile
            # No?  Then map it up.
            payload = {}
            payload['server'] = serverid
            advanced = {}
            advanced['MapToDownServerHbas'] = True
            advanced['BootVolume'] = False
            advanced['NoPreferredUseNextAvailable'] = True
            advanced['UseNextAvailable'] = True
            payload['Advanced'] = advanced
            r = self.client.post('StorageCenter/ScVolume/%s/MapToServer'
                                 % volumeid,
                                 payload)
            if self._check_result(r):
                # We just return our mapping
                return self._first_result(r)
        # Error out
        LOG.error('Unable to map %(vol)s to %(srv)s',
                  {'vol': scvolume['name'],
                   'srv': scserver['name']})
        return None
Maps the Dell backend volume object to the Dell server object.

        The check for the Dell server object existence is elsewhere;  does not
        create the Dell server object.

        :param scvolume: Storage Center volume object.
        :param scserver: Storage Center server opbject.
        :returns: SC mapping profile or None
        
Maps the Dell backend volume object to the Dell server object.
The check for the Dell server object existence is elsewhere;  does not
create the Dell server object.
Maps the Dell backend volume object to the Dell server object . The check for the Dell server object existence is elsewhere ; does not create the Dell server object .
def map_volume(self, scvolume, scserver):
        serverid = self._get_id(scserver)
        volumeid = self._get_id(scvolume)
        if serverid is not None and volumeid is not None:
            mprofiles = self.find_mapping_profiles(scvolume)
            for mprofile in mprofiles:
                if self._get_id(mprofile.get('server')) == serverid:
                    return mprofile
            payload = {}
            payload['server'] = serverid
            advanced = {}
            advanced['MapToDownServerHbas'] = True
            advanced['BootVolume'] = False
            advanced['NoPreferredUseNextAvailable'] = True
            advanced['UseNextAvailable'] = True
            payload['Advanced'] = advanced
            r = self.client.post('StorageCenter/ScVolume/%s/MapToServer'
                                 % volumeid,
                                 payload)
            if self._check_result(r):
                return self._first_result(r)
        LOG.error('Unable to map %(vol)s to %(srv)s',
                  {'vol': scvolume['name'],
                   'srv': scserver['name']})
        return None
def map_volume ( self , scvolume , scserver ) : serverid = self . _get_id ( scserver ) volumeid = self . _get_id ( scvolume ) if serverid is not None and volumeid is not None : mprofiles = self . find_mapping_profiles ( scvolume ) for mprofile in mprofiles : if self . _get_id ( mprofile . get ( 'server' ) ) == serverid : return mprofile payload = { } payload [ 'server' ] = serverid advanced = { } advanced [ 'MapToDownServerHbas' ] = True advanced [ 'BootVolume' ] = False advanced [ 'NoPreferredUseNextAvailable' ] = True advanced [ 'UseNextAvailable' ] = True payload [ 'Advanced' ] = advanced r = self . client . post ( 'StorageCenter/ScVolume/%s/MapToServer' % volumeid , payload ) if self . _check_result ( r ) : return self . _first_result ( r ) LOG . error ( 'Unable to map %(vol)s to %(srv)s' , { 'vol' : scvolume [ 'name' ] , 'srv' : scserver [ 'name' ] } ) return None
Maps the Dell backend volume object to the Dell server object.
Maps the Dell backend volume object to the Dell server object .
"""Maps the Dell backend volume object to the Dell server object.

        The check for the Dell server object existence is elsewhere;  does not
        create the Dell server object.

        :param scvolume: Storage Center volume object.
        :param scserver: Storage Center server opbject.
        :returns: SC mapping profile or None
        """ # Make sure we have what we think we have # If we have a mapping to our server return it here. # No?  Then map it up. # We just return our mapping # Error out
SC mapping profile or None
SC mapping profile or None
self
scvolume
Storage Center volume object.
Storage Center volume object .
scserver
Storage Center server opbject.
Storage Center server opbject .