<?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>Alessio Rocchi&#039;s Blog</title>
	<atom:link href="http://www.rocchi.us/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rocchi.us</link>
	<description>Just another geek&#039;s blog</description>
	<lastBuildDate>Thu, 12 Apr 2012 08:04:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Powershell Script to launch Windows Update</title>
		<link>http://www.rocchi.us/2012/04/powershell-script-to-lunch-windows-update/</link>
		<comments>http://www.rocchi.us/2012/04/powershell-script-to-lunch-windows-update/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 07:07:22 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[windows 2008 r2]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=294</guid>
		<description><![CDATA[This Script check if there are updates available on the machine, and in case, will lunch the complete update. function Get-WIAStatusValue&#40;$value&#41; &#123; switch -exact &#40;$value&#41; &#123; 0 &#123;&#34;NotStarted&#34;&#125; 1 &#123;&#34;InProgress&#34;&#125; 2 &#123;&#34;Succeeded&#34;&#125; 3 &#123;&#34;SucceededWithErrors&#34;&#125; 4 &#123;&#34;Failed&#34;&#125; 5 &#123;&#34;Aborted&#34;&#125; &#125; &#125; &#160; function Update-Windows&#40;&#41; &#123; $needsReboot = $false $UpdateSession = New-Object … <a href="http://www.rocchi.us/2012/04/powershell-script-to-lunch-windows-update/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>This Script check if there are updates available on the machine, and in case, will lunch the complete update.</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #0000FF;">function</span> Get<span style="color: pink;">-</span>WIAStatusValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
   <span style="color: #0000FF;">switch</span> <span style="color: #FF0000;">-exact</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span><span style="color: #000000;">&#41;</span>
   <span style="color: #000000;">&#123;</span>
      <span style="color: #804000;">0</span>   <span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;NotStarted&quot;</span><span style="color: #000000;">&#125;</span>
      <span style="color: #804000;">1</span>   <span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;InProgress&quot;</span><span style="color: #000000;">&#125;</span>
      <span style="color: #804000;">2</span>   <span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;Succeeded&quot;</span><span style="color: #000000;">&#125;</span>
      <span style="color: #804000;">3</span>   <span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;SucceededWithErrors&quot;</span><span style="color: #000000;">&#125;</span>
      <span style="color: #804000;">4</span>   <span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;Failed&quot;</span><span style="color: #000000;">&#125;</span>
      <span style="color: #804000;">5</span>   <span style="color: #000000;">&#123;</span><span style="color: #800000;">&quot;Aborted&quot;</span><span style="color: #000000;">&#125;</span>
   <span style="color: #000000;">&#125;</span> 
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0000FF;">function</span> Update<span style="color: pink;">-</span>Windows<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$needsReboot</span> <span style="color: pink;">=</span> <span style="color: #800080;">$false</span>
	<span style="color: #800080;">$UpdateSession</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #008080; font-style: italic;">-ComObject</span> Microsoft.Update.Session
	<span style="color: #800080;">$UpdateSearcher</span> <span style="color: pink;">=</span> <span style="color: #800080;">$UpdateSession</span>.CreateUpdateSearcher<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
	<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot; - Searching for Updates&quot;</span>
	<span style="color: #800080;">$SearchResult</span> <span style="color: pink;">=</span> <span style="color: #800080;">$UpdateSearcher</span>.Search<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;IsAssigned=1 and IsHidden=0 and IsInstalled=0&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
	<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot; - Found [$($SearchResult.Updates.count)] Updates to Download and install&quot;</span>
	<span style="color: #008080; font-weight: bold;">Write-Host</span>
&nbsp;
	<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$Update</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$SearchResult</span>.Updates<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #008000;"># Add Update to Collection</span>
		<span style="color: #800080;">$UpdatesCollection</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> <span style="color: #008080; font-style: italic;">-ComObject</span> Microsoft.Update.UpdateColl
		<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span> <span style="color: #800080;">$Update</span>.EulaAccepted <span style="color: #FF0000;">-eq</span> <span style="color: #804000;">0</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #800080;">$Update</span>.AcceptEula<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span>
		<span style="color: #800080;">$UpdatesCollection</span>.Add<span style="color: #000000;">&#40;</span><span style="color: #800080;">$Update</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out-Null</span>
&nbsp;
		<span style="color: #008000;"># Download</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot; + Downloading Update $($Update.Title)&quot;</span>
		<span style="color: #800080;">$UpdatesDownloader</span> <span style="color: pink;">=</span> <span style="color: #800080;">$UpdateSession</span>.CreateUpdateDownloader<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #800080;">$UpdatesDownloader</span>.Updates <span style="color: pink;">=</span> <span style="color: #800080;">$UpdatesCollection</span>
		<span style="color: #800080;">$DownloadResult</span> <span style="color: pink;">=</span> <span style="color: #800080;">$UpdatesDownloader</span>.Download<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #800080;">$Message</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;   - Download {0}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>WIAStatusValue <span style="color: #800080;">$DownloadResult</span>.ResultCode<span style="color: #000000;">&#41;</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$message</span>   
&nbsp;
		<span style="color: #008000;"># Install</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;   - Installing Update&quot;</span>
		<span style="color: #800080;">$UpdatesInstaller</span> <span style="color: pink;">=</span> <span style="color: #800080;">$UpdateSession</span>.CreateUpdateInstaller<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #800080;">$UpdatesInstaller</span>.Updates <span style="color: pink;">=</span> <span style="color: #800080;">$UpdatesCollection</span>
		<span style="color: #800080;">$InstallResult</span> <span style="color: pink;">=</span> <span style="color: #800080;">$UpdatesInstaller</span>.Install<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #800080;">$Message</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;   - Install {0}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>WIAStatusValue <span style="color: #800080;">$DownloadResult</span>.ResultCode<span style="color: #000000;">&#41;</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$message</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span>
&nbsp;
		<span style="color: #800080;">$needsReboot</span> <span style="color: pink;">=</span> <span style="color: #800080;">$installResult</span>.rebootRequired
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$needsReboot</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		restart<span style="color: pink;">-</span>computer
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2012/04/powershell-script-to-lunch-windows-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aruba Cloud… Il Test – Parte II</title>
		<link>http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-ii/</link>
		<comments>http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-ii/#comments</comments>
		<pubDate>Tue, 27 Mar 2012 13:55:17 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[aruba]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[virtualizzazione]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=283</guid>
		<description><![CDATA[Finalmente mi son deciso a postare i risultati del test riguardo CPU e RAM, per eseguire questi test ho istanziato una macchina Windows in quanto non avevo trovato nessun tool di benchmark che mi soddisfacesse lato Linux. La macchina che ho istanziato e` una VMWARE con 2 vCPU e 4 … <a href="http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-ii/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>Finalmente mi son deciso a postare i risultati del test riguardo CPU e RAM, per eseguire questi test ho istanziato una macchina Windows in quanto non avevo trovato nessun tool di benchmark che mi soddisfacesse lato Linux.</p>
<p>La macchina che ho istanziato e` una VMWARE con 2 vCPU e 4 GB di RAM.</p>
<p><a href="http://www.rocchi.us/wp-content/uploads/2012/03/win_system.png"><img class="aligncenter size-medium wp-image-284" title="win_system" src="http://www.rocchi.us/wp-content/uploads/2012/03/win_system-223x300.png" alt="" width="223" height="300" /></a></p>
<p>Il riepilogo dei punteggi e` il seguente:</p>
<p><a href="http://www.rocchi.us/wp-content/uploads/2012/03/win_summary.png"><img class="aligncenter size-medium wp-image-285" title="win_summary" src="http://www.rocchi.us/wp-content/uploads/2012/03/win_summary-300x48.png" alt="" width="300" height="48" /></a></p>
<p>&nbsp;</p>
<p>Andiamo ad analizzare punto per punto CPU RAM e nuovamente il Disco:</p>
<ul>
<li>CPU</li>
</ul>
<p><a href="http://www.rocchi.us/wp-content/uploads/2012/03/win_cpu.png"><img class="aligncenter size-medium wp-image-286" title="win_cpu" src="http://www.rocchi.us/wp-content/uploads/2012/03/win_cpu-300x95.png" alt="" width="300" height="95" /></a></p>
<ul>
<li>RAM</li>
</ul>
<p><a href="http://www.rocchi.us/wp-content/uploads/2012/03/win_memory.png"><img class="aligncenter size-medium wp-image-287" title="win_memory" src="http://www.rocchi.us/wp-content/uploads/2012/03/win_memory-300x62.png" alt="" width="300" height="62" /></a></p>
<ul>
<li>Disco (ho fatto nuovamente il test cosi` da confrontare i risultati ottenuti su Linux e direi che sono coerenti).</li>
</ul>
<p><span style="font-size: small;"><span style="line-height: 24px;"><a href="http://www.rocchi.us/wp-content/uploads/2012/03/win_disk.png"><img class="aligncenter size-medium wp-image-288" title="win_disk" src="http://www.rocchi.us/wp-content/uploads/2012/03/win_disk-300x47.png" alt="" width="300" height="47" /></a></span></span></p>
<p>Ho eseguito i Test anche con NovaBench, ed i risultati sono stati  seguenti:</p>
<p style="text-align: center;">27/03/2012 15:49:04<br />
Microsoft Windows Server 2008 R2 Datacenter<br />
Intel Xeon L5640 2.27GHz @ 2261 MHz</p>
<p style="text-align: center;">4096 MB System RAM (Score: 130)<br />
- RAM Speed: 7135 MB/s</p>
<p style="text-align: center;">CPU Tests (Score: 229)<br />
- Floating Point Operations/Second: 51140382<br />
- Integer Operations/Second: 142886782<br />
- MD5 Hashes Generated/Second: 789985</p>
<p style="text-align: center;">Hardware Tests (Score: 11)<br />
- Primary Partition Capacity: 40 GB<br />
- Drive Write Speed: 106 MB/s</p>
<ul>
<li>Per quanto riguarda il networking, ho eseguito un semplice test da speedtest.net e questi sono stati i risultati:</li>
</ul>
<p><span style="font-size: small;"><span style="line-height: 24px;"><a href="http://www.rocchi.us/wp-content/uploads/2012/03/net_speed.png"><img class="aligncenter size-full wp-image-291" title="net_speed" src="http://www.rocchi.us/wp-content/uploads/2012/03/net_speed.png" alt="" width="300" height="140" /></a></span></span></p>
<p style="text-align: left;"><strong>Conclusioni</strong></p>
<p style="text-align: left;">Direi che globalmente le prestazioni sono medio/alte, potremmo calcolare circa un 10% di overhead rispetto ad una macchina fisica di equivalente prestazioni per quanto riguarda la CPU, appena posso eseguiro` dei test su un dual core Intel con 4 GB di ram per comparare i risultati dei test di benchmark e valutare l&#8217;effettivo overhead dato dalla virtualizzazione.</p>
<p style="text-align: left;">A breve daro` ulteriori dettagli riguardo le prestazioni e problematiche varie che incontrero` (se ne incontrero`:))&#8230;</p>
<p style="text-align: left;">Saluti a tutti&#8230;</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aruba Cloud&#8230; Il Test &#8211; Parte I</title>
		<link>http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-i/</link>
		<comments>http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-i/#comments</comments>
		<pubDate>Fri, 23 Mar 2012 08:50:42 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[aruba]]></category>
		<category><![CDATA[cloud. vmware]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=266</guid>
		<description><![CDATA[Aruba ha lanciato da qualche mese il server di Cloud Computing, leggendo un po` sul web le opinioni sono discordanti, chi ne parla bene e chi ne parla male o chi neanche vuole provarlo. Ho deciso quindi di acquistare un&#8217;account sul Cloud di Aruba per fare dei test e valutare … <a href="http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-i/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Aruba ha lanciato da qualche mese il server di Cloud Computing, leggendo un po` sul web le opinioni sono discordanti, chi ne parla bene e chi ne parla male o chi neanche vuole provarlo.</p>
<p style="text-align: justify;">Ho deciso quindi di acquistare un&#8217;account sul Cloud di Aruba per fare dei test e valutare la qualita` del servizio e relative performance e poter dare una mia opinione sul servizio stesso, non solo per sentito dire, ma per averlo testato sulla mia pelle.</p>
<h1 style="text-align: justify;">Phase 1 &#8211; Scelta dell&#8217;Hypervisor e sizing delle risorse.</h1>
<p style="text-align: justify;">Riguardo questo punto ho optato su vmware e non su Hyper-V, personalmente non amo le tecnologie Microsoft, inoltre su Hyper-V non e` possibile avere la scheda Gigabit e la cosa non mi piaceva piu` di tanto.</p>
<p style="text-align: justify;">Per quanto riguarda le risorse ho optato per un sizing di questo tipo: 2 vCPU, 2 GB di RAM, 10 GB di disco (una macchina media, ottima per eseguire i miei test).</p>
<p style="text-align: justify;"><a href="http://www.rocchi.us/wp-content/uploads/2012/03/statistiche-macchina1.png"><img class="aligncenter size-medium wp-image-269" title="statistiche macchina" src="http://www.rocchi.us/wp-content/uploads/2012/03/statistiche-macchina1-300x230.png" alt="" width="300" height="230" /></a></p>
<h1>Phase 2 &#8211; Scelta della distribuzione</h1>
<p style="text-align: justify;">Inizialmente avevo optato per utilizzare Gentoo, poi sono finito su Ubuntu Server di modo da non avere il tutto compilato appositamente per quella determinata architettura ed avere delle performance piu` standard.</p>
<p style="text-align: justify;">Quindi: <strong>Ubuntu Server</strong> sia <img src='http://www.rocchi.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h1>Phase 3 &#8211; Disk Performance</h1>
<p>Come prima cosa non appena il setup della macchina e` terminato (~ 5 minuti), ho fatto un hdparm -tT /dev/sda per verificare quanta banda effettivamente avevo a disposizione all&#8217;interno del cluster condiviso con gli altri utenti. I risultati sono stati decisamente positivi, la media e` di circa 100 MB/s in scrittura. Di seguito lo screen dei risultati:</p>
<p><a href="http://www.rocchi.us/wp-content/uploads/2012/03/hdparm.png"><img class="aligncenter size-medium wp-image-272" title="hdparm" src="http://www.rocchi.us/wp-content/uploads/2012/03/hdparm-300x150.png" alt="" width="300" height="150" /></a></p>
<p style="text-align: justify;">Ho poi eseguito un dd per verificare le prestazioni in un intervallo di tempo maggiore rispetto ai pochi secondi di hdparm. I risultati sono stati di poco inferiori a quelli emersi da hdparm, ovvero ~90 MB/s per la scrittura di file da 2,1 GB. Di seguito lo screenshot</p>
<p><a href="http://www.rocchi.us/wp-content/uploads/2012/03/dd-test.png"><img class="aligncenter size-medium wp-image-273" title="dd test" src="http://www.rocchi.us/wp-content/uploads/2012/03/dd-test-300x96.png" alt="" width="300" height="96" /></a></p>
<p style="text-align: justify;">Infine ho utilizzato bonnie++ come strumento di benchmark per il disco, di seguito sono riportati i risultati ottenuti.</p>
<p style="text-align: justify;">Concorrenza 100:</p>
<p style="text-align: justify;"><a href="http://www.rocchi.us/wp-content/uploads/2012/03/sequencial-test.png"><img class="aligncenter size-medium wp-image-277" title="sequencial test" src="http://www.rocchi.us/wp-content/uploads/2012/03/sequencial-test-300x102.png" alt="" width="300" height="102" /></a></p>
<p style="text-align: justify;">Concorrenza 1:</p>
<p style="text-align: justify;"><a href="http://www.rocchi.us/wp-content/uploads/2012/03/concurrency-1.png"><img class="aligncenter size-medium wp-image-278" title="concurrency 1" src="http://www.rocchi.us/wp-content/uploads/2012/03/concurrency-1-300x106.png" alt="" width="300" height="106" /></a></p>
<p> <strong>Conclusioni</strong></p>
<p>C&#8217;e` poco da dire riguardo le performance del disco, decisamente molto elevate per un sistema cloud con ottime capacita` di scalabilita`.</p>
<p>A breve postero` sul blog la seconda parte dei tests inerenti alle performance CPU con qualche benchmark.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2012/03/aruba-cloud-il-test-parte-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vSphere PowerShell Script: Set Security Policy on PortGroup</title>
		<link>http://www.rocchi.us/2012/02/vsphere-powershell-script-set-security-policy-on-portgroup/</link>
		<comments>http://www.rocchi.us/2012/02/vsphere-powershell-script-set-security-policy-on-portgroup/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 17:34:58 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=259</guid>
		<description><![CDATA[This Script needs to set security policy: Forged Transmits Allow Promiscuous Mac Spoofing on a defined Port Group. $esxName = &#34;10.110.1.1&#34; $vSwitch = &#34;vSwitch0&#34; $PGName = &#34;Trunk&#34; $Esx = Get-VMHost $esxName &#124; Get-View $NetworkSystem = Get-View $esx.configmanager.networksystem $PortGroupSpec = New-Object VMWare.Vim.HostPortGroupSpec $PortGroupSpec.vswitchname = $vSwitch $PortGroupSpec.Name = $pgname $PortGroupSpec.policy = New-object … <a href="http://www.rocchi.us/2012/02/vsphere-powershell-script-set-security-policy-on-portgroup/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>This Script needs to set security policy:</p>
<ol>
<li>Forged Transmits</li>
<li>Allow Promiscuous</li>
<li>Mac Spoofing</li>
</ol>
<p><span style="font-size: small;"><span style="line-height: 24px;">on a defined Port Group.</span></span></p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #800080;">$esxName</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;10.110.1.1&quot;</span>
<span style="color: #800080;">$vSwitch</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;vSwitch0&quot;</span>
<span style="color: #800080;">$PGName</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Trunk&quot;</span>
<span style="color: #800080;">$Esx</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>VMHost <span style="color: #800080;">$esxName</span> <span style="color: pink;">|</span> Get<span style="color: pink;">-</span>View
<span style="color: #800080;">$NetworkSystem</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>View <span style="color: #800080;">$esx</span>.configmanager.networksystem
<span style="color: #800080;">$PortGroupSpec</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> VMWare.Vim.HostPortGroupSpec
<span style="color: #800080;">$PortGroupSpec</span>.vswitchname <span style="color: pink;">=</span> <span style="color: #800080;">$vSwitch</span>
<span style="color: #800080;">$PortGroupSpec</span>.Name <span style="color: pink;">=</span> <span style="color: #800080;">$pgname</span>
<span style="color: #800080;">$PortGroupSpec</span>.policy <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-object</span> vmware.vim.HostNetworkPolicy
<span style="color: #800080;">$PortGroupSpec</span>.Policy.Security <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> VMware.Vim.HostNetworkSecurityPolicy
<span style="color: #800080;">$PortGroupSpec</span>.Policy.Security.ForgedTransmits <span style="color: pink;">=</span> <span style="color: #800080;">$False</span>
<span style="color: #800080;">$PortGroupSpec</span>.Policy.Security.AllowPromiscuous <span style="color: pink;">=</span> <span style="color: #800080;">$False</span>
<span style="color: #800080;">$PortGroupSpec</span>.Policy.Security.MacChanges <span style="color: pink;">=</span> <span style="color: #800080;">$False</span>
<span style="color: #800080;">$NetworkSystem</span>.UpdatePortGroup<span style="color: #000000;">&#40;</span><span style="color: #800080;">$PGName</span><span style="color: pink;">,</span> <span style="color: #800080;">$PortGroupSpec</span><span style="color: #000000;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2012/02/vsphere-powershell-script-set-security-policy-on-portgroup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Script to Automate BACS Install and Configuration</title>
		<link>http://www.rocchi.us/2012/02/powershell-script-to-automate-bacs-install-and-configuration/</link>
		<comments>http://www.rocchi.us/2012/02/powershell-script-to-automate-bacs-install-and-configuration/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 09:56:34 +0000</pubDate>
		<dc:creator>blackms</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[automate bacs configuration]]></category>
		<category><![CDATA[bacs]]></category>
		<category><![CDATA[bacs import]]></category>
		<category><![CDATA[bacscli]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://www.rocchi.us/?p=254</guid>
		<description><![CDATA[I made this script in order to automate the process of Installing BACS Driver and configuring them with a single &#8220;click&#8221; via powershell. You have to configure the array @bcg_config which contains the configuration file to import with basccli. And you also have to pass as argument the IP that … <a href="http://www.rocchi.us/2012/02/powershell-script-to-automate-bacs-install-and-configuration/"> Continue reading <span class="meta-nav">&#8594; </span></a>]]></description>
			<content:encoded><![CDATA[<p>I made this script in order to automate the process of Installing BACS Driver and configuring them with a single &#8220;click&#8221; via powershell.</p>
<p>You have to configure the array @bcg_config which contains the configuration file to import with basccli. And you also have to pass as argument the IP that you want assign to the machine you are configuring.</p>
<p>Also, you can test te connectivity configuring the ip of the gateway and one internet ip (i used 8.8.8.8 and is google dns).</p>

<div class="wp_syntax"><div class="code"><pre class="powershell" style="font-family:monospace;">	<span style="color: #0000FF;">Param</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#91;</span>Parameter<span style="color: #000000;">&#40;</span>Mandatory<span style="color: pink;">=</span><span style="color: #800080;">$true</span><span style="color: pink;">,</span>ValueFromPipeline<span style="color: pink;">=</span><span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
		<span style="color: #000000;">&#91;</span><span style="color: #008080;">String</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$IP_Addr</span>
		<span style="color: #000000;">&#41;</span>
&nbsp;
	<span style="color: #008000;">#Dichiaro tutte le variabili</span>
	<span style="color: #800080;">$conf_ip</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;ip:           &quot;</span><span style="color: pink;">+</span><span style="color: #800080;">$IP_Addr</span>
	<span style="color: #800080;">$PI_Directory</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;c:\POSTINSTALL\&quot;</span>
	<span style="color: #800080;">$bcg_file</span>     <span style="color: pink;">=</span> <span style="color: #800000;">&quot;team.bcg&quot;</span>
	<span style="color: #800080;">$Bacs_Setup</span>   <span style="color: pink;">=</span> <span style="color: #800000;">&quot;c:\POSTINSTALL\Bacs.exe /s /v/qn&quot;</span>
	<span style="color: #800080;">$Bacs_CliImportConfig</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;C:\Program Files\Broadcom\BACS\BACScli.exe&quot;</span>
	<span style="color: #800080;">$Bacs_Command</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;<span style="color: #008080; font-weight: bold;">`&quot;</span>restore $PI_Directory$bcg_file<span style="color: #008080; font-weight: bold;">`&quot;</span>&quot;</span>
	<span style="color: #800080;">$Bacs_CliImportConfig_Args</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;-t&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;team&quot;</span><span style="color: pink;">,</span><span style="color: #800080;">$Bacs_Command</span><span style="color: #000000;">&#41;</span>
	<span style="color: #800080;">$bcg_config</span>   <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;name:         internal&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;type:         2&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;pnic:         01:00.0&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;pnic:         01:00.1&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;vname:        [vlan_name]&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;vid:          [vlan_id]&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800080;">$conf_ip</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;smask:        x.x.x.x&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;gw:           x.x.x.x&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;dns:          x.x.x.x&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;dns:          x.x.x.x&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;vname:        [vlan_name]&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;vid:          [vlan_id]&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;name:         user&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;type:         1&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;pnic:         02:00.0&quot;</span><span style="color: pink;">,</span>
					<span style="color: #800000;">&quot;pnic:         02:00.1&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
	<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">-not</span> <span style="color: #000000;">&#40;</span><span style="color: #008080; font-weight: bold;">Test-Path</span> <span style="color: #800080;">$PI_Directory</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Red <span style="color: #800000;">&quot;POSTINSTALL Directory doesn't exists. I quit!&quot;</span>
		exit
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #008080; font-weight: bold;">New-Item</span> <span style="color: #800080;">$PI_Directory</span><span style="color: #800080;">$bcg_file</span> <span style="color: pink;">-</span><span style="color: #008080; font-weight: bold;">type</span> file <span style="color: #008080; font-style: italic;">-force</span>
&nbsp;
	<span style="color: #800080;">$bcg_config</span>
&nbsp;
	Start<span style="color: pink;">-</span>Process <span style="color: #008080; font-style: italic;">-Wait</span> <span style="color: #800080;">$Bacs_Setup</span>
&nbsp;
	<span style="color: #800080;">$bcg_config</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out<span style="color: #FF0000;">-File</span></span> <span style="color: #800080;">$PI_Directory</span><span style="color: #800080;">$bcg_file</span> <span style="color: #008080; font-style: italic;">-append</span>
&nbsp;
	Start<span style="color: pink;">-</span>Process <span style="color: #008080; font-style: italic;">-Wait</span> <span style="color: #800080;">$Bacs_CliImportConfig</span>
&nbsp;
	<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Starting Connectivity Test...&quot;</span>
	<span style="color: #800080;">$Internet_IP</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;8.8.8.8&quot;</span>
	<span style="color: #800080;">$Private_IP</span>  <span style="color: pink;">=</span> <span style="color: #800000;">&quot;[gateway_IP]&quot;</span>
	<span style="color: #800080;">$Test_Internet_Ping</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-WmiObject</span> Win32_PingStatus <span style="color: #FF0000;">-f</span> <span style="color: #800000;">&quot;Address='$Internet_IP'&quot;</span>
	<span style="color: #800080;">$Test_Private_Ping</span>  <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-WmiObject</span> Win32_PingStatus <span style="color: #FF0000;">-f</span> <span style="color: #800000;">&quot;Address='$Private_IP'&quot;</span>
	<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Test_Private_Ping</span>.StatusCode <span style="color: #FF0000;">-ne</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Red <span style="color: #800000;">&quot;NET_GW_KO: &quot;</span> <span style="color: #800080;">$Private_IP</span>
	<span style="color: #000000;">&#125;</span> <span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Green <span style="color: #800000;">&quot;NET_GW_OK: &quot;</span> <span style="color: #800080;">$Private_IP</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Test_Internet_Ping</span>.StatusCode <span style="color: #FF0000;">-ne</span> <span style="color: #804000;">0</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Red <span style="color: #800000;">&quot;NET_INTERNET_KO: &quot;</span> <span style="color: #800080;">$Internet_IP</span>
	<span style="color: #000000;">&#125;</span> <span style="color: #0000FF;">else</span> <span style="color: #000000;">&#123;</span>
		<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Green <span style="color: #800000;">&quot;NET_INTERNET_OK: &quot;</span> <span style="color: #800080;">$Internet_IP</span>
	<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.rocchi.us/2012/02/powershell-script-to-automate-bacs-install-and-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

