'Tests the retry operation between compute nodes when one fails.
This tests the scenario that we have two compute services and we
try to build a single server. The test is setup such that the
scheduler picks the first host which we mock out to fail the claim.
This should then trigger a retry to the second host.'

def test_retry_build_on_compute_error(self):

    server = dict(name='retry-test', imageRef=self.image_id, flavorRef=self.flavor_id)
    server = self.admin_api.post_server({'server': server})
    self.addCleanup(self.admin_api.delete_server, server['id'])
    server = self._wait_for_instance_status(server['id'], 'ACTIVE')
    self.assertNotEqual(self.failed_host, server['OS-EXT-SRV-ATTR:host'])
    self.assertEqual(2, self.attempts)
