def _connect_cinder_volumes(self, instance, block_device_info):
        """Attach all the cinder volumes described in block_device_info."""
        vdis = {}

        if block_device_info:
            msg = "block device info: %s" % block_device_info
            # NOTE(mriedem): block_device_info can contain an auth_password
            # so we have to scrub the message before logging it.
            LOG.debug(strutils.mask_password(msg), instance=instance)
            root_device_name = block_device_info['root_device_name']

            for bdm in block_device_info['block_device_mapping']:
                if (block_device.strip_prefix(bdm['mount_device']) ==
                        block_device.strip_prefix(root_device_name)):
                    # If we're a root-device, record that fact so we don't
                    # download a root image via Glance
                    type_ = 'root'
                else:
                    # Otherwise, use mount_device as `type_` so that we have
                    # easy access to it in _attach_disks to create the VBD
                    type_ = bdm['mount_device']

                conn_info = bdm['connection_info']
                _sr, vdi_uuid = self._volumeops.connect_volume(conn_info)
                if vdi_uuid:
                    vdis[type_] = dict(uuid=vdi_uuid, file=None, osvol=True)

        return vdis
dataset/ETHPy150Open openstack/nova/nova/virt/xenapi/vmops.py/VMOps._connect_cinder_volumes/original