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

Re: [Xen-users] Reset or restart a VM



Java code...
public void startVM(String vm) {
try {
System.out.println("Starting replica " + vm);
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("xm create " + vm);
pr.waitFor();
pr.destroy();
rt.freeMemory();
rt.gc();

} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
}
}

Change "create" to any command you want to do with your vm.

2011/10/19 Mo Mal <ma1000000000@xxxxxxxxx>
Hello,

I want to be able to reset or restart a VM from C/C++ or Java code remotely. Is it possible?

Thanks.
Mo

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



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

 


Rackspace

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