<?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>vSential</title>
	<atom:link href="http://vsential.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://vsential.com</link>
	<description>virtualization in the real world</description>
	<lastBuildDate>Wed, 25 Jan 2012 15:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>vCenter 5 VMwareVCMSDS Errors</title>
		<link>http://vsential.com/2012/01/vcenter-5-vmwarevcmsds-errors/</link>
		<comments>http://vsential.com/2012/01/vcenter-5-vmwarevcmsds-errors/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 15:00:41 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[5.x]]></category>
		<category><![CDATA[vCenter]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=539</guid>
		<description><![CDATA[So after playing around with my latest vCenter 5 installation I found that my logs were filling up with the following: Active Directory Web Services encountered an error while reading the settings for the specified Active Directory Lightweight Directory Services instance. Active Directory Web Services will retry this operation periodically. In the mean time, this [...]]]></description>
			<content:encoded><![CDATA[<p>So after playing around with my latest vCenter 5 installation I found that my logs were filling up with the following:</p>
<blockquote><p>Active Directory Web Services encountered an error while reading the settings for the specified Active Directory Lightweight Directory Services instance. Active Directory Web Services will retry this operation periodically. In the mean time, this instance will be ignored. Instance name: ADAM_VMwareVCMSDS</p></blockquote>
<p>I remember this happening before in vCenter 4.1, the fix was to modify a registry key for the Port SSL Value.  Here is where you need to modify it for vCenter 5.x:</p>
<ul>
<li>Key:  <em>HKLM\System\CurrentControlSet\Services\ADAM_VMwareVCMSDS\Parameters</em></li>
<li>Value:  <em>Port SSL</em></li>
<li>Type:  <em>REG_DWORD</em></li>
<li>Data:  <em>636</em></li>
</ul>
<p>You will notice that there is already a value there but it is a <em>REG_SZ</em>.  You will need to delete this one and create the above value.  Once you do this, restart the VMwareVCMSDS service and you should be good to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2012/01/vcenter-5-vmwarevcmsds-errors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HP and Emulex CIM Providers on ESXi 5</title>
		<link>http://vsential.com/2012/01/hp-emulex-cim-providers-esxi-5/</link>
		<comments>http://vsential.com/2012/01/hp-emulex-cim-providers-esxi-5/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 15:00:50 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[5.0]]></category>
		<category><![CDATA[Emulex]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[HP]]></category>
		<category><![CDATA[vMA]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=534</guid>
		<description><![CDATA[It looks like HP and Emulex have finally worked out their differences with their CIM providers.  As some of you will remember, you were unable to install Emulex CIM Providers after or with the HP Offline Bundle installed.  This was something that plagued admins for a while because it was often hit or miss whether [...]]]></description>
			<content:encoded><![CDATA[<p>It looks like HP and Emulex have finally worked out their differences with their CIM providers.  As some of you will remember, you were unable to install Emulex CIM Providers after or with the HP Offline Bundle installed.  This was something that plagued admins for a while because it was often hit or miss whether you could use them at the same time or not.  I know from my experience I have not been able to have them both loaded until HP and Emulex released their latest CIM Provider bundles.</p>
<p>I installed the following bundles via the vMA and in the following order:</p>
<ol>
<li><em><strong>hp-esxi5.0uX-bundle-1.1-37.zip</strong></em> &#8211; Available in HP&#8217;s Software Depot (<a href="https://h20392.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=HPVM09">Link</a>)</li>
<li><em><strong>vmw-esx-5.0.0-emulex-3.4.15.5-01-offline_bundle-486461.zip</strong></em> &#8211; Available on Emulex&#8217;s Support Site (<a href="http://www.emulex.com/downloads/emulex/vmware/vsphere-50/management.html">Link</a>)</li>
</ol>
<p>For those of you who are would like to install these as I did on some standalone hosts, you can follow these steps:</p>
<ol>
<li>Upload the above bundles to your hosts&#8217; datastore.</li>
<li>Login to your vMA.</li>
<li>Set your target:  <strong><em>vifptarget -s esxi01.vsential.net</em></strong></li>
<li>Put host into maintenance mode:  <strong><em>vicfg-hostops &#8211;operation enter</em></strong></li>
<li>Run:  <strong><em>esxcli software vib install </em><em>-d &#8220;[DatastoreName]<strong><em><em><strong>vmw-esx-5.0.0-emulex-3.4.15.5-01-offline_bundle-486461.zip</strong></em></em></strong>&#8220;</em></strong> (This will require a reboot!)</li>
<li>Reboot host.  (Command: <strong><em>vicfg-hostops &#8211;operation reboot</em></strong>)</li>
<li>When host comes back online, run:  <strong><em>esxcli software vib install </em><em>-d &#8220;[DatastoreName]<em><strong><strong><em>hp-esxi5.0uX-bundle-1.1-37.zip</em></strong></strong></em>&#8220;</em></strong> (This will require a reboot!)</li>
<li>Reboot host.  (Command: <strong><em>vicfg-hostops &#8211;operation reboot</em></strong>)</li>
<li>When host comes back online, run:  <strong><em>vicfg-hostops &#8211;operation exit</em></strong></li>
<li>Finished!</li>
</ol>
<p>Your host should now have the Emulex and HP CIM Providers installed and useable.  Let me know if this works for you and sound off in the comments.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2012/01/hp-emulex-cim-providers-esxi-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling SNMP on ESXi 5</title>
		<link>http://vsential.com/2012/01/enabling-snmp-esxi-5/</link>
		<comments>http://vsential.com/2012/01/enabling-snmp-esxi-5/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 15:00:47 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[5.0]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[vMA]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=531</guid>
		<description><![CDATA[Some people have asked how to enable SNMP on ESXi 5.  The process is identical to how you would on ESXi 4.x.  Here’s how: Connect to your vMA instance through Putty, SecureCRT or whatever app you use. Add the server:  vifp addserver vs-esxi.vsential.com (This is only needed if you haven&#8217;t already added the target!) Set [...]]]></description>
			<content:encoded><![CDATA[<p>Some people have asked how to enable SNMP on ESXi 5.  The process is identical to how you would on ESXi 4.x.  Here’s how:</p>
<ol>
<li>Connect to your vMA instance through Putty, SecureCRT or whatever app you use.</li>
<li>Add the server:  <em>vifp addserver vs-esxi.vsential.com </em>(This is only needed if you haven&#8217;t already added the target!)<em><br />
</em></li>
<li>Set your target:  <em>vifptarget -s vs-esxi.vsential.com</em></li>
<li>Configure SNMP Community:  <em>vicfg-snmp &#8211;communities vscomname</em></li>
<li>Configure SNMP Trap Host:  <em>vicfg-snmp &#8211;targets TrapHostIP@161/vscomname</em></li>
<li>Enable SNMP on the ESXi host:  <em>vifcfg-snmp &#8211;enable</em></li>
</ol>
<p>You can show the configuration by typing:  <em>vicfg-snmp &#8211;show</em></p>
<p>That’s it…now you can snmpwalk the host from the Trap host you configured earlier by typing:  <em>snmpwalk -v2c -cvscomname vs-esxi.vsential.com</em></p>
<p>You can check out VMware KB Article 1008065 for information on how to configure this as well which uses VMware vSphere RCLI instead of the vMA.</p>
<p>If you have any questions, comments, or suggestions then please sound off in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2012/01/enabling-snmp-esxi-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESXi 5.0 and Remote syslog</title>
		<link>http://vsential.com/2012/01/esxi-5-0-remote-syslog/</link>
		<comments>http://vsential.com/2012/01/esxi-5-0-remote-syslog/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 14:11:50 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[5.0]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[vMA]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=528</guid>
		<description><![CDATA[So I have started laying out the beginnings of the new vSphere 5 infrastructure at my work.  Got a couple of hosts laid out, vCenter built up, and dotting my i&#8217;s.  The particular piece I was working on just a few moments ago was remote syslog for the ESXi hosts. We all know that with [...]]]></description>
			<content:encoded><![CDATA[<p>So I have started laying out the beginnings of the new vSphere 5 infrastructure at my work.  Got a couple of hosts laid out, vCenter built up, and dotting my i&#8217;s.  The particular piece I was working on just a few moments ago was remote syslog for the ESXi hosts.</p>
<p>We all know that with the release of vMA 5 that vi-logger was removed from the distribution&#8230;why I am not sure&#8230;but it was.  This doesn&#8217;t mean that you can&#8217;t still use the vMA for logging.  In comes good ol&#8217; syslog-ng which is standard in the distribution.  The configuration was done with some tips from <a href="http://www.virtuallyghetto.com/2011/07/free-linux-windows-syslog-alternatives.html">VirtuallyGhetto</a> so I won&#8217;t go into the details of that portion as to not recreate the wheel.</p>
<p>Onwards!!!</p>
<p>In order to configure an ESXi host for remote logging we can do this from either the GUI or from the vMA using esxcli when connected to each host.  In the GUI, you will find the settings in <em><strong>Host Configuration-&gt;Advanced Settings-&gt;Syslog</strong></em>.  The information that is immediately pertinent is the Syslog.global.logHost.  When adding something to this field you need to follow the following format: <strong><em>protocol://RemoteSyslogServer:port</em></strong>.</p>
<p>When configuring this from the vMA using esxcli, just connect to your target and run:</p>
<p><strong><em>esxcli system syslog set &#8211;loghost=protocol://RemoteSyslogServer:port</em></strong></p>
<p><strong><em></em></strong>This will configure the target host with your remote syslog server information.  In immediate thought you would think this would get it to start working&#8230;nope&#8230;we aren&#8217;t done yet.  After you configure the remote syslog server information you will need to open the outbound ports on your ESXi hosts&#8217; firewalls.  This can be done through <em><strong>Host Configuration-&gt;Security Profile-&gt;Firewall Properties</strong></em>.  Just enable the syslog outbound connections and this portion is all set.  Finished&#8230;NOPE!  PSYCH!</p>
<p>Another step that is required before logging actually starts to work is to reload the syslog service on your target hosts.  You can do this from the vMA by connecting to your target hosts and running:  <strong><em>esxcli system syslog reload</em></strong></p>
<p><strong><em></em></strong>Finally, you can sit back and relax while your hosts start to log to your vMA host.  Enjoy!</p>
<p>Here are some references you can look to for guidance:</p>
<ul>
<li>vSphere 5 Documentation Center (Remote Logging Setup in ESXi) &#8211; <a href="http://pubs.vmware.com/vsphere-50/topic/com.vmware.vcli.migration.doc_50/cos_upgrade_technote.1.6.html?path=6_2_3_0#1076323">http://pubs.vmware.com/vsphere-50/topic/com.vmware.vcli.migration.doc_50/cos_upgrade_technote.1.6.html?path=6_2_3_0#1076323</a></li>
<li>VirtuallyGhetto (Free Linux &amp; Windows Syslog Alternatives to deprecated vi-logger in vMA 5) &#8211; <a href="http://www.virtuallyghetto.com/2011/07/free-linux-windows-syslog-alternatives.html">http://www.virtuallyghetto.com/2011/07/free-linux-windows-syslog-alternatives.html</a></li>
</ul>
<p>If you have any questions or comments then please feel free to sound off in the comments!</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2012/01/esxi-5-0-remote-syslog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vSphere Lab Give Away</title>
		<link>http://vsential.com/2011/12/vsphere-lab-give/</link>
		<comments>http://vsential.com/2011/12/vsphere-lab-give/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 15:26:17 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Contest]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=524</guid>
		<description><![CDATA[So one of our community well-known and appreciated people has found a way to make someone&#8217;s year a special one.  Cody Bunch over at ProfessionalVMware.com has put together an awesome give away.  This give away consists of a vSphere Training package.  It will include some great books, video training, software, and the big kicker, lab [...]]]></description>
			<content:encoded><![CDATA[<p>So one of our community well-known and appreciated people has found a way to make someone&#8217;s year a special one.  <a href="http://twitter.com/cody_bunch">Cody Bunch</a> over at <a href="http://professionalvmware.com">ProfessionalVMware.com</a> has put together an awesome give away.  This give away consists of a vSphere Training package.  It will include some great books, video training, software, and the big kicker, lab gear!  I won&#8217;t go into too much detail since you can grab all the details at the following link:</p>
<p><a href="http://professionalvmware.com/2011/12/brownbag-blow-out-vsphere-lab-give-away/">http://professionalvmware.com/2011/12/brownbag-blow-out-vsphere-lab-give-away/</a></p>
<p>From what I can see the additions of more prizes tied to this awesome give away just keep piling in.  Go over to ProfessionalVMware.com and check it out&#8230;go ahead and sign up for it&#8230;maybe you will soon have a lab to build on your knowledge of VMware products.</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2011/12/vsphere-lab-give/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tool: UBERAlign by Nick Weaver</title>
		<link>http://vsential.com/2011/11/tool-uberalign-nick-weaver/</link>
		<comments>http://vsential.com/2011/11/tool-uberalign-nick-weaver/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 14:00:17 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Tool]]></category>
		<category><![CDATA[VMDK]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=519</guid>
		<description><![CDATA[We all know that one of the biggest performance killers in our virtual environments is the wonderful alignment of partitions so that they may work in harmony and produce many I/Os with our SANs.  There are a few good tools out there for us to use but we are often caught in the middle of [...]]]></description>
			<content:encoded><![CDATA[<p>We all know that one of the biggest performance killers in our virtual environments is the wonderful alignment of partitions so that they may work in harmony and produce many I/Os with our SANs.  There are a few good tools out there for us to use but we are often caught in the middle of having to purchase the product or only have access to a vendor specific application for doing this.</p>
<h3>The wait is over!  Let the alignment begin!</h3>
<blockquote><p>Presenting UBERAlign, a tool for VMware Virtual Machine alignment and Space Reclamation</p></blockquote>
<p>Some of the features:</p>
<ul>
<li>Allows for fast alignment checking of virtual machines with detailed logging.</li>
<li>Can perform alignment to any offset you want. Even the crazy ones that you shouldn’t choose.</li>
<li>Works with both <strong>Windows 2000/XP</strong><strong>/2003/2008 (NTFS)</strong> and<strong> Linux Distros (EXT2/EXT3/EXT4).</strong></li>
<li>Is able to work on <strong>NTFS boot drives perfectly</strong>. It does this by rewriting NTFS Metadata (the right way).</li>
<li>Auto detects Windows 2008 and Windows 7 native installs (alignment not needed). Will not touch a System Reserved Partition (important for Windows 2008).</li>
<li>Preserves all Windows drive mapping (AFAIK only one to do so). This means no having to remap drive letters and complete support for non “C:\”  system drives with some Windows builds (some Citrix stuff).</li>
<li><strong>Completely Storage Array agnostic</strong>. That’s right: if it connects to vSphere and host storage UBERAlign will work with it.</li>
</ul>
<p>That list is only a small portion of the feature list.  The best part of all of this is that this tools is completely free.  Thanks to Nick over at Nickapedia (<a href="http://vsential.com/go/nickapedia/">http://nickapedia.com</a>) for taking the time to develop such a great tool and bring it into the community for that awesome price of <strong>FREE</strong>!</p>
<p>Head over to Nickapedia to read more and download the tool.  The link is: <a href="http://vsential.com/go/UBERalign/">http://nickapedia.com/2011/11/03/straighten-up-with-a-new-uber-tool-presenting-uberalign/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2011/11/tool-uberalign-nick-weaver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SLES 11/11sp1 Cloning or Deploy from Template Network Interface Fix</title>
		<link>http://vsential.com/2011/11/sles-1111sp1-cloning-deploy-template-network-interface-fix/</link>
		<comments>http://vsential.com/2011/11/sles-1111sp1-cloning-deploy-template-network-interface-fix/#comments</comments>
		<pubDate>Tue, 15 Nov 2011 14:00:36 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[SLES]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[vSphere]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=517</guid>
		<description><![CDATA[So we have all seen the wonderful cloning or deploying from template of a SLES VM and suddenly the network interface changes to eth1 and you have no network connectivity.  This is in part due to the use of udev and persistent naming.  As of SLES 11, the FORCE_PERSISTENT_NAMES option has been removed.  Here are [...]]]></description>
			<content:encoded><![CDATA[<p>So we have all seen the wonderful cloning or deploying from template of a SLES VM and suddenly the network interface changes to eth1 and you have no network connectivity.  This is in part due to the use of udev and persistent naming.  As of SLES 11, the FORCE_PERSISTENT_NAMES option has been removed.  Here are the steps to a work-around for this to enable happy cloning and deployment from a SLES template:</p>
<ol>
<li>Convert your template VM back to a normal VM.</li>
<li>Boot your VM and login.</li>
<li>cp /etc/udev/rules.d/70-persistent-net.rules /root/.</li>
<li>rm /etc/udev/rules.d/70-persistent-net.rules</li>
<li>Shutdown the VM.</li>
<li>Convert back to a template.</li>
</ol>
<p>Once you do this, every time you deploy from your template a new 70-persistent-net.rules file will be generated with the new MAC address of the virtualized interface.</p>
<p>For reference, you can look at VMware KB Article 1021624 for information regarding this.</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2011/11/sles-1111sp1-cloning-deploy-template-network-interface-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMTN Subscription Coming Back?</title>
		<link>http://vsential.com/2011/11/vmtn-subscription-coming-back/</link>
		<comments>http://vsential.com/2011/11/vmtn-subscription-coming-back/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 16:40:49 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Licensing]]></category>
		<category><![CDATA[VMTN]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=514</guid>
		<description><![CDATA[So there has been a spark of another conversation regarding the VMTN Subscription.  For those of you who are unaware of what this is/was, it was a service similar to Microsoft&#8217;s MSDN Subscription which allowed, for a flat yearly fee, users to be able to run VMware&#8217;s software within your lab environment. Should VMware bring [...]]]></description>
			<content:encoded><![CDATA[<p>So there has been a spark of another <a href="http://communities.vmware.com/thread/335123">conversation</a> regarding the VMTN Subscription.  For those of you who are unaware of what this is/was, it was a service similar to Microsoft&#8217;s MSDN Subscription which allowed, for a flat yearly fee, users to be able to run VMware&#8217;s software within your lab environment.</p>
<p>Should VMware bring this back to light?  In my opinion, yes, this would definitely be a smart move.  Not only would this benefit those of us who have home labs, it would then be extended to others who could not originally do this.  It would allow companies to maintain a similar lab and also allow for even more exposure for VMware and their line of products.</p>
<p>It has been verified by Duncan Epping at <a href="http://www.yellow-bricks.com/2011/11/08/investigating-the-options-to-bring-back-vmtn-subscriptions/">Yellow Bricks</a> that the message has been heard and the talks are stirring.  I urge you to follow both the above linked conversation on the VMTN forums and also follow the #VMTNrevolution hash tag on Twitter.  The more we push for it, the more likely VMware is to answer our call.  So don&#8217;t be shy, help start the #VMTNrevolution and support the push today!  Sound off in the comments with your thoughts!</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2011/11/vmtn-subscription-coming-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script:  Track-Datastores.ps1</title>
		<link>http://vsential.com/2011/10/script-track-datastores-ps1/</link>
		<comments>http://vsential.com/2011/10/script-track-datastores-ps1/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 13:00:01 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[PowerCLI]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=506</guid>
		<description><![CDATA[#Global Functions #This function generates a nice HTML output that uses CSS for style formatting. function Generate-Report &#123; &#160; &#160; Write-Output &#34;&#60;html&#62;&#60;head&#62;&#60;title&#62;&#60;/title&#62;&#60;style type=&#34;&#34;text/css&#34;&#34;&#62;.Error {color:#FF0000;font-weight: bold;}.Title {background: #0077D4;color: #FFFFFF;text-align:center;font-weight: bold;}.Normal-left {text-align:left;}.Normal {text-align:center;}&#60;/style&#62;&#60;/head&#62;&#60;body&#62;&#60;table&#62;&#60;tr class=&#34;&#34;Title&#34;&#34;&#62;&#60;td colspan=&#34;&#34;3&#34;&#34;&#62;VMware Datastore Change Report&#60;/td&#62;&#60;/tr&#62;&#60;tr class=&#34;Title&#34;&#62;&#60;td&#62;Datastore&#60;/td&#62;&#60;td&#62;Difference(MB)&#60;/td&#62;&#60;td&#62;% Free&#60;/td&#62;&#60;/tr&#62;&#34; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; Foreach &#40;$line in $myColDiff&#41;&#123; &#160; &#160; &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container powershell railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:535px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">#Global Functions</span><br />
<span style="color: #008000;">#This function generates a nice HTML output that uses CSS for style formatting.</span><br />
<span style="color: #0000FF;">function</span> Generate<span style="color: pink;">-</span>Report <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot;&lt;html&gt;&lt;head&gt;&lt;title&gt;&lt;/title&gt;&lt;style type=&quot;</span><span style="color: #800000;">&quot;text/css&quot;</span><span style="color: #800000;">&quot;&gt;.Error {color:#FF0000;font-weight: bold;}.Title {background: #0077D4;color: #FFFFFF;text-align:center;font-weight: bold;}.Normal-left {text-align:left;}.Normal {text-align:center;}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;table&gt;&lt;tr class=&quot;</span><span style="color: #800000;">&quot;Title&quot;</span><span style="color: #800000;">&quot;&gt;&lt;td colspan=&quot;</span><span style="color: #800000;">&quot;3&quot;</span><span style="color: #800000;">&quot;&gt;VMware Datastore Change Report&lt;/td&gt;&lt;/tr&gt;&lt;tr class=&quot;</span>Title<span style="color: #800000;">&quot;&gt;&lt;td&gt;Datastore&lt;/td&gt;&lt;td&gt;Difference(MB)&lt;/td&gt;&lt;td&gt;% Free&lt;/td&gt;&lt;/tr&gt;&quot;</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">Foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$line</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$myColDiff</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot;&lt;td class=&quot;</span><span style="color: #800000;">&quot;Normal-left&quot;</span><span style="color: #800000;">&quot;&gt;$($line.name)&lt;/td&gt;&lt;td class=&quot;</span><span style="color: #800000;">&quot;Normal&quot;</span><span style="color: #800000;">&quot;&gt;$($line.Diff)&lt;/td&gt;&lt;td class=&quot;</span><span style="color: #800000;">&quot;Normal&quot;</span><span style="color: #800000;">&quot;&gt;$($line.PercentFree)&lt;/td&gt;&lt;/tr&gt; &quot;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Output</span> <span style="color: #800000;">&quot;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;&quot;</span> <br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #008000;"># Variables #</span><br />
<span style="color: #008000;">#############</span><br />
<br />
<span style="color: #800080;">$VIServer</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;VISERVER&quot;</span><br />
<span style="color: #800080;">$username</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;changeme&quot;</span><br />
<span style="color: #800080;">$password</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;supersecret&quot;</span><br />
<span style="color: #800080;">$digits</span> <span style="color: pink;">=</span> <span style="color: #804000;">2</span><br />
<span style="color: #800080;">$Folder</span> <span style="color: pink;">=</span> <span style="color: #800000;">'C:\Reports'</span><br />
<span style="color: #800080;">$currentFile</span> <span style="color: pink;">=</span> <span style="color: #800000;">'Datastores_Current.xml'</span><br />
<span style="color: #800080;">$previousFile</span> <span style="color: pink;">=</span> <span style="color: #800000;">'Datastores_Previous.xml'</span><br />
<br />
<span style="color: #008000;"># Script #</span><br />
<span style="color: #008000;">##########</span><br />
<br />
<span style="color: #008000;"># First, if a Current file exists, rename this Current file to Previous</span><br />
<br />
<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Test-Path</span> <span style="color: #800000;">&quot;$Folder\$currentFile&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Remove-Item</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800000;">&quot;$Folder\$previousFile&quot;</span> <span style="color: #008080; font-style: italic;">-Force</span><br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Rename-Item</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800000;">&quot;$Folder\$currentFile&quot;</span> <span style="color: #008080; font-style: italic;">-NewName</span> <span style="color: #800080;">$previousFile</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;"># Next, let's measure and save current datastore sizes</span><br />
<br />
<span style="color: #008000;"># Connect to Virtual Center</span><br />
<span style="color: #800080;">$VC</span> <span style="color: pink;">=</span> Connect<span style="color: pink;">-</span>VIServer <span style="color: #800080;">$VIServer</span> <span style="color: pink;">-</span>user <span style="color: #800080;">$username</span> <span style="color: pink;">-</span>password <span style="color: #800080;">$password</span><br />
<br />
<span style="color: #008000;"># Get all datastores and put them in alphabetical order</span><br />
<span style="color: #800080;">$datastores</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>Datastore <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Sort-Object</span> Name<br />
<br />
<span style="color: #008000;"># Create an array to hold the output</span><br />
<span style="color: #800080;">$myColCurrent</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008000;"># Loop through datastores</span><br />
<span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$store</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$datastores</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Create a custom object and define its properties</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$myObj</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&quot;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select-Object</span> Name<span style="color: pink;">,</span> CapacityGB<span style="color: pink;">,</span> UsedGB<span style="color: pink;">,</span> PercFree<br />
&nbsp; &nbsp; <span style="color: #008000;"># Set the values of each property</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.Name <span style="color: pink;">=</span> <span style="color: #800080;">$store</span>.name<br />
&nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.CapacityGB <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>math<span style="color: #000000;">&#93;</span>::Round<span style="color: #000000;">&#40;</span><span style="color: #800080;">$store</span>.capacityMB<span style="color: pink;">/</span><span style="color: #804000;">1024</span><span style="color: pink;">,</span><span style="color: #800080;">$digits</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.UsedGB <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>math<span style="color: #000000;">&#93;</span>::Round<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$store</span>.CapacityMB <span style="color: pink;">-</span> <span style="color: #800080;">$store</span>.FreeSpaceMB<span style="color: #000000;">&#41;</span><span style="color: pink;">/</span><span style="color: #804000;">1024</span><span style="color: pink;">,</span><span style="color: #800080;">$digits</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$myObj</span>.PercFree <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>math<span style="color: #000000;">&#93;</span>::Round<span style="color: #000000;">&#40;</span><span style="color: #804000;">100</span><span style="color: pink;">*</span><span style="color: #800080;">$store</span>.FreeSpaceMB<span style="color: pink;">/</span><span style="color: #800080;">$store</span>.CapacityMB<span style="color: pink;">,</span><span style="color: #800080;">$digits</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Add the object to the output array</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$myColCurrent</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$myObj</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #008000;"># Export the output to an xml file; the new Current file</span><br />
<span style="color: #800080;">$myColCurrent</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Export-Clixml</span> <span style="color: #008080; font-style: italic;">-Path</span> <span style="color: #800000;">&quot;$Folder\$currentFile&quot;</span><br />
<br />
<span style="color: #008000;"># Disconnect from Virtual Center</span><br />
Disconnect<span style="color: pink;">-</span>VIServer <span style="color: #008080; font-style: italic;">-Confirm</span>:<span style="color: #800080;">$False</span><br />
<br />
<span style="color: #008000;"># Finally, let's compare the Current information to that in the Previous file</span><br />
<br />
<span style="color: #008000;"># Check if a Previous file exists</span><br />
<span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Test-Path</span> <span style="color: #800000;">&quot;$Folder\$previousFile&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Import the Previous file</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$myColPrevious</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Import-Clixml</span> <span style="color: #800000;">&quot;$Folder\$previousFile&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Create an array to hold the differences</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$myColDiff</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># Loop through the current datastores</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$myObjCurrent</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$myColCurrent</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># The actual compare command</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$diff</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Compare-Object</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$myColPrevious</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.Name <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$myObjCurrent</span>.Name <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span> <span style="color: #800080;">$myObjCurrent</span> <span style="color: #008080; font-style: italic;">-Property</span> PercFree<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># In case of any differences, try to get specifics</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$diff</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># Again, a custom object and properties for outputting results</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObjDiff</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;&quot;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select-Object</span> Name<span style="color: pink;">,</span> PercentFree<span style="color: pink;">,</span> <span style="color: #008080; font-weight: bold;">Diff</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># Again, setting the values of each property</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObjDiff</span>.Name <span style="color: pink;">=</span> <span style="color: #800080;">$myObjCurrent</span>.Name<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObjDiff</span>.PercentFree <span style="color: pink;">=</span> <span style="color: #800080;">$myObjCurrent</span>.PercFree<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># The most important property is the calculated difference between the current and previous values of PercFree. You can substitute it for UsedGB if you like.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myObjDiff</span>.<span style="color: #008080; font-weight: bold;">Diff</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$diff</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.SideIndicator <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">'=&gt;'</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>.PercFree <span style="color: pink;">-</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$diff</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.SideIndicator <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">'&lt;='</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span>.PercFree<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># And agin, adding it to the output array</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myColDiff</span> <span style="color: pink;">+=</span> <span style="color: #800080;">$myObjDiff</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># Clearing the variable used inside the loop to prevent incorrect output in case of problems setting the variable!</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Clear-Variable</span> <span style="color: #008080; font-weight: bold;">diff</span> <span style="color: #008080; font-style: italic;">-ErrorAction</span> <span style="color: #800000;">&quot;SilentlyContinue&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># If nothing changed, we don't want an empty file.</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">If</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$myColDiff</span>.Length <span style="color: #FF0000;">-eq</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$myColDiff</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;No changes since last check.&quot;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #008000;"># And we conclude by outputting the results to a text file, which can be emailed or printed.</span><br />
&nbsp; &nbsp; Generate<span style="color: pink;">-</span>Report <span style="color: pink;">&gt;</span> <span style="color: #800000;">&quot;$Folder\Track-Datastore.html&quot;</span><br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #0000FF;">IF</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$myColDiff</span> <span style="color: #FF0000;">-ne</span> <span style="color: #800000;">&quot;No changes since last check.&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$SmtpClient</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> system.net.mail.smtpClient<br />
&nbsp; &nbsp; <span style="color: #800080;">$SmtpClient</span>.host <span style="color: pink;">=</span> <span style="color: #800000;">&quot;my.smtp.host&quot;</span> &nbsp; <span style="color: #008000;">#Change to a SMTP server in your environment</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$MailMessage</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> system.net.mail.mailmessage<br />
&nbsp; &nbsp; <span style="color: #800080;">$MailMessage</span>.from <span style="color: pink;">=</span> <span style="color: #800000;">&quot;System.Automation@example.com&quot;</span> &nbsp; <span style="color: #008000;">#Change to email address you want emails to be coming from</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$MailMessage</span>.To.add<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;yomomma@example.com&quot;</span><span style="color: #000000;">&#41;</span>&nbsp; <span style="color: #008000;">#Change to email address you would like to receive emails.</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$MailMessage</span>.IsBodyHtml <span style="color: pink;">=</span> <span style="color: #804000;">1</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$MailMessage</span>.Subject <span style="color: pink;">=</span> <span style="color: #800000;">&quot;VMware Datastore Change Report&quot;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$MailMessage</span>.Body <span style="color: pink;">=</span> Generate<span style="color: pink;">-</span>Report<br />
&nbsp; &nbsp; <span style="color: #800080;">$SmtpClient</span>.Send<span style="color: #000000;">&#40;</span><span style="color: #800080;">$MailMessage</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#125;</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2011/10/script-track-datastores-ps1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESXi 5.0 and APC SmartUPS 1000</title>
		<link>http://vsential.com/2011/09/esxi-5-0-apc-smartups-1000/</link>
		<comments>http://vsential.com/2011/09/esxi-5-0-apc-smartups-1000/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 16:02:00 +0000</pubDate>
		<dc:creator>jamesbowling</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[5.0]]></category>
		<category><![CDATA[ESXi]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[vCLI]]></category>
		<category><![CDATA[vMA]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://vsential.com/?p=491</guid>
		<description><![CDATA[So the company I work for had a deployment scenario in place for there remote branches utilizing VMware Server 2 prior to me coming onboard.  I was tasked with the redesign of our remote branch virtualization infrastructure.  In comes ESXi 5.0 to replace the fading away VMware Server.  Initially they were using a software-based RAID [...]]]></description>
			<content:encoded><![CDATA[<p>So the company I work for had a deployment scenario in place for there remote branches utilizing VMware Server 2 prior to me coming onboard.  I was tasked with the redesign of our remote branch virtualization infrastructure.  In comes ESXi 5.0 to replace the fading away VMware Server.  Initially they were using a software-based RAID which was controlled through a SLES installation.  With the requirements of ESXi we all know that software RAID is not an option.  We have since decided on utilizing an Adaptec 2405 RAID controller for these remote servers.  Now that my test lab can boot into ESXi I can move forward with the remaining requirements.</p>
<p>&nbsp;</p>
<h3>Clean Shutdown of VMs and Host</h3>
<p>In order for us to have the ability to interface with the APC SmartUPS 1000&#8242;s that we have at each location for the server we must find a way to install the APC PowerChute Business Edition Agent (PCBEAgent) for use with monitoring and shutting down the host and VMs.  In comes the vSphere Management Assistant (vMA).</p>
<div class='et-box et-warning'>
					<div class='et-box-content'>Please note that this setup IS NOT a supported solution by either VMware or APC. Use of this method is at the sole discretion of the admin and the teams supporting the sites!</div></div>
<p>In order to install the APC PCBEAgent, we needed either a Linux VM or a Windows VM.  In the light of trying to architect a solution that minimizes costs and addition of other hardware, we selected a Linux VM or in this case the vMA.  The vMA is a SLES4VMware-based appliance and therefore gives us the ability to build or install agents accordingly.  Finally, we just grabbed the installer from APC for the RPM which could be installed on the vMA.  Installation on the vMA was simple:</p>
<div class='et-box et-shadow'>
					<div class='et-box-content'># rpm -ivh pbeagent-xxx.i386.rpm</div></div>
<p>This placed the PBEAgent in /opt/APC/PowerChuteBusinessEdition/Agent.  This will also install the startup script in /etc/init.d.  Once it is installed you will need to do the initial configuration by running the config.sh script from within the aforementioned directory.  This will allow you to setup the administrative username and password to login and control the agent from the webUI that the agent starts.  After you have configured it should start the agent, if not, just start the agent manually.  The startup script is PBEAgent and can be started via /etc/init.d/PBEAgent start.  Once you start the agent you can connect to it via https://&lt;vMA-IP&gt;:6547.  Once you are in the webUI you will notice that there is no communication with the APC unit.  Here brings us into the next step, configure Serial Passthrough on the vMA appliance.</p>
<p>&nbsp;</p>
<h3>Serial Passthrough on the vMA Appliance</h3>
<p>In order to configure Serial Passthrough you must power down the vMA appliance.  Once you have powered down the vMA appliance you can add the Serial Port interface on the VM.  You will select the &#8220;Use physical port&#8221; option and it should show a device similar to this:  /dev/char/serial/uart0</p>
<p>Once this is done power your vMA appliance back on and connect to the PBEAgent webUI.  Make sure that you have the APC SmartUPS serial cable connected.  It is important to note that you MUST use the provided cable as the pinout is special.  From here you will need to configure the UPS.  You will want to select &#8220;Server Shutdown&#8221; option on the left side and then select &#8220;System Settings&#8221;.  Here you will be presented with the options for the signaling type (Smart/Simple/Simple with Interface Expander).  You will want to select Smart and for the port use /dev/sttyS0.  Once you have done this select the &#8220;Smart-UPS 1000&#8243; option on the left side to view the status.  If everything was done correctly you should see the Device Status as On line and some other information on the status page.</p>
<p>&nbsp;</p>
<h3>Configure Server Shutdown Script</h3>
<p>Now that we have the proper communication with the UPS and the vMA we need to configure the shutdown script to execute accordingly when we either reach a specified threshold for battery power or as soon as the unit senses loss of power.  I will not go into the details of how to select or configure each but feel free to sound off in the comments if you need help.  All of the scripts or &#8220;cmdfiles&#8221; (as APC calls them) are located in /opt/APC/PowerChuteBusinessEdition/Agent/cmdfiles.  I have created a simple script that utilizes the vCLI SDK.  Here is the script:</p>
<div class="codecolorer-container bash railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:535px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># VmShutdown.sh - Script to gracefully shutdown VMs and Host</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Shutdown Guest VMs</span><br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>vmware-vcli<span style="color: #000000; font-weight: bold;">/</span>apps<span style="color: #000000; font-weight: bold;">/</span>vm<span style="color: #000000; font-weight: bold;">/</span>vmcontrol.pl <span style="color: #660033;">--username</span> root <span style="color: #660033;">--password</span> password <span style="color: #660033;">--operation</span> shutdown <span style="color: #660033;">--vmname</span> TESTVM01 <span style="color: #660033;">--url</span> https:<span style="color: #000000; font-weight: bold;">///</span>sdk<span style="color: #000000; font-weight: bold;">/</span>webService<br />
<br />
<span style="color: #666666; font-style: italic;"># Shutdown ESXi Host</span><br />
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>vicfg-hostops <span style="color: #660033;">--server</span> <span style="color: #660033;">--username</span> root <span style="color: #660033;">--password</span> password <span style="color: #660033;">--operation</span> shutdown <span style="color: #660033;">--force</span> <span style="color: #660033;">--url</span> https:<span style="color: #000000; font-weight: bold;">///</span>sdk<span style="color: #000000; font-weight: bold;">/</span>webService</div></div>
<p>The script can be expanded upon to fit your needs but for the sake of simplicity I have only regarded a single VM and the host itself.  The script must be chmod&#8217;d for execution which can be done via chmod 755 /opt/APC/PowerChuteBusinessEdition/Agent/cmdfiles/VmShutdown.sh.</p>
<p>&nbsp;</p>
<h3>Configure the cmdfile within the PBEAgent</h3>
<p>Login back into your PBEAgent webUI.  From here select &#8220;Events&#8221; on the left side and then select &#8220;Actions&#8221;.  You will be presented with a long list of Event Actions.  You will want to make sure that the events you want to execute shutdown on are showing that shutdown is selected for the event.</p>
<p>Next we will configure the Shutdown Settings to utilize this cmdfile.  Select &#8220;Server Shutdown&#8221; on the left side and then &#8220;Shutdown Settings&#8221;.  You are then presented with the Shutdown Sequence Summary.  At the bottom you can click on &#8220;Configure&#8221;.  Click Configure and then scroll to the bottom where you can see &#8220;Command File&#8221;.  Check the checkbox and from the dropdown, select the script to execute.  I have configured a file execution duration of 2 minutes to allow for the script to execute fully before the vMA gets shutdown by the PBEAgent itself.  You can adjust this to your liking depending on the need and amount of VMs on the single host.  Once you have configured this, click on &#8220;Apply&#8221;.</p>
<p>&nbsp;</p>
<h3>Fin</h3>
<p>This concludes the configuration of the PBEAgent for use on an ESXi standalone host.  This should now allow for a clean shutdown of both your VMs and the ESXi host itself.  It you have any questions then please sound off in the comments below!  Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://vsential.com/2011/09/esxi-5-0-apc-smartups-1000/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

