<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: PowerShell Prevents Datastore Emergencies</title>
	<atom:link href="http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/</link>
	<description>Informed Virtualization Criticism</description>
	<lastBuildDate>Wed, 24 Apr 2013 06:27:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: boraq</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-13881</link>
		<dc:creator>boraq</dc:creator>
		<pubDate>Thu, 05 Jul 2012 15:46:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-13881</guid>
		<description><![CDATA[Hi

Could you please tell me what&#039;s this &#039;$env:VMWARE_ALARM_TARGET_NAME&#039;??]]></description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Could you please tell me what&#8217;s this &#8216;$env:VMWARE_ALARM_TARGET_NAME&#8217;??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ap</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-13483</link>
		<dc:creator>ap</dc:creator>
		<pubDate>Wed, 01 Feb 2012 14:02:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-13483</guid>
		<description><![CDATA[Is there any to create an alarm for datacenter using VI API ?

If yes, please help.]]></description>
		<content:encoded><![CDATA[<p>Is there any to create an alarm for datacenter using VI API ?</p>
<p>If yes, please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Protecting your Virtual Machines From &#8220;That Guy&#8221;</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-11196</link>
		<dc:creator>Protecting your Virtual Machines From &#8220;That Guy&#8221;</dc:creator>
		<pubDate>Fri, 01 Oct 2010 04:39:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-11196</guid>
		<description><![CDATA[[...] http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/ [...]]]></description>
		<content:encoded><![CDATA[<p>[...] <a href="http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/" rel="nofollow">http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-10895</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Thu, 03 Jun 2010 20:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-10895</guid>
		<description><![CDATA[No problem at all.. I also had some difficulties with getting the alarm to launch the script correctly.. Turned out that virtualcenter was launching powershell from C:\Windows\SysWOW64\WindowsPowershell\v1.0\powershell.exe instead of the normal c:\windows\system32.. So i had the execution policy set on the x86 version but not the x64 version.. food for thought.

Thanks!

Adam Savage]]></description>
		<content:encoded><![CDATA[<p>No problem at all.. I also had some difficulties with getting the alarm to launch the script correctly.. Turned out that virtualcenter was launching powershell from C:\Windows\SysWOW64\WindowsPowershell\v1.0\powershell.exe instead of the normal c:\windows\system32.. So i had the execution policy set on the x86 version but not the x64 version.. food for thought.</p>
<p>Thanks!</p>
<p>Adam Savage</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Gray</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-10894</link>
		<dc:creator>Eric Gray</dc:creator>
		<pubDate>Thu, 03 Jun 2010 20:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-10894</guid>
		<description><![CDATA[Awesome, Adam!  Thanks for sharing the enhancement.]]></description>
		<content:encoded><![CDATA[<p>Awesome, Adam!  Thanks for sharing the enhancement.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-10893</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Thu, 03 Jun 2010 20:06:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-10893</guid>
		<description><![CDATA[I&#039;ve gone through the process of trying to figure out a better VM selection process.. I pulled the gut of the VM Disk usage from another source but the rest of tathered together by me.  The script will search suspect datastore for the smallest VM based on disk utilization and then check if there are any snapshots.. if there are snapshots for that particular VM they get removed the the VM gets moved to an evacuation datastore of your choosing.  

Add-PSSnapin VMware.Vimautomation.Core
Connect-VIServer localhost 

$vmToMove =  Get-View -ViewType VirtualMachine &#124; %{
                        New-Object PSObject -Property @{
                                                Name = $_.Name
                                                Host = (Get-View $_.Summary.Runtime.Host).Name
                                                Datastore = [system.String]::Join(&quot;,&quot;,($_.Storage.PerDatastoreUsage &#124; %{Get-View $_.Datastore} &#124; %{$_.Name}))
                                                Size = ($_.Storage.PerDatastoreUsage &#124; Measure-Object -Property Committed -Sum).Sum 
                        }
} &#124; Sort Size &#124; ?{$_.DataStore -eq $ENV:VMWARE_ALARM_TARGET_NAME} &#124; Select Name, Datastore -first 1

$destDS = Get-Datastore yourevacuationdatastore
$snapshot = get-vm $vmtomove.name &#124; get-snapshot
If ($snapshot -eq $NULL)
{
write-host &quot;No Snapshots Present&quot;}
                        else { write-host &quot;Snapshots Found and Removing&quot;
                        get-vm $vmtomove.name &#124; get-snapshot &#124; remove-snapshot -Confirm:$false }
                        
if ($destDS) {
                        move-vm -VM $vmToMove.Name -Datastore $destDS -RunAsync
}
Send-MailMessage -To &quot;whereveryouwanttogo&quot; -From &quot;somewhereitcamefrom&quot; -Subject &quot;VM Successfully Moved to Evacuation Datastore&quot; -Body &quot;$vmToMove has been moved to $destDS from $env:VMWARE_ALARM_TARGET_NAME&quot; -SMTPServer &quot;yoursmptserver&quot;

This is working for me right now in POC.

Thank you,

Adam Savage]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve gone through the process of trying to figure out a better VM selection process.. I pulled the gut of the VM Disk usage from another source but the rest of tathered together by me.  The script will search suspect datastore for the smallest VM based on disk utilization and then check if there are any snapshots.. if there are snapshots for that particular VM they get removed the the VM gets moved to an evacuation datastore of your choosing.  </p>
<p>Add-PSSnapin VMware.Vimautomation.Core<br />
Connect-VIServer localhost </p>
<p>$vmToMove =  Get-View -ViewType VirtualMachine | %{<br />
                        New-Object PSObject -Property @{<br />
                                                Name = $_.Name<br />
                                                Host = (Get-View $_.Summary.Runtime.Host).Name<br />
                                                Datastore = [system.String]::Join(&#8220;,&#8221;,($_.Storage.PerDatastoreUsage | %{Get-View $_.Datastore} | %{$_.Name}))<br />
                                                Size = ($_.Storage.PerDatastoreUsage | Measure-Object -Property Committed -Sum).Sum<br />
                        }<br />
} | Sort Size | ?{$_.DataStore -eq $ENV:VMWARE_ALARM_TARGET_NAME} | Select Name, Datastore -first 1</p>
<p>$destDS = Get-Datastore yourevacuationdatastore<br />
$snapshot = get-vm $vmtomove.name | get-snapshot<br />
If ($snapshot -eq $NULL)<br />
{<br />
write-host &#8220;No Snapshots Present&#8221;}<br />
                        else { write-host &#8220;Snapshots Found and Removing&#8221;<br />
                        get-vm $vmtomove.name | get-snapshot | remove-snapshot -Confirm:$false }</p>
<p>if ($destDS) {<br />
                        move-vm -VM $vmToMove.Name -Datastore $destDS -RunAsync<br />
}<br />
Send-MailMessage -To &#8220;whereveryouwanttogo&#8221; -From &#8220;somewhereitcamefrom&#8221; -Subject &#8220;VM Successfully Moved to Evacuation Datastore&#8221; -Body &#8220;$vmToMove has been moved to $destDS from $env:VMWARE_ALARM_TARGET_NAME&#8221; -SMTPServer &#8220;yoursmptserver&#8221;</p>
<p>This is working for me right now in POC.</p>
<p>Thank you,</p>
<p>Adam Savage</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ben.neise.co.uk &#187; Datastore alerts via Twitter</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-10837</link>
		<dc:creator>ben.neise.co.uk &#187; Datastore alerts via Twitter</dc:creator>
		<pubDate>Thu, 06 May 2010 13:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-10837</guid>
		<description><![CDATA[[...] Gray&#8217;s done some great stuff with using VMware vCenter alarms with PowerShell to automatically migrate machines. And Carter Shanklin&#8217;s got a great description of a different method, but I was after [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Gray&#8217;s done some great stuff with using VMware vCenter alarms with PowerShell to automatically migrate machines. And Carter Shanklin&#8217;s got a great description of a different method, but I was after [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Provision a Thin Provisioned Standby LUN For vSphere Thin Provisioning &#124; VM /ETC</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-8803</link>
		<dc:creator>Provision a Thin Provisioned Standby LUN For vSphere Thin Provisioning &#124; VM /ETC</dc:creator>
		<pubDate>Tue, 03 Nov 2009 13:14:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-8803</guid>
		<description><![CDATA[[...] PowerShell Prevents Datastore Emergencies &#8220;When a datastore is about to run out of space, the fastest resolution may be to simply migrate virtual disks to another datastore.&#160;&#160; VMware Storage VMotion provides that capability with zero downtime for VMs and no disruption to end users.&#8221; [...]]]></description>
		<content:encoded><![CDATA[<p>[...] PowerShell Prevents Datastore Emergencies &#8220;When a datastore is about to run out of space, the fastest resolution may be to simply migrate virtual disks to another datastore.&nbsp;&nbsp; VMware Storage VMotion provides that capability with zero downtime for VMs and no disruption to end users.&#8221; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VMTN Podcast number 70, Storage&#8230; » Yellow Bricks</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-8583</link>
		<dc:creator>VMTN Podcast number 70, Storage&#8230; » Yellow Bricks</dc:creator>
		<pubDate>Wed, 28 Oct 2009 20:33:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-8583</guid>
		<description><![CDATA[[...] vCritical &#8211; PowerShell Prevents Datastore Emergencies [...]]]></description>
		<content:encoded><![CDATA[<p>[...] vCritical &#8211; PowerShell Prevents Datastore Emergencies [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Sauer</title>
		<link>http://www.vcritical.com/2009/10/powershell-prevents-datastore-emergencies/#comment-8471</link>
		<dc:creator>Scott Sauer</dc:creator>
		<pubDate>Sat, 24 Oct 2009 17:05:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.vcritical.com/?p=1713#comment-8471</guid>
		<description><![CDATA[Eric,
Here is an article I wrote that I would like to share with anyone that comes across the thread.
http://www.virtualinsanity.com/index.php/2009/10/12/get-thin-provisioning-working-for-you-in-vsphere/

Thanks!
Scott]]></description>
		<content:encoded><![CDATA[<p>Eric,<br />
Here is an article I wrote that I would like to share with anyone that comes across the thread.<br />
<a href="http://www.virtualinsanity.com/index.php/2009/10/12/get-thin-provisioning-working-for-you-in-vsphere/" rel="nofollow">http://www.virtualinsanity.com/index.php/2009/10/12/get-thin-provisioning-working-for-you-in-vsphere/</a></p>
<p>Thanks!<br />
Scott</p>
]]></content:encoded>
	</item>
</channel>
</rss>
