'Test that a BadRequest is raised if multiple instances
are requested to boot from a single volume.'

def test_create_multiple_instances_with_single_volume_bdm(self):

    min_count = 2
    bdm = [{'source_type': 'volume', 'uuid': 'vol-xxxx'}]
    params = {block_device_mapping_v21.ATTRIBUTE_NAME: bdm, multiple_create_v21.MIN_ATTRIBUTE_NAME: min_count}
    old_create = compute_api.API.create
    def create(*args, **kwargs):
        self.assertEqual(kwargs['min_count'], 2)
        self.assertEqual(kwargs['block_device_mapping'][0]['volume_id'], 'vol-xxxx')
        return old_create(*args, **kwargs)
    self.stub_out('nova.compute.api.API.create', create)
    exc = self.assertRaises(webob.exc.HTTPBadRequest, self._test_create_extra, params, no_image=True)
    self.assertEqual('Cannot    attach    one    or    more    volumes    to    multiple    instances', exc.explanation)
