'Restart the CCI instance.'

@horcmgr_synchronized
def _restart_horcmgr(self, horcmgr):

    inst = self.conf.vsp_horcm_numbers[horcmgr]
    def _wait_for_horcm_shutdown(start_time, inst):
        'Stop    the    CCI    instance    and    raise    True    if    it    stops.'
        if (_run_horcmgr(inst) != _HORCM_RUNNING):
            raise loopingcall.LoopingCallDone()
        if ((_run_horcmshutdown(inst) and (_run_horcmgr(inst) == _HORCM_RUNNING)) or utils.check_timeout(start_time, utils.DEFAULT_PROCESS_WAITTIME)):
            raise loopingcall.LoopingCallDone(False)
    loop = loopingcall.FixedIntervalLoopingCall(_wait_for_horcm_shutdown, timeutils.utcnow(), inst)
    if (not loop.start(interval=_HORCM_WAITTIME).wait()):
        msg = utils.output_log(MSG.HORCM_SHUTDOWN_FAILED, inst=self.conf.vsp_horcm_numbers[horcmgr])
        raise exception.VSPError(msg)
    ret = _run_horcmstart(inst)
    if (ret and (ret != _HORCM_RUNNING)):
        msg = utils.output_log(MSG.HORCM_RESTART_FAILED, inst=self.conf.vsp_horcm_numbers[horcmgr])
        raise exception.VSPError(msg)
