<?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>chris_dd Tracker</title>
    <link>https://communities.vmware.com/wbsdv95928/tracker</link>
    <description>chris_dd Tracker</description>
    <pubDate>Wed, 15 Nov 2023 07:44:08 GMT</pubDate>
    <dc:date>2023-11-15T07:44:08Z</dc:date>
    <item>
      <title>Re: SRM Recovery Plan Scripting</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/SRM-Recovery-Plan-Scripting/m-p/2937298#M1426</link>
      <description>&lt;P&gt;Hello Arnon,&lt;/P&gt;&lt;P&gt;Yes we were able to resolve the issue with a hint from VMware:&lt;/P&gt;&lt;P&gt;"The fix was to start an ssh session via the srm directory structure to add the Windows Server fingerprint to the &lt;STRONG&gt;known_hosts &lt;/STRONG&gt;file. We had previously added the ssh key to the id_rsa file however, we hadn’t updated &lt;STRONG&gt;known_hosts"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Its been working wonderfully ever since.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 14:55:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/SRM-Recovery-Plan-Scripting/m-p/2937298#M1426</guid>
      <dc:creator>chris_dd</dc:creator>
      <dc:date>2022-11-08T14:55:25Z</dc:date>
    </item>
    <item>
      <title>SRM Recovery Plan Scripting</title>
      <link>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/SRM-Recovery-Plan-Scripting/m-p/2925829#M1424</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;We have a PowerShell script that we use to configure virtual machines post SRM recovery. The SRM recovery plan is configured to execute a Command step type of "Command on SRM Server". The syntax is configured as such:&amp;nbsp;&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;/bin/sh /home/admin/1_SRM_DisjoinAD.sh&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;The above permissions were changed as required per doc:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.vmware.com/en/Site-Recovery-Manager/8.5/com.vmware.srm.admin.doc/GUID-4F084B4F-DE9C-4A76-8AD2-19F4A76E81A3.html" target="_blank"&gt;https://docs.vmware.com/en/Site-Recovery-Manager/8.5/com.vmware.srm.admin.doc/GUID-4F084B4F-DE9C-4A76-8AD2-19F4A76E81A3.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;When the recovery plan executes and the command step is instantiated, error message in the recovery plan is thrown:&lt;/P&gt;&lt;P&gt;"&lt;EM&gt;Command: EXECUTE DisjoinAD Script Warning - The command '/bin/sh' returned a non-zero value: 255&lt;/EM&gt;"&lt;/P&gt;&lt;P&gt;We have opened a ticket with VMware for a support request but were directed here for assistance. To provide more detail into the issue, we have two scripts located in the&amp;nbsp;/home/admin/ on the SRM appliance that are called from the recovery plan. If we execute the script directly from the SRM appliance command line it executes the script without issue. The script calls a PowerShell script located on a Windows Server that executes the real&amp;nbsp;&lt;STRONG&gt;DisjoinAD&lt;/STRONG&gt; Script. Again, if we execute the&amp;nbsp;&lt;EM&gt;/home/admin/1_SRM_DisjoinAD.sh&amp;nbsp;&lt;/EM&gt;from the SRM appliance itself it works.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;/home/admin/1_SRM_DisjoinAD.sh &lt;/EM&gt;contents are as follows based on the SRM scripting guidelines:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;clear&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;echo "$(date "+%Y-%m-%d %H:%M:%S") : Recovery Plan $VMware_RecoveryName ran in $VMware_RecoveryMode mode"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;# some more custom actions&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ssh dr_restoreaccount@adminscriptvm.ourdomain.com "PowerShell.exe D:\SRM_Scripts\Trial-Error\1_SRM_DisjoinAD.ps1 -RPname RP_SRM_Test_VMs"&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;SSH is enabled and working on the Windows Server&lt;/LI&gt;&lt;LI&gt;SSH connectivity works from the SRM appliance to the Windows Server&lt;/LI&gt;&lt;LI&gt;Logins from the SRM appliance are verified in the Windows Event logs from account&amp;nbsp;&lt;STRONG&gt;&lt;A href="mailto:dr_restoreaccount@adminscriptvm.ourdomain.com" target="_blank"&gt;dr_restoreaccount@adminscriptvm.ourdomain.com&lt;/A&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;When executing the above script from the SRM recovery plan, the aforementioned error message is received:&amp;nbsp;"&lt;EM&gt;Command: EXECUTE DisjoinAD Script Warning - The command '/bin/sh' returned a non-zero value: 255&lt;/EM&gt;"&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;It appears that when executing the SRM command recovery step the SSH session doesn't work as no login events are registered on the Windows server. An&amp;nbsp;&lt;EM&gt;.ssh&amp;nbsp;&lt;/EM&gt;folder was created on the SRM appliance in the&amp;nbsp;&lt;STRONG&gt;srm&amp;nbsp;&lt;/STRONG&gt;user directory with the SSH key for the&amp;nbsp;&lt;STRONG&gt;&lt;A href="mailto:dr_restoreaccount@adminscriptvm.ourdomain.com" target="_blank"&gt;dr_restoreaccount@adminscriptvm.ourdomain.com&amp;nbsp;&lt;/A&gt;&lt;/STRONG&gt;but, that does not appear to help.&lt;/P&gt;&lt;P&gt;Any insight or help in this matter would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Aug 2022 14:55:34 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/vSphere-Command-Line-Interface/SRM-Recovery-Plan-Scripting/m-p/2925829#M1424</guid>
      <dc:creator>chris_dd</dc:creator>
      <dc:date>2022-08-25T14:55:34Z</dc:date>
    </item>
  </channel>
</rss>

