Sun Virtual Desktop Connector - Insides on Recycling
By mprove on Jul 20, 2008
originally blogged by Tino Rachui
Recycling is not only an excellent way to protect our environment but also a good way to balance resources in your VDI environment. A couple of interesting postings about this topic has been publish already by Dirk G. in his blog White men can't jump.
I assume you have read them in addition to the official Sun Virtual Desktop Connector 1.0 (SVDC) documentation in order to have the necessary context to understand the topic this blog post is about.
So why am I writing about recycling again? The answer is that question about this area keep coming from many people using the SVDC.
Answering all of these questions individually takes a lot of time so I decided to use a blog as means to address these questions in particular and future technical questions around SVDC in general. I don't aim at duplicating the information that have been given on the topic of recycling elsewhere I rather try to complement them with a little more focus on in-depth technical details on how it is working and how to diagnose issues that you might be facing along the way.The explanations that will follow assume that you are running Windows XP as guest Operating System (OS) inside your Virtual Machines (VM). There exist some limitation for Window Vista please have a look into the official SVDC 1.0 documentation or find some details on White men can't jump.
One crucial point in order to understand how VM recycling with SVDC 1.0 works or how to diagnose possible problems in this area is to understand the differences as well as relationships between the VM power options and the guest OS power options (Windows XP assumed).
With the Windows XP "Power Options" control panel you can
influence how Windows should behave when a certain period of inactivity
has elapsed. On this control panel there exist a 'System standby' drop
down box enabling you to specify a value between 'never' and 'After 5
hours'. When you have chosen a value not equal to 'never' Windows will
go into a low power consumption mode after the specified time of
inactivity (not mouse moves, keystrokes etc.) has elapsed. The state
that Windows then enters is often also referred to as 'standby' mode.
The Virtual Machine Power Options on the other hand
determine "How the VM should respond when the guest OS is placed on
standby". In other words what should VMware Virtual Center (VC) do with a
VM when the guest OS running inside that VM went into the 'standby'
mode. With VC 2.5 there are two possibilities (please consult the
official VMware VirtualCenter/ESX documentation for details):
- Suspend the virtual machine. This options probably makes sense if you want to save resources. If the guest OS inside the VM has entered the 'standby' mode VC will put the VM into suspend mode so that it doesn't consume CPU and memory resources for instance.
- Put the guest OS into standby mode and leave the virtual machine
powered on. This option could make sense if you want to be able to
enable something like Wake On LAN (WoL) for instance.
A second point that is essential in order to really understand how recycling is working with SVDC is to know and grasp the conditions that SVDC uses in order to determine if a VM can be recycled or not. I will explain later how SVDC actually identifies each of these conditions. But first let me name the conditions that must be met so that a VM is subject to recycling (please note that these conditions are combined by 'AND' and 'ORs'):
- The VM is assigned to a user (for SVDC 1.0 this means it resides in the 'used' folder of the corresponding pool) AND
- the VM is in power state 'suspended' OR
- (the VM is in power state 'running' AND no user is logged in to the guest OS) OR
- (the VM is in power state 'running' AND the guest OS is in 'standby' mode)
When a VM will really be recycled after the aforementioned conditions have been met and what happens to it then can be controlled with the pool settings "Idle Time" and "Recycle policy" (again please consult the official SVDC documentation for details).
These are the preconditions in order to understand VM recycling.
Large blog entries are tedious and this one is quite long already so I
will break down the whole topic into multiple postings. Next time I will
explain how SVDC identifies the conditions mentioned above in order to
come to a decision if a VM has to be recycled or not.