'Create a test volume.'

def _create_volume(self, size=1):

    vol = {}
    vol['user_id'] = self.user_id
    vol['project_id'] = self.project_id
    vol['size'] = size
    vol['status'] = 'available'
    vol['volume_type_id'] = self.volume_type['id']
    vol['host'] = 'fake_host'
    vol['availability_zone'] = 'fake_zone'
    vol['attach_status'] = fields.VolumeAttachStatus.DETACHED
    volume = objects.Volume(context=self.context, **vol)
    volume.create()
    return volume
