<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Best Practices for Automating EC2 Instance Shutdowns in AWS in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Best-Practices-for-Automating-EC2-Instance-Shutdowns-in-AWS/m-p/934404#M28682</link>
    <description>&lt;P&gt;You could look at using SAS_lsm to manage gracefully shutting down the SAS 9 services in the correct order.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/sassoftware/SAS-lsm/tree/master" target="_blank" rel="noopener"&gt;https://github.com/sassoftware/SAS-lsm/tree/master&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Viya 3.x, there is viya-ark to do this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sassoftware/viya-ark" target="_blank"&gt;https://github.com/sassoftware/viya-ark&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Viya 4, there is a supplied cronjob to stop Viya.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I'm on Azure and not AWS, but I use a scheduled script that runs a graceful stop of SAS services (like SAS_lsm on SAS 9 and viya-ark on Viya) and then stops and deallocates the VMs using the CLI (or in the case of Kuberentes, stops the cluster).&lt;BR /&gt;&lt;BR /&gt;I expect that VM shutdown is graceful and not like pulling the power cord, though AWS support may be able to provide more detail on that functionality.&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 14:23:19 GMT</pubDate>
    <dc:creator>gwootton</dc:creator>
    <dc:date>2024-07-02T14:23:19Z</dc:date>
    <item>
      <title>Best Practices for Automating EC2 Instance Shutdowns in AWS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Best-Practices-for-Automating-EC2-Instance-Shutdowns-in-AWS/m-p/932991#M28653</link>
      <description>&lt;P&gt;Hello SAS Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are in the process of moving some services to the AWS cloud and have around 8 SAS instances running. Our goal is to create an automation script to shut these instances down during off-hours to save costs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="orbar_0-1718803506318.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97629iFA25AE3852ACA6C8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="orbar_0-1718803506318.png" alt="orbar_0-1718803506318.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are a few specific questions we have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;STRONG&gt;Shutdown Mechanism:&lt;/STRONG&gt; When shutting down an EC2 instance using AWS commands, does it perform a graceful shutdown similar to a normal OS shutdown, or is it more like pulling the power cord?&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Shutdown Order:&lt;/STRONG&gt; Is there a best practice for the order in which to shut down and start up instances? For example, should databases be shut down last and started first?&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Automation Tools:&lt;/STRONG&gt; What are the recommended tools or methods for automating this process? We've looked into AWS Lambda and AWS Systems Manager but would appreciate guidance or examples.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Handling Dependencies:&lt;/STRONG&gt; How do we ensure that dependent services are shut down in the correct order to prevent issues?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Here is what we are currently considering:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Using AWS Lambda triggered by CloudWatch Events to stop instances.&lt;/LI&gt;&lt;LI&gt;Ensuring that our shutdown sequence handles dependencies correctly (e.g., web servers -&amp;gt; application servers -&amp;gt; databases).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insights, best practices, or sample scripts would be greatly appreciated!&lt;/P&gt;&lt;P&gt;Thanks in advance for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 13:29:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Best-Practices-for-Automating-EC2-Instance-Shutdowns-in-AWS/m-p/932991#M28653</guid>
      <dc:creator>orbar</dc:creator>
      <dc:date>2024-06-19T13:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practices for Automating EC2 Instance Shutdowns in AWS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Best-Practices-for-Automating-EC2-Instance-Shutdowns-in-AWS/m-p/934373#M28679</link>
      <description>&lt;P&gt;Any idea anyone?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 09:14:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Best-Practices-for-Automating-EC2-Instance-Shutdowns-in-AWS/m-p/934373#M28679</guid>
      <dc:creator>orbar</dc:creator>
      <dc:date>2024-07-02T09:14:41Z</dc:date>
    </item>
    <item>
      <title>Re: Best Practices for Automating EC2 Instance Shutdowns in AWS</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Best-Practices-for-Automating-EC2-Instance-Shutdowns-in-AWS/m-p/934404#M28682</link>
      <description>&lt;P&gt;You could look at using SAS_lsm to manage gracefully shutting down the SAS 9 services in the correct order.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://github.com/sassoftware/SAS-lsm/tree/master" target="_blank" rel="noopener"&gt;https://github.com/sassoftware/SAS-lsm/tree/master&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Viya 3.x, there is viya-ark to do this:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/sassoftware/viya-ark" target="_blank"&gt;https://github.com/sassoftware/viya-ark&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Viya 4, there is a supplied cronjob to stop Viya.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I'm on Azure and not AWS, but I use a scheduled script that runs a graceful stop of SAS services (like SAS_lsm on SAS 9 and viya-ark on Viya) and then stops and deallocates the VMs using the CLI (or in the case of Kuberentes, stops the cluster).&lt;BR /&gt;&lt;BR /&gt;I expect that VM shutdown is graceful and not like pulling the power cord, though AWS support may be able to provide more detail on that functionality.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 14:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Best-Practices-for-Automating-EC2-Instance-Shutdowns-in-AWS/m-p/934404#M28682</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2024-07-02T14:23:19Z</dc:date>
    </item>
  </channel>
</rss>

