'Start an instance.'

@wsgi.response(202)
@extensions.expected_errors((404, 409))
@wsgi.action('os-start')
def _start_server(self, req, id, body):

    context = req.environ['nova.context']
    instance = self._get_instance(context, id)
    context.can((server_policies.SERVERS % 'start'), instance)
    try:
        self.compute_api.start(context, instance)
    except (exception.InstanceNotReady, exception.InstanceIsLocked) as e:
        raise webob.exc.HTTPConflict(explanation=e.format_message())
    except exception.InstanceUnknownCell as e:
        raise exc.HTTPNotFound(explanation=e.format_message())
    except exception.InstanceInvalidState as state_error:
        common.raise_http_conflict_for_instance_invalid_state(state_error, 'start', id)
