Hi,
I've ran through the codebase and couldn't understand the situtation:)
1. When a live migrate succeedes the VMM Driver [1] seems to call the LCM
deploy_success_action() [2] method which in turn sets the VM's lcm state to
RUNNING.
vm->set_state(VirtualMachine::RUNNING);
vmpool->update(vm);
2. According to Hook.h [3] and PoolSQL.h [4] registered update hooks are
executed on every pool update.
do_hooks(objsql, Hook::UPDATE);
That is VMPool a PoolSQL descendant should trigger its registered update hooks.
3. According to VirtualMachinePool [5] and VirtualMachineHook [6] the hook
registered for the RUNNING event is an update hook: it is a
VirtualMachineStateHook
descendant which itself is a VirtualMachineStateMapHook descendant which seems
to be an update hook.
So that RUNNING hooks' do_hook method seems to be triggered on every vmpool
update.
VirtualMachineStateMapHook(...):
Hook(name, cmd, args, Hook::UPDATE, remote){};
4. According to the VirtualMachineStateHook [7] the do_hook method seems to
trigger the registered script if (1) the state is changed and (2) the actual
state is
the registered target lcm/vm state (ie. RUNNING and ACTIVE).
if ( prev_lcm == cur_lcm && prev_vm == cur_vm ) //Still in the same state
{
return;
}
if ( cur_lcm == lcm && cur_vm == this->vm )
{
...
hmd->execute(...)
}
So after all it seems that RUNNING hooks are executed whenever a live migration
succeed (since I guess a RUNNING vm is also an ACTIVE vm).
Note that I've did just a quick code walk through and I'm not a C++ programmer
(in fact have no C++ experience). So I might be absolutely wrong:)
I guess Szabolcs we might simple test the use case:)
Cheers,
Gyula
[1] VMM driver:
http://dev.opennebula.org/projects/opennebula/repository/revisions/master/entry/src/vmm/VirtualMachineManagerDriver.cc
[2] LCM deploy_success_action
http://dev.opennebula.org/projects/opennebula/repository/revisions/master/entry/src/lcm/LifeCycleStates.cc
[3] Hook.h
http://dev.opennebula.org/projects/opennebula/repository/revisions/master/entry/include/Hook.h
[4] PoolSQL.h
http://dev.opennebula.org/projects/opennebula/repository/revisions/master/entry/include/PoolSQL.h
[5] VirtualMachinePool.cc
http://dev.opennebula.org/projects/opennebula/repository/revisions/master/entry/src/vm/VirtualMachinePool.cc
[6] VirtualMachineHook.h
http://dev.opennebula.org/projects/opennebula/repository/revisions/master/entry/include/VirtualMachineHook.h
[7] VirtualMachineHook.cc
http://dev.opennebula.org/projects/opennebula/repository/revisions/master/entry/src/vm/VirtualMachineHook.cc
Feladó: users-boun...@lists.opennebula.org [users-boun...@lists.opennebula.org]
; meghatalmazó: Jaime Melis [j.me...@fdi.ucm.es]
Küldve: 2010. július 7. 12:13
Címzett: Székelyi Szabolcs
Másolatot kap: users@lists.opennebula.org
Tárgy: Re: [one-users] hooks on migration
Hello,
In OpenNebula the hooks can only be executed on the following events:
- CREATE, when the VM is created (onevm create)
- RUNNING, after the VM is successfully booted
- SHUTDOWN, after the VM is shutdown
- STOP, after the VM is stopped (including VM image transfers)
- DONE, after the VM is deleted or shutdown
Therefore after a migration the ebtables script will not be executed.
Regards,
Jaime
2010/7/5 Székelyi Szabolcs :
> Hello,
>
> I'd like to ask about the operation of the hook system. We're using the
> recommended ebtables way to separate virtual networks. The question is, what
> happens if a VM is live-migrated from a host to the other: does the hook
> script that sets up ebtables run at that time as well to set up the proper
> rules on the destination host?
>
> Thanks,
> --
> Szabolcs
>
> ___
> Users mailing list
> Users@lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
___
Users mailing list
Users@lists.opennebula.org
http://lists.opennebula.org/listinfo.cgi/users-opennebula.org