1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-23 22:50:09 +03:00

F #5326 Enabled delete system snapshots for a power-off vcenter-VM (#470)

* F #5326 Enabled delete system snapshots for a power-off vcenter-VM

* Update exit condition
This commit is contained in:
juanmont 2017-09-28 17:35:04 +02:00 committed by Ruben S. Montero
parent 0b36571b23
commit 85ce992f2a

View File

@ -1519,8 +1519,8 @@ int DispatchManager::snapshot_delete(int vid, int snap_id,
return -1;
}
if ( vm->get_state() != VirtualMachine::ACTIVE ||
vm->get_lcm_state() != VirtualMachine::RUNNING )
if ( (vm->get_state() != VirtualMachine::ACTIVE || vm->get_lcm_state() != VirtualMachine::RUNNING) ||
(!vmm->is_keep_snapshots(vm->get_vmm_mad()) && vm->get_state() == VirtualMachine::POWEROFF) )
{
oss << "Could not delete snapshot " << snap_id << " for VM " << vid
<< ", wrong state " << vm->state_str() << ".";