You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@vcl.apache.org by 杨杰 <xt...@gmail.com> on 2009/05/25 15:07:25 UTC

The Datastruct in the esx.pm

Hi,
we are now trying to call the load function in the esx.pm module, but it is
found a difficult task to get the data structure of the parameters in this
function.

Cloud you please provide us the data structure of the parameter of the
function load() ? And is there any docs providing the definition information
of the functions in the Module esx.pm ? Your help will accelerate our
experiment considerably !

Thank you !

-- 
Yang Jie(杨杰)

Team of MRMSS, Xi'an Jiaotong University

Department of Computer Science and Technology, Xi’an Jiaotong University

TEL: +8613468883723;029-82665263 EXT.24

MSN: xtyangjie2004@yahoo.com.cn

E-mail: xtyangjie@gmail.com
Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
- "For your information, I would like to ask a question."

Re: The Datastruct in the esx.pm

Posted by 杨杰 <xt...@gmail.com>.
Thank you ! I have tried it but found it better to use the new.pm file which
was mentioned by you. Then if i want to use the file of new.pm to provision
the images manually, how could i do ?
Thank you !

On Wed, May 27, 2009 at 3:41 AM, Andy Kurth <an...@ncsu.edu> wrote:

> Hello,
> I don't fully understand what you are having trouble with but I'll try to
> provide some information which will hopefully help.  Please clarify if the
> following information isn't helpful.
>
> Are you trying to manually call load()?  It is normally called from new.pm,
> but there are several things that need to happen in vcld, State.pm, and
> new.pm before it gets called.
>
> If you are attempting to call load() manually for some sort of test, the
> following code should work if you already have a request/reservation
> inserted in the database and a $request_id variable set to the request.idvalue.  Running the following code in anything but a test script is strongly
> discouraged.  Your code should never use the hash returned by
> get_request_info().  I would only use it to get a better understanding about
> the steps that occur prior to load() being called.
>
>
> use VCL::utils;
> use VCL::Module::Provisioning::esx;
>
> # Get a hash containing the information about a request
> my %request_info = get_request_info($request_id);
>
> # Create a DataStructure object
> my $data_structure = new VCL::DataStructure({request_data =>
> \%request_info, reservation_id => $request_info{RESERVATIONID}});
>
> # Create an ESX provisioning engine object
> my $esx = VCL::Module::Provisioning::esx->new({data_structure =>
> $data_structure});
>
> # Call load()
> my $load_result = $esx->load();
>
>
> Hope this helps,
> Andy
>
>
>
>
>
> 杨杰 wrote:
>
>> Hi,
>> we are now trying to call the load function in the esx.pm module, but it
>> is
>> found a difficult task to get the data structure of the parameters in this
>> function.
>>
>> Cloud you please provide us the data structure of the parameter of the
>> function load() ? And is there any docs providing the definition
>> information
>> of the functions in the Module esx.pm ? Your help will accelerate our
>> experiment considerably !
>>
>> Thank you !
>>
>>


-- 
Yang Jie(杨杰)

Team of MRMSS, Xi'an Jiaotong University

Department of Computer Science and Technology, Xi’an Jiaotong University

TEL: +8613468883723;029-82665263 EXT.24

MSN: xtyangjie2004@yahoo.com.cn

E-mail: xtyangjie@gmail.com
Erma Bombeck <http://www.brainyquote.com/quotes/authors/e/erma_bombeck.html>
- "Never have more children than you have car windows."

Re: The Datastruct in the esx.pm

Posted by Andy Kurth <an...@ncsu.edu>.
Hello,
I don't fully understand what you are having trouble with but I'll try to 
provide some information which will hopefully help.  Please clarify if the 
following information isn't helpful.

Are you trying to manually call load()?  It is normally called from new.pm, but 
there are several things that need to happen in vcld, State.pm, and new.pm 
before it gets called.

If you are attempting to call load() manually for some sort of test, the 
following code should work if you already have a request/reservation inserted in 
the database and a $request_id variable set to the request.id value.  Running 
the following code in anything but a test script is strongly discouraged.  Your 
code should never use the hash returned by get_request_info().  I would only use 
it to get a better understanding about the steps that occur prior to load() 
being called.


use VCL::utils;
use VCL::Module::Provisioning::esx;

# Get a hash containing the information about a request
my %request_info = get_request_info($request_id);
	
# Create a DataStructure object
my $data_structure = new VCL::DataStructure({request_data => \%request_info, 
reservation_id => $request_info{RESERVATIONID}});

# Create an ESX provisioning engine object
my $esx = VCL::Module::Provisioning::esx->new({data_structure => $data_structure});

# Call load()
my $load_result = $esx->load();


Hope this helps,
Andy




杨杰 wrote:
> Hi,
> we are now trying to call the load function in the esx.pm module, but it is
> found a difficult task to get the data structure of the parameters in this
> function.
> 
> Cloud you please provide us the data structure of the parameter of the
> function load() ? And is there any docs providing the definition information
> of the functions in the Module esx.pm ? Your help will accelerate our
> experiment considerably !
> 
> Thank you !
>