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

Re: [Xen-users] how to know whether a vm has been startup



On Thu, Jul 12, 2012 at 12:35 PM, Tony Huang <tonycongjie@xxxxxxxxx> wrote:
> I am looking for a way to detect whether a vm has been startup and
> ready to go. For example, ready to been ssh into, not just in the
> start up process. Anyone know?

Short version: no, there's no facility that provides that.

Long version: you need to write your own script to check. Possibly
something that does these things:
- xm create
- try to connect to the guests port and exit immediately (e.g.
something like "echo | nc -w 1 IP_OF_domU 22")
- if the above commands returns non-zero error code (i.e. it couldn't
connect due to timeout or connection refused), retry again for a
specified number of seconds (e.g. using a WHILE for FOR loop)
- return the appropriate error code (e.g. "0" if you can connect
successfully within the specified period, "1" otherwise)

-- 
Fajar

_______________________________________________
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®.