Re: VCL questions (provisioning/deprovisioning)

2009-08-04 Thread Toks Adeshiyan
Thanks Aaron.  This explanation helps a whole lot -- I understand this 
issue much better.


Toks

Aaron Peeler wrote:

Toks,

Yes this is true for any compute resource - bare-metal or virtual 
machine.


The goal being to have that compute resource reloaded and ready for 
the next user. In an edu environment - students, faculty have a hard 
time waiting more than a minute for anything.


There is a jira issue on power-management. The general idea behind 
this is defining a policy on when to power-down compute resources, be 
it a blade or vm. Which the policy could be unload all the time or 
when the overall system is less than a certain percentage of use.


But in the short-term this unload option could be part of the 
provisioning module load routine.
By making use of the data-structure hash, one could find out the 
last-state of the compute resource i.e if 'inuse' then call an unload 
routine, powerdown and then make the state of the machine available or 
release it.


Hope this is what your looking for.

Aaron


Andy,

I would like to revisit this discussion.  I believe I understand how 
this

is applicable when physical resources are being provisioned.  Does the
same hold true for virtual resources?  It seems that once a VM is
provisioned through the vmware or esx modules, that it would persist
indefinitely either via reloading or sanitization for as long as it's
host system is up and running, waiting for another user to claim 
it.  I

haven't observed a case where a provisioned virtual resource's lifecycle
actually comes to an end.

Toks


Toks







Aaron Peeler
OIT Advanced Computing
College of Engineering-NCSU
919.513.4571
http://vcl.ncsu.edu




Re: VCL questions (provisioning/deprovisioning)

2009-03-27 Thread Andy Kurth

Hello Toks,
Good questions, answered inline...

Toks Adeshiyan wrote:

Hi all,

I have a couple of questions relating to the provisioning/deprovisioning 
processes in VCL...


(1)  I would like to understand better why the provisioning modules 
update the IP address of the resource being provisioned during the load 
process (via the getdynamicipaddress function).  It appears that VCL 
will make the same call sometime after the load process completes.  Does 
this behavior change depending on the state in which the request was made?


You are correct in that there is some duplication of this call.  It's getting 
called by both the provisioning modules' load() subroutines and 
new.pm::reserve_computer().


The getdynamicaddress() subroutine's purpose is to retrieve the current public 
IP address being used on a computer.  The computer table's IPaddress column is 
then updated in the database.  This needs to be done if the computer is using 
dynamic DHCP because it may receive a different IP address after it is reloaded. 
 The computer.IPaddress column is used to present the connection information to 
the user.  It needs to be updated or else the user may be directed to connect to 
the wrong IP address.


The request state does matter.  The call from $provisioner::load() will happen 
when a request in state new or reload is processed and the computer needs to 
be reloaded.  (Note: the computer may not need to be reloaded if it already has 
the correct image loaded)


The call from new.pm::reserve_computer() will only happen if the request state 
is new.  This means if a user makes a reservation for an image that isn't 
loaded, getdynamicaddress() is called twice.  If a user makes a reservation for 
an image that is already loaded, getdynamicaddress() is called once from 
new.pm::reserve_computer().


If a reload request is processed (request.state = reload), getdynamicaddress() 
is called once from $provisioner::load().


Your question brings up a point regarding the ongoing OS and provisioning engine 
modularization work.  First off, the getdynamicaddress() subroutine in utils.pm 
should be phased out and replaced by subs in the OS modules.


I'm not sure if it needs to be called in the reserve phase but it isn't hurting 
anything except for increasing wait times a little bit.  Is there any reason why 
getdynamicaddress() needs to be called during reserve if it's always called 
after load?


I would prefer to remove the calls from all of the provisioning modules and move 
it up to new.pm::load().  This way, provisioning module implementations don't 
need to worry about calling it and I also don't like the idea of provisioning 
modules setting anything in the computer table.  Any changes to the computer 
table and most others should be handled by the state modules (new.pm, image.pm, 
...) or vcld.



(2)  I would also like to understand how resources are deprovisioned.  
What happens when a provisioned resource's allocated time has lapsed?  
Are there any plans for an implementation of an official deprovisioning 
process (e.g., VCL::Module::Provisioning::unload( ))?


Deprovisioning already happens and is handled by reclaim.pm.  The process 
depends on whether or not a user logged into the computer, which can be 
determined by the value of request.laststate.


If a user logged in, the computer needs to be completely reloaded.  You'll know 
this if request.laststate = inuse.  If reclaim.pm detects this, it inserts a 
reload request for the computer into the database and exits.


If reclaim.pm sees that request.laststate is not inuse, it means the user 
never logged in and it's safe to attempt to sanitize the computer without 
reloading it.  reclaim.pm will call the OS module's sanitize() subroutine.  If 
successful, the computer state is set to available and can be used for another 
reservation.  If sanitize() fails, reclaim.pm inserts a reload request into the 
database and exits.


Hope this helps,
Andy



Toks



--
Andy Kurth
Virtual Computing Lab
Office of Information Technology
North Carolina State University
andy_ku...@ncsu.edu
919.513.4090