<?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>Maartendamen&#039;s blog &#187; hp</title>
	<atom:link href="http://www.maartendamen.com/tag/hp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maartendamen.com</link>
	<description>Blogging on various IT subjects</description>
	<lastBuildDate>Tue, 22 Nov 2011 21:27:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Mass creation of HP WSEM WiFi guest accounts using SSH and PowerShell</title>
		<link>http://www.maartendamen.com/2010/07/mass-creation-of-hp-wsem-wifi-guest-accounts-using-ssh-and-powershell/</link>
		<comments>http://www.maartendamen.com/2010/07/mass-creation-of-hp-wsem-wifi-guest-accounts-using-ssh-and-powershell/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 13:58:51 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[hp]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[wsem]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=348</guid>
		<description><![CDATA[I was asked to create 365 (1 year) of WiFi (daily) guest access accounts, and export them to CSV. Of course I didn&#8217;t want to create them by hand.. this is where PowerShell came in. I used the following PowerShell script to create random WiFi guest accounts: Special thanks to Joel Bennett&#8217;s SharpSSH wrapper for [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked to create 365 (1 year) of WiFi (daily) guest access accounts, and export them to CSV.<br />
Of course I didn&#8217;t want to create them by hand.. this is where PowerShell came in. I used the following PowerShell script to create random WiFi guest accounts:</p>
<p><span id="more-348"></span></p>
<pre class="brush: powershell; title: ; notranslate">
# Number of days to generate, default = 365
$NumDays 		= 365
$AccessGroup 	= &quot;Gasten&quot;
$ExpiryTime 	= &quot;20:00&quot;
$StartTime 		= &quot;07:00&quot;
$OutputCSV		= &quot;C:\TEMP\wireless.csv&quot;

$SshHost 		= &quot;127.0.0.1&quot;
$SshUser		= &quot;someuser&quot;

$access_codes = @()

# Start SSH session
New-SshSession $SshUser $SshHost
Invoke-Ssh &quot;z&quot;
Invoke-Ssh &quot;conf t&quot;
Invoke-Ssh &quot;wireless F&quot;
Invoke-Ssh &quot;conf t&quot;
Invoke-Ssh &quot;radius-server local&quot;

$i = 0;
do {
	# WSEM format: mm/dd/yyyy hh:mm
	$date = (Get-Date).AddDays($i)
	$date2 = Get-Date $date -Format &quot;dd-MM-yyyy&quot;
	$date = Get-Date $date -format &quot;MM:dd:yyyy&quot;
	$pass = RandomPassword 4
	$user = RandomPassword 4
	$output = &quot;rad-user $user password 0 $pass group $AccessGroup guest expiry-time $ExpiryTime expiry-date $date start-time $StartTime start-date $date&quot;

	# add user through SSH
	Invoke-ssh $output

	$Response = New-Object PSObject
	Add-Member -InputObject $Response -MemberType NoteProperty -Name &quot;Datum&quot; -Value $date2
	Add-Member -InputObject $Response -MemberType NoteProperty -Name &quot;Gebruikersnaam&quot; -Value $user
	Add-Member -InputObject $Response -MemberType NoteProperty -Name &quot;Wachtwoord&quot; -Value $pass
	$access_codes += $Response

	$i++;
} while ( $i -le $NumDays )

# Save and disconnect SSH
Invoke-ssh &quot;write mem&quot;
Remove-SshSession

# Export to CSV
$access_codes | Export-Csv $OutputCSV

# Helper functions
function RandomPassword ([int]$intPasswordLength)
{
   $strNumbers = &quot;1234567890&quot;
   $strCapitalLetters = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;
   $strLowerLetters = &quot;abcdefghijklmnopqrstuvwxyz&quot;
   $rand = new-object random

   for ($a=1; $a -le $intPasswordLength; $a++)
      {
         if ($a -gt 3)
           {
      	      $b = $rand.next(0,3) + $a
      	      $b = $b % 3 + 1
      	   } else { $b = $a }
      	 switch ($b)
      	   {
      	      &quot;1&quot; {$b = &quot;$strNumbers&quot;}
      	      &quot;2&quot; {$b = &quot;$strCapitalLetters&quot;}
      	      &quot;3&quot; {$b = &quot;$strLowerLetters&quot;}
      	   }
         $charset = $($b)
         $number = $rand.next(0,$charset.Length)
         $RandomPassword += $charset[$number]
      }
   return $RandomPassword
}
</pre>
<p>Special thanks to Joel Bennett&#8217;s SharpSSH wrapper for PowerShell (located here: <a href="http://huddledmasses.org/scriptable-ssh-from-powershell/">http://huddledmasses.org/scriptable-ssh-from-powershell/</a>) which I used to automate the command line commands for the HP WSEM.<br />
This shows the great power of PowerShell for automating virtually anything! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2010/07/mass-creation-of-hp-wsem-wifi-guest-accounts-using-ssh-and-powershell/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>HP Insight Management Agent reports that unused VMware nics are down</title>
		<link>http://www.maartendamen.com/2010/07/hp-insight-management-agent-reports-that-unused-vmware-nics-are-down/</link>
		<comments>http://www.maartendamen.com/2010/07/hp-insight-management-agent-reports-that-unused-vmware-nics-are-down/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 14:14:28 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[VMware vSphere]]></category>
		<category><![CDATA[hp]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vsphere]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=341</guid>
		<description><![CDATA[When you don&#8217;t use certain nics on your VMware hosts, HP Insight Management Agents may report that the nics are down. Which is the natural behavior of these clients. The system management homepage on those hosts looks like this: To find out the vmnic number, simple click the error, the vmnic number is shown on [...]]]></description>
			<content:encoded><![CDATA[<p>When you don&#8217;t use certain nics on your VMware hosts, HP Insight Management Agents may report that the nics are down. Which is the natural behavior of these clients.<br />
The system management homepage on those hosts looks like this:</p>
<p><a href="http://www.maartendamen.com/wp-content/uploads/2010/07/vmware_nics1.png"><img src="http://www.maartendamen.com/wp-content/uploads/2010/07/vmware_nics1.png" alt="" title="vmware_nics1" width="403" height="177" class="alignnone size-full wp-image-342" /></a></p>
<p><span id="more-341"></span><br />
To find out the vmnic number, simple click the error, the vmnic number is shown on that page:</p>
<p><a href="http://www.maartendamen.com/wp-content/uploads/2010/07/vmware_nics2.png"><img src="http://www.maartendamen.com/wp-content/uploads/2010/07/vmware_nics2.png" alt="" title="vmware_nics2" width="725" height="126" class="alignnone size-full wp-image-343" /></a></p>
<p>To resolve this you simple have to put the nics into the &#8220;Down&#8221; state using &#8220;ifconfig&#8221;:</p>
<p><code>ifconfig vmnic3 down</code></p>
<p>To make this change more permanent (surviving reboots) you have to put the command in the file /etc/rc.local (this file is called once the host has been started)<br />
Here is an example rc.local disabling 2 nics:</p>
<p><code><br />
#!/bin/sh<br />
#<br />
# This script will be executed *after* all the other init scripts.<br />
# You can put your own initialization stuff in here if you don't<br />
# want to do the full Sys V style init stuff.</p>
<p>touch /var/lock/subsys/local<br />
ifconfig vmnic3 down<br />
ifconfig vmnic7 down<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2010/07/hp-insight-management-agent-reports-that-unused-vmware-nics-are-down/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VMware vSphere default pathing policy</title>
		<link>http://www.maartendamen.com/2009/11/vmware-vsphere-default-pathing-policy/</link>
		<comments>http://www.maartendamen.com/2009/11/vmware-vsphere-default-pathing-policy/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 21:05:49 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[VMware vSphere]]></category>
		<category><![CDATA[eva]]></category>
		<category><![CDATA[hp]]></category>
		<category><![CDATA[pathing]]></category>
		<category><![CDATA[policy]]></category>
		<category><![CDATA[san]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vsphere]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=7</guid>
		<description><![CDATA[I am currently building a new vSphere farm at my company. This also includes the storage part, which can become a load of work: First you have to fix up the physical cabling; next, you have to setup up the zoning; up next you have to present the virtual disks to the VMware hosts. Last [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently building a new vSphere farm at my company. This also includes the storage part, which can become a load of work:</p>
<ul>
<li>First you have to fix up the physical cabling;</li>
<li>next, you have to setup up the zoning;</li>
<li>up next you have to present the virtual disks to the VMware hosts.</li>
</ul>
<p>Last but not least you need to take care of pathing for your presented virtual disks. For our HP EVA SAN, vSphere defaults to the &#8220;Most Recently Used (VMware)&#8221; policy.<br />
In the past we used to manually load balance using fixed paths. <span id="more-7"></span>This was mainly because the round robin policy mechanism was still in an EXPERIMENTAL status.<br />
The round robin policy offers great advantages over the default MRU policy:</p>
<ul>
<li>The HP EVA offers ALUA (Asymmetrical Logical Unit Access). ALUA allows a LUN to be accessed via its primary path (via the owning Storage Processor) and via an asymmetrical path (via the not-owning Storage Processor) I/O to the not-owning Storage Processor or not-optimized path  comes with a performance penalty because the I/O has to be transmitted over the internal connection between the storage processors which does not have much bandwidth;</li>
<li>using ALUA in combination with Round Robin will load balance the I/O&#8217;s over the most optimized paths for that LUN;</li>
<li>the load is balanced between the two optimized paths rather then the most recently used path (as with the MRU policy).</li>
</ul>
<p>Setting the pathing policy for each individual LUN can become quite a job. Good thing there is a way to set the default pathing policy for new discovered LUN&#8217;s using &#8220;esxcli&#8221;</p>
<p><em>esxcli nmp satp setdefaultpsp -–psp VMW_PSP_RR –-satp &lt;Storage Array Type&gt;</em></p>
<p>To figure out the storage array type for your virtual disk, right click a LUN and select &#8220;Manage Paths&#8221; (the screenshot highlights the Storage Array Type.</p>
<p><img class="alignleft size-full wp-image-8" title="vmware_roundrobin" src="http://www.maartendamen.com/wp-content/uploads/2009/11/vmware_roundrobin.png" alt="vmware_roundrobin" width="726" height="231" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2009/11/vmware-vsphere-default-pathing-policy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

