Revision a7394113 src/lcm/LifeCycleActions.cc

View differences:

src/lcm/LifeCycleActions.cc
267 267

  
268 268
        vmm->trigger(VirtualMachineManager::SAVE,vid);
269 269
    }
270
    else if (vm->get_state() == VirtualMachine::ACTIVE &&
271
             vm->get_lcm_state() == VirtualMachine::PROLOG_MIGRATE_FAILURE)
272
    {
273
        //----------------------------------------------------
274
        //   Bypass SAVE_MIGRATE
275
        //----------------------------------------------------
276

  
277
        Nebula& nd = Nebula::instance();
278
        TransferManager * tm = nd.get_tm();
279

  
280
        int    cpu, mem, disk;
281
        time_t the_time = time(0);
282

  
283
        vm->set_resched(false);
284

  
285
        vm->set_state(VirtualMachine::PROLOG_MIGRATE);
286

  
287
        vm->delete_snapshots();
288

  
289
        map<string, string> empty;
290

  
291
        vm->update_info(0, 0, -1, -1, empty);
292

  
293
        vmpool->update(vm);
294

  
295
        vm->set_stime(the_time);
296

  
297
        vm->set_previous_action(History::MIGRATE_ACTION);
298

  
299
        vm->set_previous_prolog_etime(the_time);
300

  
301
        vm->set_previous_etime(the_time);
302

  
303
        vm->set_previous_vm_info();
304

  
305
        vm->set_previous_reason(History::USER);
306

  
307
        vmpool->update_previous_history(vm);
308

  
309
        vmpool->update_history(vm);
310

  
311
        vm->get_requirements(cpu,mem,disk);
312

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

  
315
        hpool->del_capacity(vm->get_previous_hid(), vm->get_oid(), cpu, mem, disk);
316

  
317
        vm->log("LCM", Log::INFO, "New VM state is PROLOG_MIGRATE");
318

  
319
        //----------------------------------------------------
320

  
321
        tm->trigger(TransferManager::PROLOG_MIGR,vid);
322
    }
270 323
    else if (vm->get_state()     == VirtualMachine::ACTIVE &&
271 324
             vm->get_lcm_state() == VirtualMachine::UNKNOWN)
272 325
    {
......
1116 1169
        break;
1117 1170

  
1118 1171
        case VirtualMachine::PROLOG_MIGRATE:
1172
        case VirtualMachine::PROLOG_MIGRATE_FAILURE:
1119 1173
            vm->set_prolog_etime(the_time);
1120 1174
            vmpool->update_history(vm);
1121 1175

  
......
1182 1236
        //----------------------------------------------------------------------
1183 1237
        case VirtualMachine::PROLOG:
1184 1238
        case VirtualMachine::PROLOG_MIGRATE:
1239
        case VirtualMachine::PROLOG_MIGRATE_FAILURE:
1185 1240
        case VirtualMachine::PROLOG_RESUME:
1186 1241
        case VirtualMachine::PROLOG_UNDEPLOY:
1187 1242
            if (success)

Also available in: Unified diff