Skip to content

Commit

Permalink
B OpenNebula#3230 Fails when trying to migrate a VM with PCI devices …
Browse files Browse the repository at this point in the history
…without poweroff flag
  • Loading branch information
Christian González committed Apr 17, 2019
1 parent 3f62184 commit 3c7446d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/lcm/LifeCycleActions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,16 @@ void LifeCycleManager::migrate_action(const LCMAction& la)
return;
}

vm->get_requirements(cpu, mem, disk, pci);

if (pci.size() > 0)
{
vm->log("LCM", Log::ERROR, "migrate_action, a VM with PCI devices attached can only be migrated via poweroff");
vm->unlock();

return;
}

if (vm->get_state() == VirtualMachine::ACTIVE &&
vm->get_lcm_state() == VirtualMachine::RUNNING)
{
Expand All @@ -254,8 +264,6 @@ void LifeCycleManager::migrate_action(const LCMAction& la)

vm->set_resched(false);

vm->get_requirements(cpu, mem, disk, pci);

hpool->add_capacity(vm->get_hid(), vm->get_oid(), cpu, mem, disk, pci);

vm->set_stime(the_time);
Expand Down Expand Up @@ -334,8 +342,6 @@ void LifeCycleManager::migrate_action(const LCMAction& la)

vm->reset_info();

vm->get_requirements(cpu, mem, disk, pci);

if ( vm->get_hid() != vm->get_previous_hid() )
{
hpool->del_capacity(vm->get_previous_hid(), vm->get_oid(), cpu, mem,
Expand Down

0 comments on commit 3c7446d

Please sign in to comment.