<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment</title><link>https://sourceforge.net/p/xcat/wiki/Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment/</link><description>Recent changes to Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment</description><atom:link href="https://sourceforge.net/p/xcat/wiki/Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment/feed" rel="self"/><language>en</language><lastBuildDate>Tue, 05 Aug 2014 12:16:47 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/xcat/wiki/Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment/feed" rel="self" type="application/rss+xml"/><item><title>Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,6 +1,6 @@
-[[include ref=Design Warning]]
+[[include ref=Design_Warning]]

-==Overview==
+##Overview

 xCAT has supported the running of postscripts and postbootscripts for deployment of Linux node. This design is focus on how to support the running of postscripts and postbootscripts during deployment of Windows compute nodes.

@@ -13,28 +13,28 @@
 :*The running order of postscripts is same with Linux that the postscripts which are set in osimage will be run first and then the ones in node definition.
 :*No Service node and updatenode are considered.

-==Interface==
+##Interface==

-===Customize the mypostscript.tmpl (Optional)===
-The mypostscript.tmpl is a template which is used to create the mypostscript script which includes environment variables and postscripts to run in compute node. The default path of it is /opt/xcat/share/xcat/templates/mypostscript/mypostscript.tmpl. If you want to customize it, copy it to /install/postscripts/mypostscript.tmpl and customize it with the rules in [http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Postscripts_and_Prescripts#Using_the_mypostscript_template how to use mypostscript.tmpl].
+###Customize the mypostscript.tmpl (Optional)===
+The mypostscript.tmpl is a template which is used to create the mypostscript script which includes environment variables and postscripts to run in compute node. The default path of it is /opt/xcat/share/xcat/templates/mypostscript/mypostscript.tmpl. If you want to customize it, copy it to /install/postscripts/mypostscript.tmpl and customize it with the rules in [Postscripts_and_Prescripts].

-===Create post scripts and post boot scripts===
+###Create post scripts and post boot scripts===
 The scripts can be any file which can be run in Windows OS.

 Since Windows OS recognizes the file type by the postfix, all the postscripts which are created for Windows compute node should have correct postfix like .bat, .cmd, .vbs, .ps1

 When running of postscripts, the running log will be written to c:\xcatpost\xcat.log. Admin can check the log at anytime for checking and debugging.

-===Copy all the scripts to /install/winpostscripts===
+###Copy all the scripts to /install/winpostscripts===
 On the xCAT management node, copy the postscripts/postbootscripts to /install/winpostscripts. If there are files which will be called by your scripts, also copy them to /install/winpostscripts
  cp &amp;lt;scripts&amp;gt; /install/winpostscripts

-===Set the scripts to postscript and postbootscripts attributes for corresponding nodes or osimage===
+###Set the scripts to postscript and postbootscripts attributes for corresponding nodes or osimage===
 Note: the scripts which are set by postscripts.xcatdefaults will be ignored.
  chdef &amp;lt;node&amp;gt; postscript="xx arg1 arg2,yy" postbootscripts="aa,bb arg1"
  chdef -t osoimage &amp;lt;osimage name=""&amp;gt; postscript=xx,yy postbootscripts=aa,bb

-===Enable the precreatemypostscripts===
+###Enable the precreatemypostscripts===
 In the first pass support, the '''precreatemypostscripts''' must be enabled. That means for any changes in postscript/postscripts attributes or mypostscript.tmpl, the nodeset command must be run to refresh the mypostscript.
  chdef -t site clustersite precreatemypostscripts=1

@@ -43,8 +43,8 @@
  rpower

-==Implementation==
-===Copy postscripts needed stuffs to compute node===
+##Implementation
+###Copy postscripts needed stuffs to compute node
 In existed code logic, there is a install/autoinst/&amp;lt;node&amp;gt;.cmd file which is used to initiate the OS deployment. Following piece of code will be added in &amp;lt;node&amp;gt;.cmd to copy the files.
  If existed mypostscript.&amp;lt;node&amp;gt; in MN:/install/mypostscript
   copy MN:/install/mypostscript/mypostscript.&amp;lt;node&amp;gt; c:\xcatpost\
@@ -53,7 +53,7 @@
   Do nothing
  End if

-===xcatwinpost.vbs and runpost.vbs===
+###xcatwinpost.vbs and runpost.vbs
 Create a script named 'xcatwinpost.vbs' which will be used to initiate the postscript mechanism. Create a script named 'runpost.vbs' which will be used to run postscript and log debug messages.

 Both of the scripts will be installed at /install/winpostscripts/ on xCAT MN and SN by xCAT rpm. Them will be copied to compute node by section: '''Copy postscripts needed stuffs to compute node'''
@@ -73,14 +73,14 @@
    &amp;lt;/RunSynchronousCommand&amp;gt;
  &amp;lt;/RunSynchronous&amp;gt;

-===Run the Post Boot Scripts===
+###Run the Post Boot Scripts
 Use /install/autoinst/&amp;lt;node&amp;gt;.cmd to create a file named C:\Windows\Setup\Scripts\SetupComplete.cmd on Windows compute node. This is a Windows specific file which is called automatically at the first boot. 

 Add the file 'mypostbootscript.cmd' which is created by 'xcatwinpost.vbs' into the C:\Windows\Setup\Scripts\SetupComplete.cmd to initiate the running of postbootscripts.

-== Other Design Considerations ==
+## Other Design Considerations 

 * '''Required reviewers''':  
 * '''Required approvers''':  Bruce Potter
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Tue, 05 Aug 2014 12:16:47 -0000</pubDate><guid>https://sourceforge.net5dfc355ea86fea21555f2454416f84814780db8f</guid></item><item><title>Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment modified by Lissa Valletta</title><link>https://sourceforge.net/p/xcat/wiki/Windows_Support_to_Run_Postscripts_Postbootscripts_in_Windows_Deployment/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;[-include ref=Design Warning: missing =-]&lt;/p&gt;
&lt;p&gt;==Overview==&lt;/p&gt;
&lt;p&gt;xCAT has supported the running of postscripts and postbootscripts for deployment of Linux node. This design is focus on how to support the running of postscripts and postbootscripts during deployment of Windows compute nodes.&lt;/p&gt;
&lt;p&gt;The basic functionalities:&lt;br /&gt;
:&lt;em&gt;Support to run postscripts before the first reboot.&lt;br /&gt;
:&lt;/em&gt;Support to run postbootscripts after the first reboot.&lt;br /&gt;
:&lt;em&gt;Support to pass arguments to postscripts and postbootscripts. The usage of how to pass arguments to postscripts and postbootscripts is same with Linux. e.g., postscripts="script1 p1 p2,script2,..."&lt;br /&gt;
:&lt;/em&gt;Support to export environment variables for postscript and postbootscript to use in runtime. Windows node will share the same template with Linux node at: /opt/xcat/share/xcat/templates/mypostscript/mypostscript.tmpl&lt;br /&gt;
:&lt;em&gt;The default postscripts/postbootscripts which are set in the 'postscripts.xcatdefaults' will be ignored by Windows compute node.&lt;br /&gt;
:&lt;/em&gt;The running order of postscripts is same with Linux that the postscripts which are set in osimage will be run first and then the ones in node definition.&lt;br /&gt;
:*No Service node and updatenode are considered.&lt;/p&gt;
&lt;p&gt;==Interface==&lt;/p&gt;
&lt;p&gt;===Customize the mypostscript.tmpl (Optional)===&lt;br /&gt;
The mypostscript.tmpl is a template which is used to create the mypostscript script which includes environment variables and postscripts to run in compute node. The default path of it is /opt/xcat/share/xcat/templates/mypostscript/mypostscript.tmpl. If you want to customize it, copy it to /install/postscripts/mypostscript.tmpl and customize it with the rules in &lt;span&gt;[http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Postscripts_and_Prescripts#Using_the_mypostscript_template how to use mypostscript.tmpl]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;===Create post scripts and post boot scripts===&lt;br /&gt;
The scripts can be any file which can be run in Windows OS.&lt;/p&gt;
&lt;p&gt;Since Windows OS recognizes the file type by the postfix, all the postscripts which are created for Windows compute node should have correct postfix like .bat, .cmd, .vbs, .ps1&lt;/p&gt;
&lt;p&gt;When running of postscripts, the running log will be written to c:\xcatpost\xcat.log. Admin can check the log at anytime for checking and debugging.&lt;/p&gt;
&lt;p&gt;===Copy all the scripts to /install/winpostscripts===&lt;br /&gt;
On the xCAT management node, copy the postscripts/postbootscripts to /install/winpostscripts. If there are files which will be called by your scripts, also copy them to /install/winpostscripts&lt;br /&gt;
 cp &amp;lt;scripts&amp;gt; /install/winpostscripts&lt;/p&gt;
&lt;p&gt;===Set the scripts to postscript and postbootscripts attributes for corresponding nodes or osimage===&lt;br /&gt;
Note: the scripts which are set by postscripts.xcatdefaults will be ignored.&lt;br /&gt;
 chdef &amp;lt;node&amp;gt; postscript="xx arg1 arg2,yy" postbootscripts="aa,bb arg1"&lt;br /&gt;
 chdef -t osoimage &amp;lt;osimage name=""&amp;gt; postscript=xx,yy postbootscripts=aa,bb&lt;/p&gt;
&lt;p&gt;===Enable the precreatemypostscripts===&lt;br /&gt;
In the first pass support, the '''precreatemypostscripts''' must be enabled. That means for any changes in postscript/postscripts attributes or mypostscript.tmpl, the nodeset command must be run to refresh the mypostscript.&lt;br /&gt;
 chdef -t site clustersite precreatemypostscripts=1&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Run the OS deployment&lt;br /&gt;
 nodeset &amp;lt;node&amp;gt; osimage=&amp;lt;osimage name=""&amp;gt;&lt;br /&gt;
 rpower&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;==Implementation==&lt;br /&gt;
===Copy postscripts needed stuffs to compute node===&lt;br /&gt;
In existed code logic, there is a install/autoinst/&amp;lt;node&amp;gt;.cmd file which is used to initiate the OS deployment. Following piece of code will be added in &amp;lt;node&amp;gt;.cmd to copy the files.&lt;br /&gt;
 If existed mypostscript.&amp;lt;node&amp;gt; in MN:/install/mypostscript&lt;br /&gt;
  copy MN:/install/mypostscript/mypostscript.&amp;lt;node&amp;gt; c:\xcatpost\
  oppy MN:/install/winpostscripts/* c:\xcatpost\
 Else &lt;br /&gt;
  Do nothing&lt;br /&gt;
 End if&lt;/p&gt;
&lt;p&gt;===xcatwinpost.vbs and runpost.vbs===&lt;br /&gt;
Create a script named 'xcatwinpost.vbs' which will be used to initiate the postscript mechanism. Create a script named 'runpost.vbs' which will be used to run postscript and log debug messages.&lt;/p&gt;
&lt;p&gt;Both of the scripts will be installed at /install/winpostscripts/ on xCAT MN and SN by xCAT rpm. Them will be copied to compute node by section: '''Copy postscripts needed stuffs to compute node'''&lt;/p&gt;
&lt;p&gt;xcatwinpost.vbs will parse the mypostscript.&amp;lt;node&amp;gt; and generate the mypostscript.cmd for postscripts running and mypostbootscript.cmd for postbootscripts running.&lt;/p&gt;
&lt;p&gt;===Inject xcatwinpost.vbs===&lt;br /&gt;
Inject the xcatwinpost.vbs in unattend.xml so that it can be called during node deployment by Windows setup program&lt;/p&gt;
&lt;p&gt;Add a section like following in /install/autoinst/&amp;lt;node&amp;gt;.xml when run nodeset command:&lt;br /&gt;
 &amp;lt;RunSynchronous&amp;gt;&lt;br /&gt;
   &amp;lt;RunSynchronousCommand wcm:action="add"&amp;gt;&lt;br /&gt;
      &amp;lt;Description&amp;gt;StartPointOfPostscripts&amp;lt;/Description&amp;gt;&lt;br /&gt;
      &amp;lt;Order&amp;gt;50&amp;lt;/Order&amp;gt;&lt;br /&gt;
      &amp;lt;Path&amp;gt;c:\xcatpost\winpostscripts\xcatwinpost.vbs&amp;lt;/Path&amp;gt;&lt;br /&gt;
      &amp;lt;WillReboot&amp;gt;OnRequest&amp;lt;/WillReboot&amp;gt;&lt;br /&gt;
   &amp;lt;/RunSynchronousCommand&amp;gt;&lt;br /&gt;
 &amp;lt;/RunSynchronous&amp;gt;&lt;/p&gt;
&lt;p&gt;===Run the Post Boot Scripts===&lt;br /&gt;
Use /install/autoinst/&amp;lt;node&amp;gt;.cmd to create a file named C:\Windows\Setup\Scripts\SetupComplete.cmd on Windows compute node. This is a Windows specific file which is called automatically at the first boot. &lt;/p&gt;
&lt;p&gt;Add the file 'mypostbootscript.cmd' which is created by 'xcatwinpost.vbs' into the C:\Windows\Setup\Scripts\SetupComplete.cmd to initiate the running of postbootscripts.&lt;/p&gt;
&lt;p&gt;== Other Design Considerations ==&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;'''Required reviewers''':&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;'''Required approvers''':  Bruce Potter&lt;/li&gt;
&lt;li&gt;'''Database schema changes''':  N/A&lt;/li&gt;
&lt;li&gt;'''Affect on other components''':  N/A&lt;/li&gt;
&lt;li&gt;'''External interface changes, documentation, and usability issues''':  N/A&lt;/li&gt;
&lt;li&gt;'''Packaging, installation, dependencies''':  N/A&lt;/li&gt;
&lt;li&gt;'''Portability and platforms (HW/SW) supported''':  N/A&lt;/li&gt;
&lt;li&gt;'''Performance and scaling considerations''':  N/A&lt;/li&gt;
&lt;li&gt;'''Migration and coexistence''':  N/A&lt;/li&gt;
&lt;li&gt;'''Serviceability''':  N/A&lt;/li&gt;
&lt;li&gt;'''Security''':  N/A&lt;/li&gt;
&lt;li&gt;'''NLS and accessibility''':  N/A&lt;/li&gt;
&lt;li&gt;'''Invention protection''':  N/A&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Lissa Valletta</dc:creator><pubDate>Mon, 28 Jul 2014 13:09:59 -0000</pubDate><guid>https://sourceforge.netba68ea11c10de14e04d3123cf2e9ec55bd994811</guid></item></channel></rss>