1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

M #-: Fix DS id while resuming undeployed VM (#837)

(cherry picked from commit 05e235cde32e69e9ffb6cff1e6824d22a2bddaa3)
This commit is contained in:
Pavel Czerný 2021-02-19 09:37:32 +01:00 committed by Ruben S. Montero
parent 668d6346c9
commit cfbfbf48ad
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
2 changed files with 9 additions and 5 deletions

View File

@ -878,7 +878,10 @@ void VirtualMachineDeploy::request_execute(xmlrpc_c::paramList const& paramList,
vm->get_action() == VMActions::UNDEPLOY_ACTION ||
vm->get_action() == VMActions::UNDEPLOY_HARD_ACTION))
{
ds_id = vm->get_ds_id();
if (ds_id == -1)
{
ds_id = vm->get_ds_id();
}
check_nic_auto = false;
}

View File

@ -890,7 +890,7 @@ void TransferManager::prolog_resume_action(int vid)
VirtualMachineDisks& disks = vm->get_disks();
if (!vm->hasHistory())
if (!vm->hasHistory() || !vm->hasPreviousHistory())
{
goto error_history;
}
@ -935,6 +935,7 @@ void TransferManager::prolog_resume_action(int vid)
}
string tsys = (*disk)->vector_value("TM_MAD_SYSTEM");
if (!tsys.empty())
{
tm_mad_system = "." + tsys;
@ -942,10 +943,10 @@ void TransferManager::prolog_resume_action(int vid)
//MV(.tm_mad_system) tm_mad fe:system_dir/disk.i host:remote_system_dir/disk.i vmid dsid(image)
xfr << "MV"
<< tm_mad_system
<< tm_mad_system
<< " " << tm_mad << " "
<< nd.get_nebula_hostname() << ":"
<< vm->get_system_dir() << "/disk." << disk_id << " "
<< vm->get_previous_system_dir() << "/disk." << disk_id << " "
<< vm->get_hostname() << ":"
<< vm->get_system_dir() << "/disk." << disk_id << " "
<< vm->get_oid() << " "
@ -955,7 +956,7 @@ void TransferManager::prolog_resume_action(int vid)
//MV tm_mad fe:system_dir host:remote_system_dir vmid dsid(system)
xfr << "MV "
<< vm_tm_mad << " "
<< nd.get_nebula_hostname() << ":"<< vm->get_system_dir() << " "
<< nd.get_nebula_hostname() << ":"<< vm->get_previous_system_dir() << " "
<< vm->get_hostname() << ":" << vm->get_system_dir()<< " "
<< vm->get_oid() << " "
<< vm->get_ds_id() << endl;