Jim Fehlig wrote: > This patch adds a simple lock mechanism when starting domains by placing > a lock file in xend-domains-path/. The lock file is removed > when domain is stopped. The motivation for such a mechanism is to > prevent starting the same domain from multiple hosts. > > If xend-domains-path is set to shared mount point, a domain will fail to > start on host B if it is already running on host A. I've added an > option to XendOptions to control the behavior with default of no lock. > > The patch certainly needs some testing (and probably adjustment) to > ensure the lock is handled properly on save, restore, migrate, domain > crash, etc. but wanted to get folks' thought on this approach before > continuing this endeavor. Some simple improvements could include adding > info (domain name/id, start time, vmm hostname) to the lock file, > allowing such messages as "domain foo seems to be already running on > host bar" and a --force option to create/start to override the lock. A > per-domain config option could also be added to allow more fine-grained > control. > > Comments, suggestions, alternative approaches, ... are welcome and > appreciated :-). > this patch xen-running-lock.patch add a external lock facility to get the same result. file-lock.c is a simple implement of the external lock utility. the external locking facility can leverage the dlm if you are in a cluster environment. cheers, zhigang > Regards, > Jim > > > ------------------------------------------------------------------------ > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel