WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

RE: [Xen-users] Test tools for Xen

On Tue, 2007-02-20 at 08:37 -0800, Kraska, Joe A (US SSA) wrote:
> >I want to know the available automated test tools for xen. 
> >I know one test tool xm-test. Any other availabe tool ?
> 
> 
> Rename the below file to pingpong.py
> 

It is neat :) I did something similar but it was more of a game of hot
potato than ping pong we played locally.

It would be really cool if a bunch of us had one relocation server and
we could join in a global game of hot potato migrating around a small VM
that is doing something precise, such as calculating pi or something
else.

This would have to be nfs / iscsi based and swapless, or everyone would
have to agree on some local semantics to swapoff / swapon (to local
swap) as it migrated. I would say .. swapless, ttylinux based and tiny.

It would also need to have networking re-oriented and restarted each
time, everyone participating would need to set aside a mac for it. I
have the tools to do this easily.

This does absolutely no good other than entertain those of us who would
appreciate such a global game of hot potato :) 

Anyone interested? Could be fun!

Best,
--Tim

> Replace the hosts entries with two ips of xen dom0 hosts.
> 
> Create a dom0 on one of the hosts.
> 
> Run the program on both hosts, by typing "python pingpong.py" from
> the command line.
> 
> It will start migrating them back and forth in a game of ping pong. ☺
> 
> Only a small mutation to the code would randomly pick from hosts to
> migrate to if there were more than two dom0’s.
> 
> Joe
> 
> ----------------------
> 
> import commands
> import string
> import time
> import socket
> 
> destination_host = None
> n_migrations = 0
> 
> hosts = {
>       "10.35.39.39" : None,
>       "10.35.39.40" : None,
>       }
> 
> def main():
> 
>       init_network()
> 
>       while( 1 ):
> 
>               time.sleep(2)
>               maybe_migrate()
> 
> def init_network():
> 
>       global destination_host
> 
>       hostname = socket.gethostname( )        
>       addr = socket.gethostbyname( hostname )
>       del hosts[addr]
>       for key in hosts.keys(): destination_host = key
>       print "this host is %s, destination is %s" % ( addr, destination_host )
> 
> def maybe_migrate():
> 
>       global n_migrations
> 
>       status, output = commands.getstatusoutput ( "xm list" )
> 
>       lines = output.split('\n');
> 
>       if( len(lines) == 2 ):
>               print "nothing to migrate"
> 
>       for line in lines:
> 
>               words = line.split()
> 
>               if ( words[0] == "Name" ) : continue
>               if ( words[0] == "Domain-0" ) : continue
> 
>               print line
> 
>               name = words[0]
>               id = words[1]
>               mem = words[2]
>               vcpus = words[3]
>               state = words[4]
>               time = words[5]
> 
>               if( state == "r-----" or state == "-b----" ):
> 
>                       command = "xm migrate --live %s %s" % ( id, 
> destination_host )
>                       print "%s (migrating) ..." % command
>                       status, output = commands.getstatusoutput ( command )
>                       n_migrations += 1
>                       print "...migrated ( %d migrations total ) " % 
> n_migrations
> 
>               else:
> 
>                       print "non migratable state for: %s %s " % ( id, state )
>                       
> if( __name__ == "__main__" ): main()
> 
> 
> _______________________________________________
> Xen-users mailing list
> Xen-users@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-users


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users

<Prev in Thread] Current Thread [Next in Thread>