'Ensure the bdms are valid, then set size and associate with instance
Because this method can be called multiple times when more than one
instance is booted in a single request it makes a copy of the bdm list.'

def _bdm_validate_set_size_and_instance(self, context, instance, instance_type, block_device_mapping):

    LOG.debug('block_device_mapping    %s', list(block_device_mapping), instance_uuid=instance.uuid)
    self._validate_bdm(context, instance, instance_type, block_device_mapping)
    instance_block_device_mapping = block_device_mapping.obj_clone()
    for bdm in instance_block_device_mapping:
        bdm.volume_size = self._volume_size(instance_type, bdm)
        bdm.instance_uuid = instance.uuid
    return instance_block_device_mapping
