Hi Richard, You can create a hook on RUNNING and then check the VM history to detect if it has reached that state after a migration. Use $TEMPLATE as one of the arguments to get the VM information. You have the life-cycle reference here [1,2].
Below is a sample xml of a VM migrated from (1 localhost) to (0 vm). Note that the HISTORY record with SEQ 0 has a REASON value of 3, that means that the execution on that host ended because the user requested it. Possible values for the REASON element are (see [3]): enum MigrationReason { NONE, /** < Normal termination in host */ ERROR, /** < The VM was migrated because of an error */ STOP_RESUME,/** < The VM was migrated because of a stop/resume request*/ USER, /** < The VM was migrated because of an explicit request */ CANCEL /** < The VM was migrated because of an explicit cancel */ }; <VM> ... <HISTORY_RECORDS> <HISTORY> <SEQ>0</SEQ> <HOSTNAME>localhost</HOSTNAME> <VM_DIR>/var/lib/one/</VM_DIR> <HID>1</HID> <STIME>1324391103</STIME> <ETIME>1324392594</ETIME> <VMMMAD>vmm_dummy</VMMMAD> <TMMAD>tm_shared</TMMAD> <PSTIME>1324391103</PSTIME> <PETIME>1324391103</PETIME> <RSTIME>1324391103</RSTIME> <RETIME>1324392594</RETIME> <ESTIME>0</ESTIME> <EETIME>0</EETIME> <REASON>3</REASON> </HISTORY> <HISTORY> <SEQ>1</SEQ> <HOSTNAME>vm</HOSTNAME> <VM_DIR>/var/lib/one/</VM_DIR> <HID>0</HID> <STIME>1324392594</STIME> <ETIME>0</ETIME> <VMMMAD>vmm_dummy</VMMMAD> <TMMAD>tm_shared</TMMAD> <PSTIME>1324392594</PSTIME> <PETIME>1324392594</PETIME> <RSTIME>1324392594</RSTIME> <RETIME>0</RETIME> <ESTIME>0</ESTIME> <EETIME>0</EETIME> <REASON>0</REASON> </HISTORY> </HISTORY_RECORDS> </VM> Regards. [1] http://opennebula.org/documentation:rel3.0:vm_guide_2#virtual_machine_life-cycle [2] http://opennebula.org/_media/documentation:rel3.0:states-complete.png [3] http://dev.opennebula.org/projects/opennebula/repository/revisions/one-3.0/entry/include/History.h -- Carlos Martín, MSc Project Engineer OpenNebula - The Open Source Toolkit for Data Center Virtualization www.OpenNebula.org | cmar...@opennebula.org | @OpenNebula<http://twitter.com/opennebula><cmar...@opennebula.org> On Sat, Dec 17, 2011 at 11:15 PM, richard -rw- weinberger < richard.weinber...@gmail.com> wrote: > Ruben, > > On Sat, Dec 17, 2011 at 10:52 PM, Ruben S. Montero <rube...@dacya.ucm.es> > wrote: > > Hi Richard, > > > > This is now ready in 3.2 beta1. The networking hooks have been moved to a > > driver form with better integration with the VM life-cycle. Among other > > things this fixes the issues with live migrations stop/resumes etc... > > Good to know. But I guess 3.2 is not yet production ready. > > Is there a way to install iptables rules for a guest upon migration on 3.0? > I don't fear writing my own scripts... > > -- > Thanks, > //richard > _______________________________________________ > 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