1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

Feature #1112: Do not use host's TM_MAD

This commit is contained in:
Carlos Martín 2012-02-22 16:01:30 +01:00
parent 546b6c8a4e
commit 98c5c246c2
8 changed files with 45 additions and 71 deletions

View File

@ -46,8 +46,7 @@ public:
const string& hostname,
const string& vm_dir,
const string& vmm,
const string& vnm,
const string& tm);
const string& vnm);
~History(){};
@ -93,7 +92,6 @@ private:
string vmm_mad_name;
string vnm_mad_name;
string tm_mad_name;
time_t stime;
time_t etime;

View File

@ -139,15 +139,6 @@ public:
return vnm_mad_name;
};
/**
* Retrives TM mad name
* @return string tm mad name
*/
const string& get_tm_mad() const
{
return tm_mad_name;
};
/**
* Retrives IM mad name
* @return string im mad name

View File

@ -52,14 +52,13 @@ protected:
RequestAttributes& att, PoolObjectAuth* host_perms);
int get_host_information(int hid, string& name, string& vmm, string& vnm,
string& tm, RequestAttributes& att, PoolObjectAuth& host_perms);
RequestAttributes& att, PoolObjectAuth& host_perms);
int add_history(VirtualMachine * vm,
int hid,
const string& hostname,
const string& vmm_mad,
const string& vnm_mad,
const string& tm_mad,
RequestAttributes& att);
VirtualMachine * get_vm(int id, RequestAttributes& att);

View File

@ -217,8 +217,7 @@ public:
const string& hostname,
const string& vm_dir,
const string& vmm_mad,
const string& vnm_mad,
const string& tm_mad);
const string& vnm_mad);
/**
* Duplicates the last history record. Only the host related fields are
@ -294,26 +293,6 @@ public:
return previous_history->vnm_mad_name;
};
/**
* Returns the TM driver name for the current host. The hasHistory()
* function MUST be called before this one.
* @return the TM mad name
*/
const string & get_tm_mad() const
{
return history->tm_mad_name;
};
/**
* Returns the TM driver name for the previous host. The
* hasPreviousHistory() function MUST be called before this one.
* @return the TM mad name
*/
const string & get_previous_tm_mad() const
{
return previous_history->tm_mad_name;
};
/**
* Returns the transfer filename. The transfer file is in the form:
* $ONE_LOCATION/var/$VM_ID/transfer.$SEQ

View File

@ -83,7 +83,6 @@ int RequestManagerVirtualMachine::get_host_information(int hid,
string& name,
string& vmm,
string& vnm,
string& tm,
RequestAttributes& att,
PoolObjectAuth& host_perms)
{
@ -106,7 +105,6 @@ int RequestManagerVirtualMachine::get_host_information(int hid,
name = host->get_name();
vmm = host->get_vmm_mad();
vnm = host->get_vnm_mad();
tm = host->get_tm_mad();
host->get_permissions(host_perms);
@ -141,7 +139,6 @@ int RequestManagerVirtualMachine::add_history(VirtualMachine * vm,
const string& hostname,
const string& vmm_mad,
const string& vnm_mad,
const string& tm_mad,
RequestAttributes& att)
{
Nebula& nd = Nebula::instance();
@ -153,7 +150,7 @@ int RequestManagerVirtualMachine::add_history(VirtualMachine * vm,
nd.get_configuration_attribute("VM_DIR",vmdir);
vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad,tm_mad);
vm->add_history(hid,hostname,vmdir,vmm_mad,vnm_mad);
rc = vmpool->update_history(vm);
@ -278,14 +275,13 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList,
string hostname;
string vmm_mad;
string vnm_mad;
string tm_mad;
int id = xmlrpc_c::value_int(paramList.getInt(1));
int hid = xmlrpc_c::value_int(paramList.getInt(2));
bool auth = false;
if (get_host_information(hid,hostname,vmm_mad,vnm_mad,tm_mad, att, host_perms) != 0)
if (get_host_information(hid,hostname,vmm_mad,vnm_mad,att, host_perms) != 0)
{
return;
}
@ -312,7 +308,7 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList,
return;
}
if ( add_history(vm,hid,hostname,vmm_mad,vnm_mad,tm_mad,att) != 0)
if ( add_history(vm,hid,hostname,vmm_mad,vnm_mad,att) != 0)
{
vm->unlock();
return;
@ -340,7 +336,6 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
string hostname;
string vmm_mad;
string vnm_mad;
string tm_mad;
int id = xmlrpc_c::value_int(paramList.getInt(1));
int hid = xmlrpc_c::value_int(paramList.getInt(2));
@ -348,7 +343,7 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
bool auth = false;
if (get_host_information(hid,hostname,vmm_mad,vnm_mad,tm_mad, att, host_perms) != 0)
if (get_host_information(hid,hostname,vmm_mad,vnm_mad,att, host_perms) != 0)
{
return;
}
@ -377,7 +372,7 @@ void VirtualMachineMigrate::request_execute(xmlrpc_c::paramList const& paramList
return;
}
if ( add_history(vm,hid,hostname,vmm_mad,vnm_mad,tm_mad,att) != 0)
if ( add_history(vm,hid,hostname,vmm_mad,vnm_mad,att) != 0)
{
vm->unlock();
return;

View File

@ -236,7 +236,9 @@ void TransferManager::prolog_action(int vid)
goto error_history;
}
tm_md = get(vm->get_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{
@ -416,7 +418,8 @@ error_file:
error_driver:
os.str("");
os << "prolog, error getting driver " << vm->get_tm_mad();
// TODO
// os << "prolog, error getting driver " << vm->get_tm_mad();
goto error_common;
error_empty_disk:
@ -463,7 +466,9 @@ void TransferManager::prolog_migr_action(int vid)
goto error_history;
}
tm_md = get(vm->get_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{
@ -506,7 +511,8 @@ error_file:
error_driver:
os.str("");
os << "prolog_migr, error getting driver " << vm->get_tm_mad();
// TODO
// os << "prolog_migr, error getting driver " << vm->get_tm_mad();
error_common:
(nd.get_lcm())->trigger(LifeCycleManager::PROLOG_FAILURE,vid);
@ -547,7 +553,9 @@ void TransferManager::prolog_resume_action(int vid)
goto error_history;
}
tm_md = get(vm->get_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{
@ -590,7 +598,8 @@ error_file:
error_driver:
os.str("");
os << "prolog_resume, error getting driver " << vm->get_tm_mad();
// TODO
// os << "prolog_resume, error getting driver " << vm->get_tm_mad();
error_common:
(nd.get_lcm())->trigger(LifeCycleManager::PROLOG_FAILURE,vid);
@ -637,7 +646,9 @@ void TransferManager::epilog_action(int vid)
goto error_history;
}
tm_md = get(vm->get_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{
@ -748,7 +759,9 @@ void TransferManager::epilog_stop_action(int vid)
goto error_history;
}
tm_md = get(vm->get_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{
@ -791,7 +804,8 @@ error_file:
error_driver:
os.str("");
os << "epilog_stop, error getting driver " << vm->get_tm_mad();
// TODO
// os << "epilog_stop, error getting driver " << vm->get_tm_mad();
error_common:
(nd.get_lcm())->trigger(LifeCycleManager::EPILOG_FAILURE,vid);
@ -831,7 +845,9 @@ void TransferManager::epilog_delete_action(int vid)
goto error_history;
}
tm_md = get(vm->get_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{
@ -914,7 +930,9 @@ void TransferManager::epilog_delete_previous_action(int vid)
goto error_history;
}
tm_md = get(vm->get_previous_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_previous_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{
@ -998,7 +1016,9 @@ void TransferManager::driver_cancel_action(int vid)
goto error_history;
}
tm_md = get(vm->get_tm_mad());
// TODO: get tm_md from somewhere...
// tm_md = get(vm->get_tm_mad());
tm_md = 0;
if ( tm_md == 0 )
{

View File

@ -44,7 +44,6 @@ History::History(
hid(-1),
vmm_mad_name(""),
vnm_mad_name(""),
tm_mad_name(""),
stime(0),
etime(0),
prolog_stime(0),
@ -64,8 +63,7 @@ History::History(
const string& _hostname,
const string& _vm_dir,
const string& _vmm,
const string& _vnm,
const string& _tm):
const string& _vnm):
oid(_oid),
seq(_seq),
hostname(_hostname),
@ -73,7 +71,6 @@ History::History(
hid(_hid),
vmm_mad_name(_vmm),
vnm_mad_name(_vnm),
tm_mad_name(_tm),
stime(0),
etime(0),
prolog_stime(0),
@ -271,7 +268,6 @@ string& History::to_xml(string& xml) const
"<ETIME>" << etime << "</ETIME>" <<
"<VMMMAD>" << vmm_mad_name << "</VMMMAD>"<<
"<VNMMAD>" << vnm_mad_name << "</VNMMAD>"<<
"<TMMAD>" << tm_mad_name << "</TMMAD>" <<
"<PSTIME>" << prolog_stime << "</PSTIME>"<<
"<PETIME>" << prolog_etime << "</PETIME>"<<
"<RSTIME>" << running_stime << "</RSTIME>"<<
@ -302,7 +298,6 @@ int History::rebuild_attributes()
rc += xpath(etime , "/HISTORY/ETIME", 0);
rc += xpath(vmm_mad_name , "/HISTORY/VMMMAD", "not_found");
xpath(vnm_mad_name , "/HISTORY/VNMMAD", "dummy");
rc += xpath(tm_mad_name , "/HISTORY/TMMAD", "not_found");
rc += xpath(prolog_stime , "/HISTORY/PSTIME", 0);
rc += xpath(prolog_etime , "/HISTORY/PETIME", 0);
rc += xpath(running_stime, "/HISTORY/RSTIME", 0);

View File

@ -605,8 +605,7 @@ void VirtualMachine::add_history(
const string& hostname,
const string& vm_dir,
const string& vmm_mad,
const string& vnm_mad,
const string& tm_mad)
const string& vnm_mad)
{
ostringstream os;
int seq;
@ -622,7 +621,7 @@ void VirtualMachine::add_history(
previous_history = history;
}
history = new History(oid,seq,hid,hostname,vm_dir,vmm_mad,vnm_mad,tm_mad);
history = new History(oid,seq,hid,hostname,vm_dir,vmm_mad,vnm_mad);
history_records.push_back(history);
};
@ -645,8 +644,7 @@ void VirtualMachine::cp_history()
history->hostname,
history->vm_dir,
history->vmm_mad_name,
history->vnm_mad_name,
history->tm_mad_name);
history->vnm_mad_name);
previous_history = history;
@ -673,8 +671,7 @@ void VirtualMachine::cp_previous_history()
previous_history->hostname,
previous_history->vm_dir,
previous_history->vmm_mad_name,
previous_history->vnm_mad_name,
previous_history->tm_mad_name);
previous_history->vnm_mad_name);
previous_history = history;
history = htmp;