'Create a test instance.'

def _create_instance(self, flavor_name='m1.large'):

    inst = objects.Instance(context=self.context)
    inst.image_id = 'cedef40a-ed67-4d10-800e-17455edce175'
    inst.reservation_id = 'r-fakeres'
    inst.user_id = self.user_id
    inst.project_id = self.project_id
    inst.flavor = flavors.get_flavor_by_name(flavor_name)
    inst.vcpus = inst.flavor.vcpus
    inst.memory_mb = inst.flavor.memory_mb
    inst.create()
    return inst
