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

Feature #3778: Use previous system dir in TM commands

This commit is contained in:
Carlos Martín 2015-04-29 17:01:06 +02:00
parent 98af16330c
commit b94d0d951b
3 changed files with 31 additions and 9 deletions

View File

@ -476,6 +476,16 @@ public:
return history->rsystem_dir;
}
/**
* Returns the remote VM directory for the previous host.
* The hasPreviousHistory() function MUST be called before this one.
* @return the remote system directory for the VM
*/
const string & get_previous_remote_system_dir() const
{
return previous_history->rsystem_dir;
};
/**
* Returns the local VM directory. The VM local dir is in the form:
* $SYSTEM_DS_BASE_PATH/$VM_ID. Temporary stores VM disks.
@ -688,6 +698,16 @@ public:
return history->checkpoint_file;
};
/**
* Returns the checkpoint filename for the previous host.
* The hasPreviousHistory() function MUST be called before this one.
* @return the checkpoint filename
*/
const string & get_previous_checkpoint_file() const
{
return previous_history->checkpoint_file;
};
/**
* Returns the hostname for the current host. The hasHistory()
* function MUST be called before this one.

View File

@ -903,7 +903,7 @@ void TransferManager::prolog_migr_action(int vid)
xfr << "MV "
<< tm_mad << " "
<< vm->get_previous_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << disk_id << " "
<< vm->get_previous_remote_system_dir() << "/disk." << disk_id << " "
<< vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << "/disk." << disk_id << " "
<< vm->get_oid() << " "
@ -914,7 +914,7 @@ void TransferManager::prolog_migr_action(int vid)
xfr << "MV "
<< vm_tm_mad << " "
<< vm->get_previous_hostname() << ":"
<< vm->get_remote_system_dir() << " "
<< vm->get_previous_remote_system_dir() << " "
<< vm->get_hostname() << ":"
<< vm->get_remote_system_dir() << " "
<< vm->get_oid() << " "
@ -1581,7 +1581,7 @@ int TransferManager::epilog_delete_commands(VirtualMachine *vm,
}
host = vm->get_previous_hostname();
system_dir = vm->get_remote_system_dir();
system_dir = vm->get_previous_remote_system_dir();
vm_tm_mad = vm->get_previous_tm_mad();
vm_ds_id = vm->get_previous_ds_id();

View File

@ -532,7 +532,7 @@ void VirtualMachineManager::save_action(
VirtualMachine * vm;
const VirtualMachineManagerDriver * vmd;
string hostname, vnm_mad;
string hostname, vnm_mad, checkpoint_file;
string vm_tmpl;
string * drv_msg;
ostringstream os;
@ -566,13 +566,15 @@ void VirtualMachineManager::save_action(
goto error_previous_history;
}
hostname = vm->get_previous_hostname();
vnm_mad = vm->get_previous_vnm_mad();
hostname = vm->get_previous_hostname();
vnm_mad = vm->get_previous_vnm_mad();
checkpoint_file = vm->get_previous_checkpoint_file();
}
else
{
hostname = vm->get_hostname();
vnm_mad = vm->get_vnm_mad();
hostname = vm->get_hostname();
vnm_mad = vm->get_vnm_mad();
checkpoint_file = vm->get_checkpoint_file();
}
// Invoke driver method
@ -584,7 +586,7 @@ void VirtualMachineManager::save_action(
vm->get_deploy_id(),
"",
"",
vm->get_checkpoint_file(),
checkpoint_file,
"",
"",
"",