Sep
28

#EUC Tip 80: VDI with Time Sharing, Spin Down VDI, Spin UP Cloud\Hadoop

Don’t let all of the those expensive CPU cycles go to waste. On the weekends and during off hours spin down your VDI environment and run some other workloads like vCloud Director or Hadoop(Project Serengeti). Code below is kinda simple but that’s what makes PowerShell awesome I guess. To schedule the code to run vist http://www.virtu-al.net/

WARNING: Before running code you find on the Internet, test, test, test



This code is to shutdown any unused desktops or suspend them


#Get all of the Desktop Pools running in VMware View
$listOfPools = Get-Pool

foreach ( $pool in $listOfPools){

<#SviNonPersistent is a non-persistent linked clone pool AutoLogoffTime give users some time to connect back in after they have disconnected. DeletePolicy - Most non-persistent pools use refresh for getting back to clean state. #>
if ($pool.PoolType -eq 'SviNonPersistent')
{ Update-AutomaticLinkedClonePool -Pool_id $pool.Pool_id -AutoLogoffTime 20 -Powerpolicy 'PowerOff' -DeletePolicy 'DeleteOnUse' -MaximumCount 2 -HeadroomCount 2 -MinimumCount 2}

<#SviPersistent is persistent linked clone pool Powerpolicy set to suspend so your persistent users can come back to any work they had left open. #>
if ($pool.PoolType -eq 'SviPersistent')
{ Update-AutomaticLinkedClonePool -Pool_id $pool.Pool_id -Powerpolicy 'Suspend' -AutoLogoffTime 20}

}

This code is get your desktops back online.
Adjust the -MaximumCount, HeadroomCount, MinimumCount based on your needs.

$listOfPools = Get-Pool

foreach ( $pool in $listOfPools){

if ($pool.PoolType -eq 'SviNonPersistent')
{Update-AutomaticLinkedClonePool -Pool_id $pool.Pool_id -Powerpolicy 'Alwayson' -AutoLogoffTime Never -DeletePolicy 'RefreshOnUse' -MaximumCount 20 -HeadroomCount 5 -MinimumCount 5
}

if ($pool.PoolType -eq 'SviPersistent')
{
Update-AutomaticLinkedClonePool -Pool_id $pool.Pool_id -Powerpolicy 'Alwayson' -AutoLogoffTime Never}

}

Next up on my to do list is get a Hadoop cluster going with Project Serengeti

Trackbacks

  1. […] first KB I find interesting but I thought I should post the second one because of my blog post on shutting and bringing up a View environment for time sharing. Apparently if you use PowerShell to do update your pools the Use host caching option in the […]

Speak Your Mind

*