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] Reset or restart a VM

To: Mo Mal <ma1000000000@xxxxxxxxx>
Subject: Re: [Xen-users] Reset or restart a VM
From: Luciano Barreto <lucianobarreto@xxxxxxxxx>
Date: Wed, 19 Oct 2011 21:03:39 -0200
Cc: xen-users@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 19 Oct 2011 16:09:52 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/MXPMOuHPheBilK2/kEYkn7o4xXba9tZOSQU1rc8Ub8=; b=Q4zRgQs+RtJGb2mRa+mzjdfNFZqdESH5U+eOYVdGORD7lJOHXOX4s1JoqDAxu9KhBk MOD6u2YgEMfk3jB/AsX2LaLKPLprWBHdJAUGMWM/eBiU07aeqhYfep6WWOT3RulZQjxI EOqDTQ7JFC6ePC4bnMgsjhEZAPdRrbquc3VSg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <CAKy2oiu8yoyNS4euTWZmkKr=yoEEG+zgrh0Uf6toxvL+4G5vvQ@xxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <CAKy2oiu8yoyNS4euTWZmkKr=yoEEG+zgrh0Uf6toxvL+4G5vvQ@xxxxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
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
<Prev in Thread] Current Thread [Next in Thread>