<?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>Jason Ruiz</title>
	<atom:link href="http://blog.coildomain.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.coildomain.com</link>
	<description>Virtualization, Technology, and Stuff!</description>
	<lastBuildDate>Wed, 18 Apr 2012 20:18:04 +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>SCVMM: The SQL Server service account does not have permission to access Active Directory Domain Services (AD DS).</title>
		<link>http://blog.coildomain.com/2012/04/scvmm-the-sql-server-service-account-does-not-have-permission-to-access-active-directory-domain-services-ad-ds/</link>
		<comments>http://blog.coildomain.com/2012/04/scvmm-the-sql-server-service-account-does-not-have-permission-to-access-active-directory-domain-services-ad-ds/#comments</comments>
		<pubDate>Wed, 18 Apr 2012 20:18:04 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1260</guid>
		<description><![CDATA[Kudos to J.C. Hornbeck for this article which saved my arse today. I ended up doing some spring cleaning today removing old disabled accounts for people who have moved on. A little while later I noticed I was getting this error message when trying to do anything PowerShell related to VMM, and then the console itself. [...]]]></description>
			<content:encoded><![CDATA[<p>Kudos to J.C. Hornbeck for this <a href="http://blogs.technet.com/b/scvmm/archive/2009/06/15/solution-opening-the-scvmm-2008-admin-console-may-fail-with-permissions-related-error.aspx">article</a> which saved my arse today. I ended up doing some spring cleaning today removing old disabled accounts for people who have moved on. A little while later I noticed I was getting this error message when trying to do anything PowerShell related to VMM, and then the console itself.</p>
<p>Apparently, I had dun goofed and deleted the database owner of the VMM database from the domain. Simple enough after further research I ended up adding our service account as the DBO via the dialog below. If the user already exists in the database, you&#8217;ll just have to remove it prior.</p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Steps to resolve this:</span></strong></p>
<ol>
<li>Right click on the affected database.</li>
<li>Go to properties and select Files.</li>
<li>Click the &#8230; button and select an account.</li>
<li>IT WORKS!!!</li>
</ol>
<p><a href="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture.png"><img class="aligncenter size-medium wp-image-1261" title="Picture" src="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-300x209.png" alt="" width="300" height="209" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2012/04/scvmm-the-sql-server-service-account-does-not-have-permission-to-access-active-directory-domain-services-ad-ds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCVMM 2012 SP1 CTP</title>
		<link>http://blog.coildomain.com/2012/04/scvmm-2012-sp1-ctp/</link>
		<comments>http://blog.coildomain.com/2012/04/scvmm-2012-sp1-ctp/#comments</comments>
		<pubDate>Tue, 10 Apr 2012 15:43:24 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Storage]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1229</guid>
		<description><![CDATA[Cat is out of the bag, I should be able to talk about this. Not much has changed in the interface, but there are several new features which are part of the now supported Server 8 OS and Hyper-V 3. &#160; Storage: Using Server 8 Hyper-V 3 hosts, you can now use SMB 2.2 shares [...]]]></description>
			<content:encoded><![CDATA[<p>Cat is out of the bag, I should be able to talk about this. Not much has changed in the interface, but there are several new features which are part of the now supported Server 8 OS and Hyper-V 3.</p>
<p>&nbsp;</p>
<h3><span style="text-decoration: underline;"><strong>Storage:</strong></span></h3>
<p>Using Server 8 Hyper-V 3 hosts, you can now use SMB 2.2 shares to host VMs. You may also Live Migrate between CSV&#8217;s and SMB shares with no down time.<a href="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-1.png"><img class="aligncenter size-full wp-image-1231" title="Picture 1" src="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-1.png" alt="" width="387" height="137" /></a></p>
<p>&nbsp;</p>
<p>Performance hasn&#8217;t been stellar, I&#8217;m getting around 200-500 Mbps via a 2 1GbE LACP bonded interface with Jumbo Frames enabled, I know the storage server should perform better.</p>
<p>&nbsp;</p>
<h3><span style="text-decoration: underline;">Networking:</span></h3>
<p>I assume most of the work on this has not been completed, as the only available options are to configure the VM network itself, from my understanding there would be an underlying bond between the outside and inside networks, but I have not found the spot to configure this.</p>
<p><a href="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-6.png"><img class="aligncenter size-full wp-image-1236" title="Picture 6" src="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-6.png" alt="" width="723" height="218" /></a></p>
<p>The new QoS feature in Hyper-V 3 has not shown its head in this version either.</p>
<p style="text-align: center;"><a href="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-8.png"><img class="alignnone size-medium wp-image-1242" title="Picture 8" src="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-8-300x168.png" alt="" width="300" height="168" /></a><a href="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-10.png"><img class="alignnone size-medium wp-image-1246" title="Picture 10" src="http://blog.coildomain.com/wp-content/uploads/2012/04/Picture-10-300x167.png" alt="" width="300" height="167" /></a></p>
<h3 style="text-align: left;"><span style="text-decoration: underline;"><strong>Issues:</strong></span></h3>
<p>This is a CTP, they are not all created equal. That said, VMM 2012 SP1 has been crashing quite often in our lab and we have noticed several bugs so far. One of the most noticeable one is that the &#8220;Make this VM highly available&#8221; feature during migration does not work as intended. During my testing at one point the VM was no longer HA, running the Live Migration wizard and selecting that option did not turn on HA, I ended up powering it off and doing it once more which infact did turn on HA.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2012/04/scvmm-2012-sp1-ctp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Server 8: iSCSI Target GUI</title>
		<link>http://blog.coildomain.com/2012/03/windows-server-8-iscsi-target-gui/</link>
		<comments>http://blog.coildomain.com/2012/03/windows-server-8-iscsi-target-gui/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 15:00:27 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1175</guid>
		<description><![CDATA[I can start talking about some stuff now, being under NDA for several Microsoft products currently. Luckily Server 8 is pretty much public now with all the features so I can speak openly about the simple things. Microsoft previously freely offered an iSCSI target for Windows as a separate download, but it is now built directly into [...]]]></description>
			<content:encoded><![CDATA[<p>I can start talking about some stuff now, being under NDA for several Microsoft products currently. Luckily Server 8 is pretty much public now with all the features so I can speak openly about the simple things. Microsoft previously freely offered an iSCSI target for Windows as a separate download, but it is now built directly into Server 8 and it&#8217;s server management console. You can add it under the File Services role. Configuration is pretty straight forward, a normal set of wizard driven options. As you can see, Microsoft has made this plain and simple, so there&#8217;s not much to explain.</p>
<p>&nbsp;</p>
<p style="text-align: center;"><script type="text/javascript">
var flashvars2 = {};
flashvars2.galleryURL = "http://blog.coildomain.com/wp-content/uploads/2.xml";

simpleviewer.ready(function () {
    simpleviewer.load("flashContent2", "600px", "600px", "ffffff", true, flashvars2);
});

</script>
<div id="flashContent2" >SimpleViewer requires JavaScript and the Flash Player.
<a href="http://www.adobe.com/go/getflashplayer/">Get Flash.</a></div></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2012/03/windows-server-8-iscsi-target-gui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Server 8: iSCSI Target Powershell</title>
		<link>http://blog.coildomain.com/2012/03/windows-server-8-iscsi-target-powershell/</link>
		<comments>http://blog.coildomain.com/2012/03/windows-server-8-iscsi-target-powershell/#comments</comments>
		<pubDate>Fri, 16 Mar 2012 15:00:26 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1214</guid>
		<description><![CDATA[Microsoft has also made Powershell CMDlets for their iSCSI target which are available after installing the role. For a simple setup, it&#8217;s rather easy: New-IscsiServerTarget -TargetName &#34;NewTarget&#34; -InitiatorIds IQN:iqn.1991-05.com.microsoft:host003-tpa02.domain.ltd,IQN:iqn.1991-05.com.microsoft:host004-tpa02.domain.ltd New-IscsiVirtualDisk -DevicePath G:\iSCSIDisks\LUN1.vhd -Size 100GB Add-IscsiVirtualDiskTargetMapping -TargetName NewTarget -DevicePath G:\iSCSIDisks\LUN1.vhd And for the lazy man: Function New-Target ($Name, $Initiators, $Size, $Path) { New-IscsiServerTarget -TargetName &#34;$Name&#34; -InitiatorIds [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft has also made Powershell CMDlets for their iSCSI target which are available after installing the role.</p>
<p>For a simple setup, it&#8217;s rather easy:</p>
<pre class="brush: powershell; gutter: true">New-IscsiServerTarget -TargetName &quot;NewTarget&quot; -InitiatorIds IQN:iqn.1991-05.com.microsoft:host003-tpa02.domain.ltd,IQN:iqn.1991-05.com.microsoft:host004-tpa02.domain.ltd
New-IscsiVirtualDisk -DevicePath G:\iSCSIDisks\LUN1.vhd -Size 100GB
Add-IscsiVirtualDiskTargetMapping -TargetName NewTarget -DevicePath G:\iSCSIDisks\LUN1.vhd</pre>
<p>And for the lazy man:</p>
<pre class="brush: powershell; gutter: true">Function New-Target ($Name, $Initiators, $Size, $Path) {
   New-IscsiServerTarget -TargetName &quot;$Name&quot; -InitiatorIds $Initiators
   New-IscsiVirtualDisk -DevicePath $Path -Size $Size
   Add-IscsiVirtualDiskTargetMapping -TargetName &quot;$Name&quot; -DevicePath $Path
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2012/03/windows-server-8-iscsi-target-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Migration</title>
		<link>http://blog.coildomain.com/2012/03/website-migration/</link>
		<comments>http://blog.coildomain.com/2012/03/website-migration/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 03:07:50 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1170</guid>
		<description><![CDATA[After the week(s) of major downtime with Dreamhost and general lack of decent performance, I decided to bite the bullet and move on. I spent an hour or so browsing CheapVPSDeals I decided on RethinkVPS. I don&#8217;t know if there are any better deals I missed, but I&#8217;m generally happy with the under 10 bucks a [...]]]></description>
			<content:encoded><![CDATA[<p>After the week(s) of major downtime with Dreamhost and general lack of decent performance, I decided to bite the bullet and move on. I spent an hour or so browsing <a href="http://cheapvpsdeals.info/" target="_blank">CheapVPSDeals</a> I decided on <a href="http://rethinkvps.com/" target="_blank">RethinkVPS</a>. I don&#8217;t know if there are any better deals I missed, but I&#8217;m generally happy with the under 10 bucks a month charge for unmetered bandwidth. I ended up configuring nginx for the first time to host the site and performance and memory are spot on with awesomeness.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2012/03/website-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell: Windows Updates for Hyper-V/SCVMM Cluster</title>
		<link>http://blog.coildomain.com/2012/02/powershell-windows-updates-for-hyper-vscvmm-cluster/</link>
		<comments>http://blog.coildomain.com/2012/02/powershell-windows-updates-for-hyper-vscvmm-cluster/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 14:00:27 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1160</guid>
		<description><![CDATA[I let this sit for awhile before deciding to finish it, from what I can see it works perfect for our environment. &#160; function Get-Updates ($VMHost) { $VMMServer = Get-VMMServer &#34;SCVMM IP Adress&#34; $SCOMServer = &#34;SCOM Server FQDN&#34; New-PSDrive -Name:Monitoring -PSProvider:OperationsManagerMonitoring -Root:\ &#124; Out-Null New-ManagementGroupConnection -ConnectionString:$SCOMServer &#124; Out-Null Set-Location &#34;Monitoring:\$SCOMServer&#34; function StartMaintenance { $SCOMAgent = [...]]]></description>
			<content:encoded><![CDATA[<p>I let this sit for awhile before deciding to finish it, from what I can see it works perfect for our environment.</p>
<p>&nbsp;</p>
<pre class="brush: powershell; gutter: true">function Get-Updates ($VMHost)  {
$VMMServer = Get-VMMServer &quot;SCVMM IP Adress&quot;

$SCOMServer = &quot;SCOM Server FQDN&quot;

                New-PSDrive -Name:Monitoring -PSProvider:OperationsManagerMonitoring -Root:\ | Out-Null
                New-ManagementGroupConnection -ConnectionString:$SCOMServer | Out-Null
                Set-Location &quot;Monitoring:\$SCOMServer&quot;

function StartMaintenance       {
$SCOMAgent = Get-Agent | Where-object {$_.Name –match “$VMHost”}
                Write-Host &quot;Setting $VMHost to unavailable for placement&quot;
                Set-VMHost -VMHost $VMHost -AvailableForPlacement $FALSE | Out-Null
                Write-Host &quot;Placing host $VMHost into maintenance mode.&quot;
                $SCOMAgent.HostComputer | New-MaintenanceWindow -StartTime (Get-Date) -EndTime ([DateTime]::Now).AddMinutes(180) -Comment &quot;Windows Updates&quot;
                Disable-VMHost $VMHost -MoveWithinCluster | Out-Null
$Maintenance = Get-VMHost -VMMServer $VMMServer $VMHost | Select OverallState
                if ($Maintenance -match &quot;MaintenanceMode&quot;)      {
                Write-Host &quot;Host is in Maintenance Mode&quot;
                }
                Else {
                        Write-Host &quot;Host did not successfully go into Maintenance Mode, retrying&quot;
                        StartMaintenance
                }
                }

function EndMaintenance {
$SCOMAgent = Get-Agent | Where-object {$_.Name –match “$VMHost”}
                Write-Host &quot;Placing host $VMHost back into service.&quot;
                Enable-VMHost $VMHost | Out-Null
                Set-VMHost -VMHost $VMHost -AvailableForPlacement $TRUE | Out-Null
                $SCOMAgent.HostComputer | Set-MaintenanceWindow -EndTime ([DateTime]::Now).AddMinutes(1) -Comment &quot;Finished Windows Updates&quot;
                                                }          

function CheckForReboot {
$baseKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(&quot;LocalMachine&quot;,$VMhost)
$key = $baseKey.OpenSubKey(&quot;Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\&quot;)
$subkeys = $key.GetSubKeyNames()
$key.Close()
$baseKey.Close()
                If ($subkeys | Where {$_ -eq &quot;RebootPending&quot;})  {
                Write-Host &quot;Reboot is required: Restarting $VMHost&quot;
                Restart-Computer -ComputerName $VMHost -Force
                sleep 180
                                                                                                                }
                Else    {
                Write-Host &quot;No Reboot required.&quot;
                                }
                        }

function MigrateOfflineVMs  {
$OfflineVMs = Get-VM -VMMServer $VMMServer -VMHost $VMHost | Select Status
$Hosts = Get-VMHost -VMHostGroup &quot;HostGroup&quot;
                if ($OfflineVMs -match &quot;PowerOff&quot;)      {
                Write-Host &quot;There are offline VMs, migrating to another host&quot;
                        $VMs = Get-VM -VMHost $VMHost | Where-Object {$_.Status -eq &quot;PowerOff&quot;}
                        ForEach ($VM in $VMs)   {
                        $HostRatings = Get-VMHostRating –VMHost $Hosts –VM $VM -IsMigration | Sort-Object –descending Rating
                        if ($HostRatings[0].Rating –ne 0)       {
                        $BestHost = Get-VMHost –ComputerName $HostRatings[0].Name
                write-host “Moving $VM to $BestHost”
                Move-VM –VM $VM –VMHost $BestHost | Out-Null
                                                                                                }
                                                                        }
                                                                                        }
                Else    {
                Write-Host &quot;There are no VMs on this server currently.&quot;
                                }
                        } 

function CheckHostStatus        {
$HostState = Get-VMHost $VMHost
                if (($HostState.ComputerState -match &quot;Responding&quot;) -and ($HostState.ClusterNodeStatus -match &quot;Running&quot;) -and ($HostState.VirtualServerState -match &quot;Running&quot;) -and ($HostState.VirtualServerStateString -match &quot;Running&quot;) -and ($HostState.CommunicationStateString -match &quot;Responding&quot;) -and ($HostState.CommunicationState -match &quot;Responding&quot;)) {
                Write-Host &quot;Host is responding&quot;
                                                                                }
                Else    {
                Write-Host &quot;Host is not operational!!!&quot;
                sleep 120
                CheckHostStatus
                                }
                                }

function CheckWUInstall {
$WUInstallStatus = Get-Content &quot;C:\Users\USERNAME\Desktop\Scripts\Logs\$VMHost.log&quot; | Select-Object -Last 1
If ($WUInstallStatus -match &quot;No Updates are available, nothing to do!&quot;) {Write-Host &quot;No Updates are available, nothing to do!&quot;}
else {InstallUpdates}
} 

function InstallUpdates {
                psexec \\$VMHost -s -c \\SHARESERVER\SHARE\wuinstall.exe /install /accepteula &gt; &quot;C:\Users\USERNAME\Desktop\Scripts\Logs\$VMHost.log&quot;
                CheckForReboot
                CheckHostStatus
                CheckWUInstall
                        }    

                StartMaintenance
                MigrateOfflineVMs
                InstallUpdates
                CheckHostStatus
                EndMaintenance
                C:
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2012/02/powershell-windows-updates-for-hyper-vscvmm-cluster/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell: Get List of Storage Hogging VMs by Volume</title>
		<link>http://blog.coildomain.com/2011/12/scvmm-get-list-of-storage-hogging-vms-by-volume/</link>
		<comments>http://blog.coildomain.com/2011/12/scvmm-get-list-of-storage-hogging-vms-by-volume/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 14:29:15 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1154</guid>
		<description><![CDATA[Lately a couple of our Cluster Shared Volumes have been hitting a high percentage of usage, to alleviate any issues, I wanted a simple way to find out which VMs had the largest disk usage on those volumes. I chose to query volumes that were over 70% usage and the top 5 storage hogging VMs from those. [...]]]></description>
			<content:encoded><![CDATA[<p>Lately a couple of our Cluster Shared Volumes have been hitting a high percentage of usage, to alleviate any issues, I wanted a simple way to find out which VMs had the largest disk usage on those volumes. I chose to query volumes that were over 70% usage and the top 5 storage hogging VMs from those.</p>
<p>Credit goes to this <a href="http://blogs.msdn.com/b/clustering/archive/2010/06/19/10027366.aspx" target="_blank">post</a> as getting a proper output of the paths and percentage is a real pain with the Failover Clustering CMDLets.</p>
<pre class="brush: powershell; gutter: true">function Get-LargestVMs {
function Get-LargeVMs ($Path) {
   $Size = get-vm -vmmserver &quot;IP&quot; | Where-Object {$_.vmcpath -like &quot;*$Path*&quot;} | Select Name,TotalSize,Hostname | Sort-Object TotalSize -Descending | Select-Object -First 5 | Out-String
   Write-Host $Size
}

$objs = @()

$csvs = Get-ClusterSharedVolume -Cluster &quot;Cluster&quot;
foreach ( $csv in $csvs )
{
   $csvinfos = $csv | select -Property Name -ExpandProperty SharedVolumeInfo
   foreach ( $csvinfo in $csvinfos )
   {
      $obj = New-Object PSObject -Property @{
         Path        = $csvinfo.FriendlyVolumeName
         PercentFree = $csvinfo.Partition.PercentFree
      }
      $objs += $obj
   }
}

$objs | foreach {
if ($_.PercentFree -le &quot;30&quot;)  {
   Write-Host &quot;################################################&quot;
   Write-Host $_.Path
   Write-Host &quot;Current percent free is&quot;$_.PercentFree
   Write-Host &quot;################################################&quot;
   Get-LargeVMs $_.Path
}
else {
}
}
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2011/12/scvmm-get-list-of-storage-hogging-vms-by-volume/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell: SCVMM Host Status Snippet</title>
		<link>http://blog.coildomain.com/2011/12/poweshell-scvmm-host-status-snippet/</link>
		<comments>http://blog.coildomain.com/2011/12/poweshell-scvmm-host-status-snippet/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 14:28:22 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1147</guid>
		<description><![CDATA[I changed this around in my last script to verify the operational status of a host via SCVMM instead of the Hyper-V server itself. function CheckHostStatus { $HostState = Get-VMHost $VMHost if (($HostState.ComputerState -match &#34;Responding&#34;) -and ($HostState.ClusterNodeStatus -match &#34;Running&#34;) -and ($HostState.VirtualServerState -match &#34;Running&#34;) -and ($HostState.VirtualServerStateString -match &#34;Running&#34;) -and ($HostState.CommunicationStateString -match &#34;Responding&#34;) -and ($HostState.CommunicationState -match &#34;Responding&#34;)) [...]]]></description>
			<content:encoded><![CDATA[<p>I changed this around in my last script to verify the operational status of a host via SCVMM instead of the Hyper-V server itself.</p>
<pre class="brush: powershell; gutter: true">function CheckHostStatus	{
$HostState = Get-VMHost $VMHost
		if (($HostState.ComputerState -match &quot;Responding&quot;) -and ($HostState.ClusterNodeStatus -match &quot;Running&quot;) -and ($HostState.VirtualServerState -match &quot;Running&quot;) -and ($HostState.VirtualServerStateString -match &quot;Running&quot;) -and ($HostState.CommunicationStateString -match &quot;Responding&quot;) -and ($HostState.CommunicationState -match &quot;Responding&quot;)) {
		Write-Host &quot;Host is operational&quot;
										}
		Else    {
		Write-Host &quot;Host is not fully operational&quot;
		sleep 120
		CheckHostStatus
				}
							}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2011/12/poweshell-scvmm-host-status-snippet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell: Windows Updates for single Hyper-V Server</title>
		<link>http://blog.coildomain.com/2011/10/hyper-v-scripting-updates-part-1/</link>
		<comments>http://blog.coildomain.com/2011/10/hyper-v-scripting-updates-part-1/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 16:55:36 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1125</guid>
		<description><![CDATA[I&#8217;m now in charge of roughly 30 Hyper-V servers, half in an HA cluster, and the rest are standalone. Rather than doing updating each server manually I decided to take it upon myself to automate it via PowerShell. In my environment, we use SCVMM and SCOM, so doing this is rather easy, we also have [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m now in charge of roughly 30 Hyper-V servers, half in an HA cluster, and the rest are standalone. Rather than doing updating each server manually I decided to take it upon myself to automate it via PowerShell. In my environment, we use SCVMM and SCOM, so doing this is rather easy, we also have WSUS for filtering updates as we have run into a few issues before.</p>
<p>There are 2 pieces of software used in this as a workaround for a known issue with remotely calling the Microsoft Update Session API, <a href="http://wuinstall.com/" target="_blank">WUInstall</a> and <a href="http://technet.microsoft.com/en-us/sysinternals/bb897553" target="_blank">PSexec</a>.</p>
<p>Here is the code below:</p>
<p>&nbsp;</p>
<pre class="brush: powershell; gutter: true">Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager

Add-PSSnapin Microsoft.EnterpriseManagement.OperationsManager.Client

$VMMServer = Get-VMMServer &quot;SCVMM IP Adress&quot;    #&lt;- Had issues with authentication while using the FQDN

$SCOMServer = &quot;SCOM Server FQDN&quot;

$VMHosts = Get-VMHost -VMMServer $VMMServer | Where-Object {$_.name -ge &quot;Hostname&quot;}

                New-PSDrive -Name:Monitoring -PSProvider:OperationsManagerMonitoring -Root:\ | Out-Null
                New-ManagementGroupConnection -ConnectionString:$SCOMServer | Out-Null
                Set-Location &quot;Monitoring:\$SCOMServer&quot;

function StartMaintenance       {
$SCOMAgent = Get-Agent | Where-object {$_.Name –match “$VMHost”}
                Write-Host &quot;Placing host $VMHost into maintenance mode.&quot;
                $SCOMAgent.HostComputer | New-MaintenanceWindow -StartTime (Get-Date) -EndTime ([DateTime]::Now).AddMinutes(60) -Comment &quot;Running Windows Updates&quot;
                Disable-VMHost $VMHost | Out-Null
                                                        }

function EndMaintenance {
$SCOMAgent = Get-Agent | Where-object {$_.Name –match “$VMHost”}
                Write-Host &quot;Placing host $VMHost back into service.&quot;
                Enable-VMHost $VMHost | Out-Null
                $SCOMAgent.HostComputer | Set-MaintenanceWindow -EndTime ([DateTime]::Now).AddSeconds(5) -Comment &quot;Finished Windows Updates&quot;
                                                }

function InstallUpdates {
                psexec \\$VMHost -s -c \\shareserver\share\wuinstall.exe /install /accepteula &gt; &quot;C:\Users\logon\Desktop\Scripts\Logs\$VMHost.log&quot;
                        }

function CheckForReboot {
$baseKey = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey(&quot;LocalMachine&quot;,$VMhost)
$key = $baseKey.OpenSubKey(&quot;Software\Microsoft\Windows\CurrentVersion\Component Based Servicing\&quot;)
$subkeys = $key.GetSubKeyNames()
$key.Close()
$baseKey.Close()
                If ($subkeys | Where {$_ -eq &quot;RebootPending&quot;})  {
                Write-Host &quot;Reboot is required: Restarting $VMHost&quot;
                Restart-Computer -ComputerName $VMHost -Force
                sleep 120
                                                                                                                }
                Else    {
                Write-Host &quot;No Reboot required.&quot;
                                }
                        }

function CheckVMStatus  {
$VMStatus = Get-VM -VMMServer $VMMServer -VMHost $VMHost | Select Status
                if ($VMStatus -match &quot;HostNotResponding&quot;)       {
                Write-Host &quot;SCVMM has not updated the status of the Virtual Machines yet&quot;
                sleep 120
                CheckVMStatus
                                                                                                                }
                Else    {
                Write-Host &quot;Powering on Virtual Machines&quot;
                Get-VM -VMMServer $VMMServer -VMHost $VMHost | Start-VM | Out-Null
                                }
                        }

function CheckHostStatus        {
$Status = Get-Service -Computername $VMHost VMMS -erroraction silentlycontinue | select status
                if ($Status -match &quot;Running&quot;)   {
                Write-Host &quot;Host is Up&quot;
                Write-Host &quot;Waiting for SCVMM to populate VM state&quot;
                CheckVMStatus
                                                                                }
                Else    {
                Write-Host &quot;Host is still rebooting&quot;
                sleep 120
                CheckHostStatus
                                }
                                                        }
Foreach ($VMHost in $VMHosts)   {
                StartMaintenance
                InstallUpdates
                CheckForReboot
                CheckHostStatus
                EndMaintenance
                                }</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2011/10/hyper-v-scripting-updates-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perfect vSphere 5 whitebox</title>
		<link>http://blog.coildomain.com/2011/08/perfect-vsphere-5-whitebox/</link>
		<comments>http://blog.coildomain.com/2011/08/perfect-vsphere-5-whitebox/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 19:16:50 +0000</pubDate>
		<dc:creator>Jason Ruiz</dc:creator>
				<category><![CDATA[Home lab]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://blog.coildomain.com/?p=1110</guid>
		<description><![CDATA[I was hunting for a new affordable whitebox all pieced together for me, IE a desktop that was inline with the HCL. I looked through Best Buy since they usually have decent deals and went to my local CompUSA store to scope things out. I ended up buying a Gateway DX4860 from Best Buy for [...]]]></description>
			<content:encoded><![CDATA[<p>I was hunting for a new affordable whitebox all pieced together for me, IE a desktop that was inline with the HCL. I looked through Best Buy since they usually have decent deals and went to my local CompUSA store to scope things out. I ended up buying a <a href="http://www.bestbuy.com/site/Gateway+-+Desktop+/+Intel%26%23174%3B+Core%26%23153%3B+i5+Processor+/+8GB+Memory+/+1TB+Hard+Drive/2632043.p?id=1218341072045&amp;skuId=2632043&amp;st=gateway&amp;cp=1&amp;lp=3" target="_blank">Gateway DX4860</a> from Best Buy for just a bit over 600 with tax included.</p>
<p>What you get:</p>
<pre>i5 Quad 2.8ghz CPU
8gb RAM(Max 16gb)
1tb Hard Drive
6 SATA Ports
Realtek 100/1000 NIC(Now supported during stock installation!)</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.coildomain.com/2011/08/perfect-vsphere-5-whitebox/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.772 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-05-17 07:34:56 -->

