[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] how to start VMs in a particular order


  • To: xen-users@xxxxxxxxxxxxx
  • From: "J. Roeleveld" <joost@xxxxxxxxxxxx>
  • Date: Fri, 27 Jun 2014 21:52:36 +0200
  • Delivery-date: Fri, 27 Jun 2014 19:54:03 +0000
  • List-id: Xen user discussion <xen-users.lists.xen.org>

On Friday, June 27, 2014 01:10:30 PM lee wrote:
> Freddie Cash <fjwcash@xxxxxxxxx> writes:
> > On Jun 26, 2014 6:45 PM, "lee" <lee@xxxxxxxxxxxxxxx> wrote:
> >> "squidmobile@xxxxxxxxxxx" <squidmobile@xxxxxxxxxxx> writes:
> >> > 26 jun 2014
> >> > 
> >> > greetings,
> >> > 
> >> >> how would I make it so that VMs which are started automatically are
> >> >> being started in a particular order?
> >> > 
> >> > well, i have something that (sort of) works for me.  i create my
> >> > vm.cfg files in a directory of my choosing and ln -s from that
> >> > directory to etc/xen/auto.  i rename the symbolic links to look
> >> > 
> >> > like this:
> >> >   01.vm-name.cfg
> >> >   02.vm-name.cfg
> >> >   03.vm-name.cfg
> >> >   ...
> >> 
> >> Yes, I though of numbering them --- haven't tried yet, though.
> >> 
> >> Is this a feature, or did you happen to create the links in the desired
> >> order?  I see both possibilities, i. e. sorting the directory entries as
> >> a feature, or start the VMs in the order the files/links have been
> >> created/are found as directory entries.
> >> 
> >> > when i reboot my system, the vm's come up in the proper sequence.
> >> > however, xen starts them at its pace and NOT when the previous vm
> >> > is ready for transactions.
> >> 
> >> Yes, starting them one after another without waiting for them to be up
> >> won't make a difference.  In this case, the VM with the name server
> >> needs to be up first, then the VM with the firewall, then the VM with
> >> the NFS server and finally the rest of them in no particular order.
> > 
> > Inside each VM, write a startup script that pauses the boot process until
> > the needed resource is available.
> 
> That's a good idea ... There must be a way to define dependencies for
> the boot process because some services must be started in the right
> order, and if everything would depend on the checking script, it should
> work.
> 
> > It can be add simple as a while loop waiting for a ping response. Or as
> > complex as "try to resolve a hostname". Or whatever else is needed.
> 
> That's the problem:  How do you try to resolve a hostname, and how do
> you find out whether a NFS server is up or not?

By trying to connect to the port the NFS server is running on. See:
http://stackoverflow.com/questions/4922943/how-to-test-if-remote-tcp-port-is-opened-from-shell-script

--
Joost

_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxx
http://lists.xen.org/xen-users


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.