def fake_instance_create(context, values):
    'Stubs out the db.instance_create method.'
    type_data = INSTANCE_TYPES[values['instance_type']]
    base_options = {'name': values['name'], 'id': values['id'], 'uuid': utils.gen_uuid(), 'reservation_id': utils.generate_uid('r'), 'image_ref': values['image_ref'], 'kernel_id': values['kernel_id'], 'ramdisk_id': values['ramdisk_id'], 'vm_state': vm_states.BUILDING, 'task_state': task_states.SCHEDULING, 'user_id': values['user_id'], 'project_id': values['project_id'], 'launch_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()), 'instance_type': values['instance_type'], 'memory_mb': type_data['memory_mb'], 'vcpus': type_data['vcpus'], 'mac_addresses': [{'address': values['mac_address']}], 'root_gb': type_data['root_gb']}
    return FakeModel(base_options)
Stubs out the db.instance_create method.
def fake_instance_create(context, values):
    
    type_data = INSTANCE_TYPES[values['instance_type']]
    base_options = {'name': values['name'], 'id': values['id'], 'uuid': utils.gen_uuid(), 'reservation_id': utils.generate_uid('r'), 'image_ref': values['image_ref'], 'kernel_id': values['kernel_id'], 'ramdisk_id': values['ramdisk_id'], 'vm_state': vm_states.BUILDING, 'task_state': task_states.SCHEDULING, 'user_id': values['user_id'], 'project_id': values['project_id'], 'launch_time': time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime()), 'instance_type': values['instance_type'], 'memory_mb': type_data['memory_mb'], 'vcpus': type_data['vcpus'], 'mac_addresses': [{'address': values['mac_address']}], 'root_gb': type_data['root_gb']}
    return FakeModel(base_options)