<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-5716019196873398420</atom:id><lastBuildDate>Fri, 30 Jul 2010 22:49:10 +0000</lastBuildDate><title>JCMD Lab</title><description>..... where the experiment never ends .....</description><link>http://www.jcmdlab.org/</link><managingEditor>noreply@blogger.com (JC)</managingEditor><generator>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5716019196873398420.post-6109306133011235491</guid><pubDate>Wed, 03 Feb 2010 15:41:00 +0000</pubDate><atom:updated>2010-07-19T23:59:57.930-06:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>ESXi</category><title>Customizing an ESXi 4.0 Installation</title><description>While there is little you can do as far as customizing an ESXi 4 installation, its worth the effort to do what you can :D.&amp;nbsp;&amp;nbsp; After some "googling" and a little Python training I have done a few things to the build to help speed things up.&lt;br /&gt;&lt;hr /&gt;&lt;div style="text-align: center;"&gt;&lt;em&gt;&lt;span style="font-size: xx-small;"&gt;&lt;span style="color: #cc0000;"&gt;DISCLAIMER: &lt;/span&gt;&lt;span style="color: black;"&gt;This information is provided "As-Is" and use at your own risk.&amp;nbsp; &lt;/span&gt;&lt;span style="color: black;"&gt;Always, ALWAYS - test in your environment before commiting to&amp;nbsp;Production!&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;hr /&gt;&lt;strong&gt;Step 1 - What's up with all these screens?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;First action is to get rid of some of the opening screens such as the Welcome and EULA.&amp;nbsp;I found guidance for this at &lt;a href="http://vinternals.com/2009/07/unattended-esxi-installation" target="_new"&gt;vinternals.com&lt;/a&gt; which explains it very well.&amp;nbsp; Basically, if you look on the media in the root directory you will see a few .tgz files.&amp;nbsp; The one we're interested in is "&lt;span style="color: #741b47;"&gt;install.tgz&lt;/span&gt;" which contains the Python installation scripts (among other things).&amp;nbsp; Extract this file and the main Python file we want to modify is "&lt;span style="color: #741b47;"&gt;/usr/lib/vmware/installerThinESXInstall.py&lt;/span&gt;".&amp;nbsp; &lt;br /&gt;&lt;br /&gt;Find the line that says:&lt;br /&gt;&lt;pre&gt;Steps = [ WelcomeStep, LicenseStep, TargetSelectionStep, ConfirmStep,\&lt;br /&gt;          WriteStep, PostConfigStep, CompleteStep, RebootStep ]&lt;/pre&gt;which is each main step the installation follows.&amp;nbsp; We want to get rid of the time consuming stuff (minor as that may be).&amp;nbsp; So change the code to say:&lt;br /&gt;&lt;pre&gt;Steps = [ TargetSelectionStep, WriteStep, PostConfigStep, RebootStep ]&lt;/pre&gt;As you can see, we've removed the Welcome, License, Confirm, and Complete steps.&amp;nbsp; Hey, every keystroke counts - right?&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;strong&gt;Step 2 - SAN Isolation&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The next modification I did was to make it "SAN safe" which means we don't want to have to physically disconnect the SAN storage just to install ESXi (a problem with ALL ESX versions).&amp;nbsp; To do this with ESX required modifying a LOT of files but with ESXi it's actually quite simple.&lt;br /&gt;&lt;br /&gt;Basically, I don't want the TargetSelectionStep showing any fibre channel devices during installation.&amp;nbsp; To do this we'll need to add &lt;strong&gt;ONE LINE&lt;/strong&gt; of Python code to the TargetSelectionStep section.&amp;nbsp;&amp;nbsp;The vinternals post&amp;nbsp;referenced above provided the path/filename which is&amp;nbsp;also in the install.tgz file as well - &amp;nbsp;"&lt;span style="color: #741b47;"&gt;/usr/lib/vmware/installer/ThinESX/Dialogs/DeviceSelectionDialog.py&lt;/span&gt;".&amp;nbsp; The section we want is in in the "class TargetList(list)".&amp;nbsp; What we're going to do is simply not add the FC disks to the selection list so the administrator won't even see them as a target.&lt;br /&gt;&lt;br /&gt;Find these lines:&lt;br /&gt;&lt;pre&gt;textWidget = TargetTextWidget(text, target, consolePath)&lt;br /&gt;textList.append(urwid.AttrWrap(textWidget, color, selectedColor)) &lt;br /&gt;&lt;/pre&gt;and add the following line so it now looks like this:&lt;br /&gt;&lt;pre&gt;if diskType != "fc":&lt;br /&gt;   textWidget = TargetTextWidget(text, target, consolePath)&lt;br /&gt;   textList.append(urwid.AttrWrap(textWidget, color, selectedColor)) &lt;br /&gt;&lt;/pre&gt;You'll notice there's no closing statement for IF.&amp;nbsp; Threw me at first too but it's actually cool. Python uses INDENTING for code blocks.&amp;nbsp; So when you add the IF statement be sure to indent the two lines or you'll get some "interesting" results :D &lt;br /&gt;&amp;nbsp; &lt;br /&gt;If you wanted to restrict the target list to a specific disk type (i.e. the local SAS drives) you could change the IF statement to suite your environment (i.e. if diskType == "sas": ).&amp;nbsp; I build on various servers with both sas and scsi so simply not showing the SAN storage is sufficient. &lt;br /&gt;&lt;br /&gt;&lt;em&gt;Note: some FC cards will still present LUNS as local devices even though they are on a SAN so be sure to test in your environment.&amp;nbsp; Whatever shows up under the "diskType" heading in the list is what ESXi thinks it is so handle accordingly.&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;strong&gt;Step 3 - Not So Fast on the Install!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now let's get rid of the timer at the install screen!&amp;nbsp; I found this especially annoying since ESXi does NOT eject the media after installation (?!?!?!).&amp;nbsp; So if you're not WATCHING - ESXi will install, reboot, then reinstall after the timer runs out. Anyway, this is simple enough to do. Edit the "&lt;span style="color: #741b47;"&gt;isolinux.cfg&lt;/span&gt;" file which is located in the root directory of the media and comment out&amp;nbsp;"timeout 80" on line 3 (i.e. #timeout 80).&amp;nbsp; I also change the menu title on line 2 but that's a cosmetic/internal thing :D&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;strong&gt;Step 4 - Scripting All of This&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Finally, we need to put all of this back together as a new ISO.&amp;nbsp; I have a script to do this which contains a few folders with the modified files (/icustom), script (/iscripts),&amp;nbsp;and source iso (isource). &amp;nbsp;The script creates some temporary folders to mount the source iso, copy everything off to another folder, extract/update/recreate the install.tgz, update the isolinxu.cfg file, then build the new iso.&amp;nbsp;This assumes the modified .py and isolinux.cfg files&amp;nbsp;are in the /icustom folder ready to be inserted.&amp;nbsp; If you run this script provided below, all the extracted files will still be available after the first run to allow you to grab/modify what you need and put in the /icustom folder.&amp;nbsp; Uncomment the "Cleaning up..." section at the bottom and they'll be whipped out at the end to help conserve disk space.&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;strong&gt;The Script:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;#!/bin/bash&lt;br /&gt;&lt;br /&gt;TIMESTAMP=`date +%F_%H%M`&lt;br /&gt;ISOFILE="ESXi4U1-$TIMESTAMP.iso"&lt;br /&gt;&lt;br /&gt;cd /&lt;br /&gt;&lt;br /&gt;clear&lt;br /&gt;echo -n "Creating working directories..."&lt;br /&gt;if [ ! -d cdrom ]; then&lt;br /&gt;&amp;nbsp; mkdir /cdrom&lt;br /&gt;fi&lt;br /&gt;&lt;br /&gt;if [ ! -d iwork ]; then&lt;br /&gt;&amp;nbsp; mkdir /iwork&lt;br /&gt;fi&lt;br /&gt;chmod 777 /iwork&lt;br /&gt;rm -rf /iwork/*&lt;br /&gt;&lt;br /&gt;if [ ! -d iinstall ]; then&lt;br /&gt;&amp;nbsp; mkdir /iinstall&lt;br /&gt;fi&lt;br /&gt;chmod 777 /iinstall&lt;br /&gt;rm -rf /iinstall/*&lt;br /&gt;&lt;br /&gt;echo "Done"&lt;br /&gt;&lt;br /&gt;echo -n "Mounting CD..."&lt;br /&gt;mount -o loop /isource/ESXi-4.0.0-update1.iso /cdrom&lt;br /&gt;echo "Done"&lt;br /&gt;&lt;br /&gt;echo -n "Copying content from ESXi 4 CD..."&lt;br /&gt;cp -rp /cdrom/* /iwork&lt;br /&gt;umount /cdrom&lt;br /&gt;echo "Done"&lt;br /&gt;&lt;br /&gt;echo -n "Uncompressing install.tgz image..."&lt;br /&gt;cd /iinstall&lt;br /&gt;tar -xzf /iwork/install.tgz&lt;br /&gt;echo "Done"&lt;br /&gt;&lt;br /&gt;echo -n "Copying custom files into install.tgz image..."&lt;br /&gt;cp -f /icustom/ThinESXInstall.py /iinstall/usr/lib/vmware/installer&lt;br /&gt;cp -f /icustom/DeviceSelectionDialog.py /iinstall/usr/lib/vmware/installer/ThinESX/Dialogs&lt;br /&gt;echo "Done"&lt;br /&gt;&lt;br /&gt;echo -n "Creating custom install.tgz..."&lt;br /&gt;tar -czf install.tgz *&lt;br /&gt;echo "Done"&lt;br /&gt;&lt;br /&gt;echo -n "Copying new files to media..."&lt;br /&gt;cp -f /iinstall/install.tgz /iwork&lt;br /&gt;cp -f /icustom/isolinux.cfg /iwork&lt;br /&gt;echo "Done"&lt;br /&gt;&lt;br /&gt;echo -n "Creating new ISO image..."&lt;br /&gt;cd /iwork&lt;br /&gt;mkisofs -l -J -R -r -T -o /$ISOFILE -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /iwork &amp;amp;&amp;gt; /dev/null&lt;br /&gt;echo "DONE"&lt;br /&gt;&lt;br /&gt;#echo -n "Cleaning up..."&lt;br /&gt;#cd / &lt;br /&gt;#rm -dRf /cdrom&lt;br /&gt;#rm -dRf /iwork&lt;br /&gt;#rm -dRf /iinstall&lt;br /&gt;#echo "Done"&lt;br /&gt;&lt;br /&gt;echo&lt;br /&gt;echo "*** ISO IMAGE ($ISOFILE) CREATED ***"&lt;br /&gt;echo&lt;br /&gt;&lt;/pre&gt;&lt;hr /&gt;&lt;strong&gt;Enjoy and Good Luck!&lt;/strong&gt;&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5716019196873398420-6109306133011235491?l=www.jcmdlab.org' alt='' /&gt;&lt;/div&gt;</description><link>http://www.jcmdlab.org/2010/02/customizing-esxi-4-installation.html</link><author>noreply@blogger.com (JC)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5716019196873398420.post-6678588171369206545</guid><pubDate>Sun, 20 Dec 2009 19:11:00 +0000</pubDate><atom:updated>2009-12-21T13:51:38.430-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>PowerShell</category><title>Changing AD Forest Tombstone Lifetime with PowerShell v1</title><description>Recently an issue came up where the domain controllers had been offline for a few months and they were inoperable. Research initially indicated that the tombstone lifetime defaulted to 180 days so this was quite odd considering it had definitely NOT been more that this time period. With some digging it was discovered there is a "bug" in the W2K3 EE R2 media that actually changes the default from 180 to 60 days - this occurs when the second "R2" disk is installed. Microsoft's fix is SP2 but this is&amp;nbsp;true only if SP2 is applied AFTER the OS is installed. We had slipstreamed SP2 onto the first R2&amp;nbsp; distribution disk (which is really just W2K3 EE). &lt;br /&gt;&lt;br /&gt;A detailed explanation can be found &lt;a href="http://blogs.dirteam.com/blogs/jorge/archive/2006/07/23/1233.aspx" target="_new"&gt;here&lt;/a&gt;&amp;nbsp;but it basically works out like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;em&gt;• If you install a W2K3 server from the first CD from the W2K3 R2 distribution set, then promote it to a DC and then install the R2 binaries from the second CD, the tombstone lifetime is set to 180 days &lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;em&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: inherit;"&gt;&lt;em&gt;• If you install a W2K3 server from the first CD from the W2K3 R2 distribution set, then install the R2 binaries from the second CD and then promote it to a DC, the tombstone lifetime is set to&amp;nbsp;60 days!&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;The manual fix is easy enough (ADSI Edit) but we needed to do this as part of our automation effort using PowerShell v1 (v2 has the Set-ADObject cmdlet). &lt;br /&gt;&lt;br /&gt;Here's the PS v1 code:&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;$root = [ADSI]"" &lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;$ds = [ADSI]("LDAP://CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration," + $root.DistinguishedName)&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;$ds.Put("tombstoneLifeTime","180")&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;$ds.SetInfo()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you want a different time period than change 180 to the desired value.&lt;br /&gt;&lt;br /&gt;You can also make the change using LDIFDE (included on every Windows 2003 Server). &lt;br /&gt;&lt;br /&gt;Create a text file that looks like this and save as "tslt.ldf":&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;dn: CN=Directory Service,CN=Windows NT,CN=Services,CN=Configuration,DC=4BCT25ID,DC=DS,DC=ARMY,DC=SMIL,DC=MIL&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;changetype: modify&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;replace: tombstoneLifetime&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;tombstoneLifetime: 180&lt;/span&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;-&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(the dash "-" on the last line is required)&lt;br /&gt;&lt;br /&gt;Then run the following command on the domain controller with Schema Master FSMO role:&lt;br /&gt;&lt;br /&gt;&lt;span style="background-color: #9fc5e8;"&gt;ldifde -v -i -f c:\tslt.ldf&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and this will apply the change to the domain. This change will replicate to all the domain controllers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5716019196873398420-6678588171369206545?l=www.jcmdlab.org' alt='' /&gt;&lt;/div&gt;</description><link>http://www.jcmdlab.org/2009/12/changing-domain-tombstone-lifetime-with.html</link><author>noreply@blogger.com (JC)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5716019196873398420.post-139066762020169737</guid><pubDate>Mon, 30 Nov 2009 23:07:00 +0000</pubDate><atom:updated>2009-11-30T17:17:02.456-07:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MOSS 2007</category><title>etc/hosts file disappears</title><description>While working on a Powershell script to add web frontends to an existing SharePoint 2007 farm I decided to see what it would take to have a dedicated server for crawling (indexing).  I went ahead and made the change through Central Admin first (to make sure it worked) and then just happened to check the event logs and found a LOT of errors - a new one every two minutes.  Whenever I see the same error every two minutes I immediately think "TIMER JOB"!  Well, it seems that as soon as I selected a dedicated frontend for crawling the HOSTS file disappeared!?!?!?  How odd!  &lt;br /&gt;&lt;br /&gt;So, of course, the first thing we all do - GOOGLE IT! &lt;br /&gt;&lt;br /&gt;The original post that addresses this problem can be found &lt;a href="http://blogs.msdn.com/jjameson/archive/2007/05/05/the-case-of-the-disappearing-hosts-file.aspx" target="_new"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Bottom line: the wss_admin_wpg local group (which contains the timer job service account) needs write/modify permissions to the ../drivers/etc directory. The reason this error doesn't usually come up is most people use the MOSS Admin account for all the services and it usually has local administrator rights to start with.  But if we follow "Least Privilege" rules and use a separate account for this AND specify a dedicated frontend - then the problem will surface.&lt;br /&gt;&lt;br /&gt;Now to figure out how to use stsadm.exe to specify a dedicated web frontend. :D&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5716019196873398420-139066762020169737?l=www.jcmdlab.org' alt='' /&gt;&lt;/div&gt;</description><link>http://www.jcmdlab.org/2009/11/hosts-file-disappears.html</link><author>noreply@blogger.com (JC)</author><thr:total>2</thr:total></item></channel></rss>