<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pause(self, instance_id, keep_provisioned=True):
 """shuts down the instance without destroying it. The AbstractCloudProvider class uses 'stop' to refer to destroying a VM, so use 'pause' to mean powering it down while leaving it allocated. :param str instance_id: instance identifier :return: None """

        try:
            if self._paused:
                log.debug("node %s is already paused", instance_id)
                return
            self._paused = True
            post_shutdown_action = 'Stopped' if keep_provisioned else \
                'StoppedDeallocated'
            result = self._subscription._sms.shutdown_role(
                service_name=self._cloud_service._name,
                deployment_name=self._cloud_service._name,
                role_name=self._qualified_name,
                post_shutdown_action=post_shutdown_action)
            self._subscription._wait_result(result)
        except Exception as exc:
            log.error("error pausing instance %s: %s", instance_id, exc)
            raise
        log.debug('paused instance(instance_id=%s)', instance_id)