<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ray Heffer &#187; Scripts &amp; Commands</title>
	<atom:link href="http://www.rayheffer.com/category/linux/scripts-commands/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rayheffer.com</link>
	<description>Enterprise Technologies</description>
	<lastBuildDate>Sat, 04 Feb 2012 17:51:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>VMware ESXi 4.1 Kickstart Scripted Deployment with UDA (PXE BOOT)</title>
		<link>http://www.rayheffer.com/1369/vmware-esxi-4-1-kickstart-scripted-deployment-with-uda-pxe-boot/</link>
		<comments>http://www.rayheffer.com/1369/vmware-esxi-4-1-kickstart-scripted-deployment-with-uda-pxe-boot/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 15:32:57 +0000</pubDate>
		<dc:creator>Ray Heffer</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts & Commands]]></category>
		<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Virtualisation]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[home lab]]></category>
		<category><![CDATA[vsphere]]></category>

		<guid isPermaLink="false">http://www.rayheffer.com/?p=1369</guid>
		<description><![CDATA[If you are looking to deploy multiple ESX/ESXi servers then there are plenty of methods and tools out there, some more complex than others. There are vendor specific deployment products available such as HP Rapid Depuployment Pack (RDP) which uses Altiris, or alternatively there are free deployment tools such as ESX Deployment Appliance (EsleeDA) and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rayheffer.com%2F1369%2Fvmware-esxi-4-1-kickstart-scripted-deployment-with-uda-pxe-boot%2F" onclick="pageTracker._trackPageview('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.rayheffer.com_2F1369_2Fvmware-esxi-4-1-kickstart-scripted-deployment-with-uda-pxe-boot_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rayheffer.com%2F1369%2Fvmware-esxi-4-1-kickstart-scripted-deployment-with-uda-pxe-boot%2F&amp;source=rayheffer&amp;style=normal&amp;service=TinyURL.com&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>If you are looking to deploy multiple ESX/ESXi servers then there are plenty of methods and tools out there, some more complex than others. There are vendor specific deployment products available such as HP Rapid Depuployment Pack (RDP) which uses Altiris, or alternatively there are free deployment tools such as ESX Deployment Appliance (EsleeDA) and Ultimate Deployment Appliance (UDA). UDA is my favorite tool for the job as it offers great flexibility such as the use of subtemplates (discussed later), and therefore this will be the basis of this article. It was created by <a href="http://www.ultimatedeployment.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.ultimatedeployment.org/?referer=');">Carl Thijssen</a> and thanks to <a href="http://www.rtfm-ed.co.uk/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.rtfm-ed.co.uk/?referer=');">Mike Laverick of RTFM</a>, it also supports ESX/ESXi deployments, and the latest build supports ESX/ESXi 4.1.<br />
<span id="more-1369"></span><br />
I aim to share the basics of getting the UDA configured for your environment and not delve into anything too complicated here. The best way of learning to perform some of the more complex deployments are to grasp the basics first then experiment with other functionality in your own environment for yourself. Mike Laverick has an excellent <a href="http://www.rtfm-ed.co.uk/docs/vmwdocs/uda20-beta.pdf " target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.rtfm-ed.co.uk/docs/vmwdocs/uda20-beta.pdf?referer=');">guide</a> on deploying and configuring UDA 2.0 beta.</p>
<p>For the purposes of this guide a number of assumptions have been made. You will have already deployed vCenter and at least one ESX/ESXi host running with some storage. If you are going to be testing this in a home lab then bear in mind that we’ll need to configure DHCP options 66 and 67, see the end of this article for details. You can do this with an existing DHCP server or use UDA as a DHCP server. Most deployments will be using an existing DHCP server.</p>
<p>Let’s get started&#8230;</p>
<p><strong>Step 1: Download &amp; Deploy the Ultimate Deployment Appliance</strong></p>
<p>1) Download UDA from: <a href="http://www.rtfm-ed.co.uk/vmware-content/ultimate-da/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.rtfm-ed.co.uk/vmware-content/ultimate-da/?referer=');">http://www.rtfm-ed.co.uk/vmware-content/ultimate-da/</a> then extract it to your hard disk.<br />
2) Import the appliance using your vSphere client (<code>File &gt; Deploy OVF Template...</code>)<br />
3) Prior to powering on the appliance, add a second disk that we’ll use to store your ISO images. I’d recommend at least a 20GB disk, and use thin to conserve disk space.<br />
4) Power on and proceed to the next step.</p>
<p><strong>Step 2: Installation and Setup</strong></p>
<p><a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-001.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Setup"><img class="alignnone size-thumbnail wp-image-1385" title="Ultimate Deployment Appliance (UDA) Setup" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-001-150x150.png" alt="Ultimate Deployment Appliance (UDA) Setup" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-002.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Setup"><img class="alignnone size-thumbnail wp-image-1386" title="Ultimate Deployment Appliance (UDA) Setup" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-002-150x150.png" alt="Ultimate Deployment Appliance (UDA) Setup" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-003.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Setup"><img class="alignnone size-thumbnail wp-image-1387" title="Ultimate Deployment Appliance (UDA) Setup" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-003-150x150.png" alt="Ultimate Deployment Appliance (UDA) Setup" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-004.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Setup"><img title="Ultimate Deployment Appliance (UDA) Setup" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-004-150x150.png" alt="Ultimate Deployment Appliance (UDA) Setup" width="150" height="150" /></a></p>
<p><a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-003.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Setup"></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-005.png" rel="lightbox[1369]"><img class="alignnone size-thumbnail wp-image-1389" title="Ultimate Deployment Appliance (UDA) Setup" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-005-150x150.png" alt="Ultimate Deployment Appliance (UDA) Setup" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-006.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Setup"><img class="alignnone size-thumbnail wp-image-1390" title="Ultimate Deployment Appliance (UDA) Setup" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-setup-006-150x150.png" alt="Ultimate Deployment Appliance (UDA) Setup" width="150" height="150" /></a></p>
<p>1) Click OK at the welcome screen<br />
2) Enter the hostname (I recommend that you also add the hostname into your DNS server)<br />
3) Enter the IP address configuration<br />
4) Select the services you require (as a minimum I would just leave TFTP, HTTP and SSH selected)<br />
5) Enter the root password.<br />
6) Select Yes to apply the changes.</p>
<p>Once it has finished you will then be able to access your UDA from a web browser. Log in with admin and the password you set during the setup.</p>
<p><strong>Step 3: UDA Configuration</strong></p>
<p>When you first log into the appliance you will be presented with a welcome page. The first thing to configure is the additional disk space we need to store our ISO images. If you haven’t added a second hard disk, then shutdown the UDA (System &gt; Shutdown), then add the additional disk and power on.</p>
<p>UDA has two partitions; <code>systemlv</code> and <code>localv</code>. ISO images are stored on the <code>localv</code> partition, so we’ll extend that.</p>
<p>1) Go to System and click Diskspace.<br />
2) Select localv and then click Extend.<br />
3) Select the device and then click Apply.</p>
<p>It may take a little while depending on how large the new disk is, but once that is complete we’ll load the ISO image for ESXi 4.1 Update 1 on to the UDA.</p>
<p>1) Go to System and click Upload.<br />
2) Click Choose File, select your ISO then click Upload.</p>
<p>It will store the ISO on the localv partition in <code>/local</code>.</p>
<p><strong>Step 4: Add an OS &amp; Deployment Template for ESXi 4.1</strong></p>
<p><a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-001.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Configuration Steps"><img class="alignnone size-thumbnail wp-image-1392" title="Ultimate Deployment Appliance (UDA) Configuration Steps" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-001-150x150.png" alt="Ultimate Deployment Appliance (UDA) Configuration Steps" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-002.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Configuration Steps"><img class="alignnone size-thumbnail wp-image-1393" title="Ultimate Deployment Appliance (UDA) Configuration Steps" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-002-150x150.png" alt="Ultimate Deployment Appliance (UDA) Configuration Steps" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-003.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Configuration Steps"><img class="alignnone size-thumbnail wp-image-1394" title="Ultimate Deployment Appliance (UDA) Configuration Steps" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-003-150x150.png" alt="Ultimate Deployment Appliance (UDA) Configuration Steps" width="150" height="150" /> </a><a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-004.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Configuration Steps"><img title="Ultimate Deployment Appliance (UDA) Configuration Steps" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-004-150x150.png" alt="Ultimate Deployment Appliance (UDA) Configuration Steps" width="150" height="150" /></a></p>
<p><a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-005.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Configuration Steps"><img class="alignnone size-thumbnail wp-image-1396" title="Ultimate Deployment Appliance (UDA) Configuration Steps" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-005-150x150.png" alt="Ultimate Deployment Appliance (UDA) Configuration Steps" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-006.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Configuration Steps"><img class="alignnone size-thumbnail wp-image-1397" title="Ultimate Deployment Appliance (UDA) Configuration Steps" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-006-150x150.png" alt="Ultimate Deployment Appliance (UDA) Configuration Steps" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-007.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance (UDA) Configuration Steps"><img title="Ultimate Deployment Appliance (UDA) Configuration Steps" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-config-007-150x150.png" alt="Ultimate Deployment Appliance (UDA) Configuration Steps" width="150" height="150" /></a></p>
<p>Now for the exciting bit. We’ll add our OS (ESXi) and template for deployment which will also create the basics of our Kickstart script which we’ll add to later. The OS section allows us to tie an ISO image to a Flava name, in this case we’ll call it ESXi41. I’d recommend using a better naming convention for your environment though.</p>
<p>1) Go to OS and click New.<br />
2) Enter ESXi41 for the Flava Name.<br />
3) From the dropdown, choose VMware ESXi 4.1 Installable and click Next.<br />
4) Select the ESXi 4.1 ISO you uploaded and then click Finish.</p>
<p>Next, the template which contains our Kickstart script. The template also contains a subtemplate which allows us to define our own variables, such as IP address and hostnames for each ESXi host we are deploying. This is why I like using UDA so much, because it avoids having to create a separate Kickstart script for each ESXi host.</p>
<p>1) Go to Templates and click New.<br />
2) Enter a Template Name. For example: esxi-build and give it a meaninful description.<br />
3) From the Operating System dropdown choose VMware ESXi 4.1 Installable and click Next.<br />
4) From the Flava dropdown choose your OS (Flava), ESXi41 and click Next then Finish.</p>
<p>The next stage is to perform the configuration of our Kickstart script and subtemplate. Go to Templates, select your template (esxi-build) and click Configure. You’ll see three tabs here; General, Subtemplates and Advanced. Click on Advanced. This is where our Kickstart script lives, and you’ll see it contains a basic configuration.</p>
<p>Here is a breakdown with explanations for each line:</p>
<p><code><br />
# Accept the VMware EULA - The script will fail without this.<br />
accepteula</code></p>
<p><code># Set the root password using MD5 crypt<br />
rootpw secret</code></p>
<p><code># Auto partition the disk<br />
autopart --firstdisk --overwritevmfs</code></p>
<p><code># Location of the install media<br />
install url http://[UDA_IPADDR]/[OS]/[FLAVOR]</code></p>
<p><code># Configure IP address and hostname. --addvmportgroup=0 will disable creation of the VM Network portgroup<br />
network --bootproto=static --ip=192.168.178.200 --gateway=192.168.178.1 --nameserver=192.168.178.1 --netmask=255.255.255.0 --hostname=esx41i --addvmportgroup=0</code></p>
<p><code># Reboot the host when the installation is complete<br />
reboot</code></p>
<p>The first thing we need to change is the root password which by default is set to <code>secret</code> and is in plain text. We can use a crypted MD5 password here using <code>rootpw --iscrypted</code> followed by the crypt.</p>
<p>1) Log into your UDA with PuTTY (SSH) and log in as root (same password you set during the initial setup).<br />
2) Type <code>grub-md5-crypt</code><br />
3) Enter your password and it’ll generate an MD5 string for you.<br />
4) Go back to the Advanced view in the web interface and change the rootpw line to (replacing the crypt with the one you generated):</p>
<p><code>rootpw --iscrypted  $1$3vkd233f/wksSo$fhniM3fdcV6hr0</code></p>
<p>Now we need to change the network configuration to use the appropriate IP address, gateway, subnet mask and hostname. We could just replace the default IP address configuration here, but a better method is to use variables which we can set in subtemplates. Variables are set inside square brackets, such as <code>[IPADDR], [FQDN]</code> and so on. The variable names are up to you. Change the network configuration, replacing the IP address and hostname with variables as follows:</p>
<p><code>network --bootproto=static --ip=[IPADDR] --gateway=192.168.4.1 --nameserver=192.168.4.1 --netmask=255.255.255.0 --hostname=[FQDN] --addvmportgroup=0</code></p>
<p>Select Subtemplates and click on Edit. The first line we will create contains the word <code>SUBTEMPLATE</code> then the variable names that we want to use (separated by semi-colons). Subsequent lines contain the values for each host. See my example below:</p>
<p><code>SUBTEMPLATE;IPADDR;FQDN;VMKIPADDR<br />
ESX01;192.168.4.11;esx01.home.lab;192.168.4.211<br />
ESX02;192.168.4.12;esx02.home.lab;192.168.4.212<br />
ESX03;192.168.4.13;esx03.home.lab;192.168.4.213<br />
ESX04;192.168.4.14;esx04.home.lab;192.168.4.214</code></p>
<p>You’ll notice in my example I’ve added a VMkernel IP address that in the case of our ESXi deployment we will use for VMotion.</p>
<p>Click on the Advanced tab. After the network configuration line we need to add the following command which allows us to run our <code>esxcfg</code> commands on first boot:</p>
<p><code>%firstboot --unsupported --interpreter=busybox</code></p>
<p>Now add the following commands to the Kickstart script (Advanced), which will add a VMotion portgroup and IP address. You can leave the <code>#</code> comments in if you wish:</p>
<p><code># Setup VMotion portgroup on vSwitch0<br />
esxcfg-vswitch -A VMotion vSwitch0</code></p>
<p><code># Setup VMotion IP address<br />
esxcfg-vmknic -a VMotion -i [VMKIPADDR] -n 255.255.255.0</code></p>
<p><code># Wait for previous command to finish before enabling VMotion<br />
sleep 10</code></p>
<p><code># Enable VMotion (ESX uses vmware-vim-cmd and ESXi is vim-cmd)<br />
vim-cmd hostsvc/vmotion/vnic_set vmk1<br />
vim-cmd hostsvc/net/refresh<br />
</code></p>
<p>Notice in the <code>vim-cmd</code> command above that it sets VMotion on <code>vmk1</code>. <code>vmk0</code> will be the management IP address used in the network command at the top of our script. This is fairly straightforward to work out, but if anyone knows of a better method then feel free to comment!</p>
<p>Finally click on Save.</p>
<p><strong>The Deployment</strong></p>
<p>Now we have the UDA configured and ready to roll with our ESXi installation all we have to do now is PXE boot our hosts and providing you have configured DHCP options 66 &amp; 67 (see the end of this article) you should be presented with the UDA menu (see first screenshot).</p>
<p><a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-001.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance Menu - Installing VMware ESXi"><img class="alignnone size-thumbnail wp-image-1427" title="Ultimate Deployment Appliance Menu - Installing VMware ESXi" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-001-150x150.png" alt="Ultimate Deployment Appliance Menu - Installing VMware ESXi" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-002.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance Menu - Installing VMware ESXi"><img class="alignnone size-thumbnail wp-image-1428" title="Ultimate Deployment Appliance Menu - Installing VMware ESXi" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-002-150x150.png" alt="Ultimate Deployment Appliance Menu - Installing VMware ESXi" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-003.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance - Installing VMware ESXi"><img class="alignnone size-thumbnail wp-image-1429" title="Ultimate Deployment Appliance - Installing VMware ESXi" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-003-150x150.png" alt="Ultimate Deployment Appliance - Installing VMware ESXi" width="150" height="150" /></a> <a href="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-004.png" rel="lightbox[1369]" title="Ultimate Deployment Appliance - Installing VMware ESXi"><img class="alignnone size-thumbnail wp-image-1430" title="Ultimate Deployment Appliance - Installing VMware ESXi" src="http://www.rayheffer.com/wp-content/uploads/2011/03/uda-boot-004-150x150.png" alt="Ultimate Deployment Appliance - Installing VMware ESXi" width="150" height="150" /></a></p>
<p>The rest is easy, just select the host from the menu (we set this in SUBTEMPLATE) and it will install and configure ESXi with no user intervention. Using a scripted installation can be very powerful and a lot more can be configured than I&#8217;ve included here. Even if you don&#8217;t have mass ESXi deployments, this is a good way of ensuring that your ESXi hosts maintain your standard build. If you have an Enterprise Plus license then you can also use Host Profiles.</p>
<hr />
<p><strong>Kickstart script:</strong></p>
<p><code>accepteula<br />
rootpw --iscrypted $1$3vkd233f/wksSo$fhniM3fdcV6hr0<br />
autopart --firstdisk --overwritevmfs<br />
install url http://[UDA_IPADDR]/[OS]/[FLAVOR]<br />
network --bootproto=static --ip=[IPADDR] --gateway=192.168.4.1 --nameserver=192.168.4.30 --netmask=255.255.255.0 --hostname=[FQDN] --addvmportgroup=0<br />
reboot</code></p>
<p><code>## THE FOLLOWING IS OUR FIRSTBOOT CONFIGURATION ##</code></p>
<p><code># Configure additional commands at first boot.<br />
%firstboot --unsupported --interpreter=busybox</code></p>
<p><code># Setup VMotion portgroup on vSwitch0<br />
esxcfg-vswitch -A VMotion vSwitch0</code></p>
<p><code># Setup VMotion IP address<br />
esxcfg-vmknic -a VMotion -i [VMKIPADDR] -n 255.255.255.0</code></p>
<p><code># Wait for previous command to finish before enabling VMotion<br />
sleep 10</code></p>
<p><code># Enable VMotion (ESX uses vmware-vim-cmd and ESXi is vim-cmd)<br />
vim-cmd hostsvc/vmotion/vnic_set vmk1<br />
vim-cmd hostsvc/net/refresh</code></p>
<hr />
<p><strong>SUBTEMPLATE:</strong></p>
<p><code>SUBTEMPLATE;IPADDR;FQDN;VMKIPADDR<br />
ESX01;192.168.4.11;esx01.home.lab;192.168.4.211<br />
ESX02;192.168.4.12;esx02.home.lab;192.168.4.212<br />
ESX03;192.168.4.13;esx03.home.lab;192.168.4.213<br />
ESX04;192.168.4.14;esx04.home.lab;192.168.4.214</code></p>
<hr />
<p><strong>Configuring DHCP Options</strong></p>
<p>1) Set option 66 to the IP address of your UDA<br />
2) Set option 67 to pxelinux.0</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rayheffer.com/1369/vmware-esxi-4-1-kickstart-scripted-deployment-with-uda-pxe-boot/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>8.3 VCAP-DCA Study Guide &#8211; Configuring vMA for Logging</title>
		<link>http://www.rayheffer.com/1296/6-1-8-3-logging-vmware-vma-configuring-vma-as-a-syslog-server/</link>
		<comments>http://www.rayheffer.com/1296/6-1-8-3-logging-vmware-vma-configuring-vma-as-a-syslog-server/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 12:36:02 +0000</pubDate>
		<dc:creator>Ray Heffer</dc:creator>
				<category><![CDATA[ESX]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts & Commands]]></category>
		<category><![CDATA[VCAP-DCA]]></category>
		<category><![CDATA[Virtualisation]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[esx]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[vcap]]></category>
		<category><![CDATA[vma]]></category>
		<category><![CDATA[vsphere]]></category>

		<guid isPermaLink="false">http://www.rayheffer.com/?p=1296</guid>
		<description><![CDATA[In this article I detail the steps required to configure your vMA as a Syslog server, and configure your ESX/ESXi hosts to send logging information to the vMA. Logging is often overlooked, but when managing multiple hosts it is far easier to send your logs to a Syslog server. I&#8217;m studying for the VCAP-DCA exam, [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rayheffer.com%2F1296%2F6-1-8-3-logging-vmware-vma-configuring-vma-as-a-syslog-server%2F" onclick="pageTracker._trackPageview('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.rayheffer.com_2F1296_2F6-1-8-3-logging-vmware-vma-configuring-vma-as-a-syslog-server_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rayheffer.com%2F1296%2F6-1-8-3-logging-vmware-vma-configuring-vma-as-a-syslog-server%2F&amp;source=rayheffer&amp;style=normal&amp;service=TinyURL.com&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In this article I detail the steps required to configure your vMA as a Syslog server, and configure your ESX/ESXi hosts to send logging information to the vMA. Logging is often overlooked, but when managing multiple hosts it is far easier to send your logs to a Syslog server. I&#8217;m studying for the VCAP-DCA exam, and using vicfg-syslog is a requirement of the exam (Section 6.1) and the vMA is also essential to understand (Section 8.1). I hope my notes help you as they have helped me.<br />
<span id="more-1296"></span></p>
<h4><strong>Configuring your VMware vMA as a Syslog server is very easy to do, just follow these steps</strong></h4>
<p>Log on to your vMA as vi-admin and enter the following commands:</p>
<p><code>sudo service rsyslog stop<br />
sudo vi /etc/sysconfig/rsyslog<br />
sudo service rsyslog start<br />
sudo iptables -I INPUT -i eth0 -p udp --dport 514 -j ACCEPT<br />
sudo service iptables save</code> (this will save the new firewall rule and ensure it doesn&#8217;t disappear after a reboot)</p>
<p>Job done! The vMA server is now ready to accept syslog connections on UDP port 514.</p>
<h4><strong><br />
Configuring your ESXi host to send logging information to the Syslog server</strong></h4>
<p>You can do this via the vSphere client (Configuration &gt; Advanced &gt; Syslog, syslog.remote.hostname), but for the VCAP-DCA exam it might be useful to know how to do this using vMA.</p>
<p><strong>Using vMA:</strong></p>
<p>First ensure your have your ESXi host set as the fast-pass target, then use <code>vicfg-syslog</code>:</p>
<p><code># vifptarget -s &lt;ESXI_HOSTNAME&gt;<br />
# vicfg-syslog -s &lt;VMA_IP_ADDRESS&gt;</code></p>
<h4><strong><br />
Configuring your ESX host to send logging information to Syslog server</strong></h4>
<p>You can&#8217;t use the vSphere client or vMA to configure Syslog on an ESX host, so we need to edit <code>/etc/syslog.conf</code> and add the following line to the very bottom:</p>
<p><code>*.* @&lt;SYSLOG_IP_ADDRESS&gt;</code></p>
<p>In this example, replace &lt;SYSLOG_IP_ADDRESS&gt; with the IP address of the vMA.</p>
<p>Next we need to allow UDP port 514 out from your ESX host. To do this run the following command (make sure you are logged in, or <code>su -</code> as root):</p>
<p><code># esxcfg-firewall -o 514,udp,out,syslog</code></p>
<p><strong>Note:</strong> If you log in to your ESX hot then su as root make sure you type (<code>su -</code>) with the hyphen and that will load the environment variables of the root account. Otherwise you may find that you get the error &#8216;<code>bash: esxcfg-firewall: command not found</code>&#8216;.</p>
<p>Finally, restart the syslog service:</p>
<p><code># service syslog restart</code></p>
<h4><strong><br />
Checking the ESX logs on vMA</strong></h4>
<p>Now for the fun bit!  Log on to your vMA server as vi-admin, and type:</p>
<p><code># sudo tail -f /var/log/messages</code></p>
<p>This will tail the messages file, and -f will output data as it is added to the file.</p>
<p>To send a test message, log on to the ESX host that you configured for syslog (above) and type:</p>
<p><code># logger syslog test message</code></p>
<p>You should see your test message output on the vMA. Cool huh!</p>
<h4><strong><br />
Checking ESXi logs on vMA</strong></h4>
<p>The logger command isn&#8217;t available with ESXi, so another way of checking that your Syslog is working for an ESXi host is to filter the results to show the IP address of your ESXi host:</p>
<p><code># sudo tail -f /var/log/messages | grep &lt;ESXI_IP_ADDRESS&gt;</code></p>
<p>It shouldn&#8217;t take long to see messages from your ESXi host, and filtering on the IP address using grep is a really neat way of finding results for a particular host.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rayheffer.com/1296/6-1-8-3-logging-vmware-vma-configuring-vma-as-a-syslog-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing VMware tools on a Linux guest</title>
		<link>http://www.rayheffer.com/152/installing-vmware-tools-on-a-linux-guest/</link>
		<comments>http://www.rayheffer.com/152/installing-vmware-tools-on-a-linux-guest/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 10:25:00 +0000</pubDate>
		<dc:creator>Ray Heffer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts & Commands]]></category>
		<category><![CDATA[Virtualisation]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[rpm]]></category>
		<category><![CDATA[vmtools]]></category>
		<category><![CDATA[vmware tools]]></category>

		<guid isPermaLink="false">http://www.rayheffer.com/?p=152</guid>
		<description><![CDATA[Start the VMware Tools installation Using the VMware VI Client, right click on the Linux guest and select Install/Upgrade VMware Tools. Mounting the CD-ROM You&#8217;ll need to mount the CD-ROM on the Linux guest. # mount /dev/cdrom /mnt Change the working directory to /mnt # cd /mnt Using the RPM installer, install VMware tools. # [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rayheffer.com%2F152%2Finstalling-vmware-tools-on-a-linux-guest%2F" onclick="pageTracker._trackPageview('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.rayheffer.com_2F152_2Finstalling-vmware-tools-on-a-linux-guest_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rayheffer.com%2F152%2Finstalling-vmware-tools-on-a-linux-guest%2F&amp;source=rayheffer&amp;style=normal&amp;service=TinyURL.com&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Start the VMware Tools installation</strong></p>
<p>Using the VMware VI Client, right click on the Linux guest and select Install/Upgrade VMware Tools.</p>
<p><strong>Mounting the CD-ROM</strong></p>
<p>You&#8217;ll need to mount the CD-ROM on the Linux guest.<br />
<code># mount /dev/cdrom /mnt</code><br />
<span id="more-152"></span><br />
Change the working directory to /mnt<br />
<code># cd /mnt</code><br />
Using the RPM installer, install VMware tools.<br />
<code># rpm -Uhv VMwareTools-3.5.0-153875.i386.rpm</code><br />
Unmount the CD-ROM<br />
<code># umount /dev/cdrom</code><br />
Starting VMware tools and make sure it starts on boot.<br />
<code># service vmware-tools start<br />
# chkconfig vmware-tools on</code><br />
Run the Vmware tools configuration tool. * This will shutdown the ethernet interface, so do this from the console.</p>
<p># vmware-config-tools.pl</p>
<p>That&#8217;s it!</p>
<p><strong><br />
Troubleshooting:</strong></p>
<p><strong>&#8220;Trying to find a suitable vmmemctl module for your running kernel.&#8221;</strong></p>
<p><strong>&#8220;None of the pre-built vmmemctl modules for VMware Tools is suitable for your running kernel.  Do you want this program to try to build the vmmemctl module for your system (you need to have a C compiler installed on your system)?&#8221;</strong></p>
<p>If you are using CentOS 5 like me, then you&#8217;ll need to install GCC and kernel-devel otherwise it will fail. Also, make sure your kernel version matches the kernel-devel version. This error will also present itself if your are running Xen virtualisation.</p>
<p><code># yum install gcc kernel-devel</code><br />
<code># yum upgrade kernel kernel-devel</code></p>
<p>Finally, reboot to load the updated kernel and try again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rayheffer.com/152/installing-vmware-tools-on-a-linux-guest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux commands and tips</title>
		<link>http://www.rayheffer.com/125/linux-commands-and-tips/</link>
		<comments>http://www.rayheffer.com/125/linux-commands-and-tips/#comments</comments>
		<pubDate>Thu, 07 Jul 2005 12:41:30 +0000</pubDate>
		<dc:creator>Ray Heffer</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts & Commands]]></category>
		<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[history]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[makemap]]></category>
		<category><![CDATA[nameserver]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[resolv]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[uname]]></category>

		<guid isPermaLink="false">http://wp.rayheffer.com/?p=125</guid>
		<description><![CDATA[Checking kernel &#38; CentOS version To check which kernel version you are running use uname -r # uname -r To find out which CentOS (or RedHat) release is installed have a look at /etc/redhat-release # cat /etc/redhat-release Checking Disk Space To check disk space used / free use the df command and it will display [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.rayheffer.com%2F125%2Flinux-commands-and-tips%2F" onclick="pageTracker._trackPageview('/outgoing/api.tweetmeme.com/share?url=http_3A_2F_2Fwww.rayheffer.com_2F125_2Flinux-commands-and-tips_2F&amp;referer=');"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.rayheffer.com%2F125%2Flinux-commands-and-tips%2F&amp;source=rayheffer&amp;style=normal&amp;service=TinyURL.com&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong><img class="size-full wp-image-376 alignright" title="Linux Tips" src="http://www.rayheffer.com/wp-content/uploads/2010/02/Programming.png" alt="" width="128" height="128" />Checking kernel &amp; CentOS version</strong></p>
<p>To check which kernel version you are running use <code>uname -r</code></p>
<p><code># uname -r</code></p>
<p>To find out which CentOS (or RedHat) release is installed have a look at <code>/etc/redhat-release</code></p>
<p><code># cat /etc/redhat-release </code></p>
<p><strong>Checking Disk Space</strong></p>
<p>To check disk space used / free use the <code>df </code>command and it will display each volume. The <code>-h</code> switch turns the bytes reading into GB to make it more readable.</p>
<p><code># df -h</code></p>
<p>If you want to check the size of a particular directory then use:</p>
<p><code># du -sh /</code><br />
<span id="more-125"></span></p>
<p><strong>Configuring DNS Settings</strong></p>
<p>To configure which DNS servers your Linux server will use you need to edit <code>/etc/resolv.conf</code></p>
<p><code># vi /etc/resolv.conf</code></p>
<p>Just add each name server as a new line as in the following example:</p>
<p><code>nameserver<br />
nameserver </code></p>
<p><strong>Changing the hostname</strong></p>
<p>You&#8217;ll find the hostname of the server in two places: <code>/etc/hosts</code> and <code>/etc/sysconfig/network</code>.</p>
<p><code># vi /etc/hosts</code></p>
<p>and</p>
<p><code># vi /etc/sysconfig/network</code></p>
<p><strong>Show Processor &amp; Memory Usage</strong></p>
<p>This is equivilant to the Windows Task Manager, and will show each process and the consumed CPU and RAM usage. Very useful!</p>
<p><code># top</code></p>
<p><strong>Show Processor Information</strong></p>
<p>This command will display the processor type and speed.</p>
<p><code># cat /proc/cpuinfo</code></p>
<p><strong>Search command history for old commands you have forgotten!</strong></p>
<p>Use the history command with <code>grep</code> to find previously entered commands.</p>
<p><code># history | grep <em>command</em></code></p>
<p><strong>Compiling sendmail.mc</strong></p>
<p><code># m4 /etc/mail/sendmail.mc &gt; /etc/mail/sendmail.cf</code></p>
<p><strong>Updating virtusertable.db from /etc/mail/virtusertable</strong></p>
<p><code># makemap hash /etc/mail/virtusertable.db &lt; /etc/mail/virtusertable</code></p>
<p><strong>Saving IPTABLES to /etc/sysconfig/iptables</strong></p>
<p><code># iptables-save &gt; /etc/sysconfig/iptables</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rayheffer.com/125/linux-commands-and-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
