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-api

RE: [Xen-API] Some questions about XenAPI

To: 'Lonangel' <lonangel@xxxxxxxxx>, "xen-api@xxxxxxxxxxxxxxxxxxx" <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-API] Some questions about XenAPI
From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
Date: Sun, 22 Nov 2009 20:09:15 +0000
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Sun, 22 Nov 2009 12:09:16 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4B0952AC.6090706@xxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <4B0952AC.6090706@xxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcprhPGULMW5+n5fSlKefsm78bbI8wAJF1Iw
Thread-topic: [Xen-API] Some questions about XenAPI
Hi,

> Does anyone know if its possible to execute a command on a guest
> through
> the xenapi?
> For example:
> I want to test a group of programs written in java or c, the VM already
> knows how to test this programs.
> My main problem here is that i want to send data into the VM machine,
> like the program file and start the command that evaluates those
> programs, also get the output from the program.

You cannot do this through the XenAPI currently. I recommend doing something 
like this:

1. run a service inside your VM which accepts network connections; 
2. discover the VM's IP address via the XenAPI (VM_guest_metrics.networks map); 
3. connect to the service directly; and
4. transmit the command and receive the results via TCP/IP.

Would this work for you?

> The second problem is, I need to revert the VM back to its initial
> state
> ( clean all the damage the program might have done ) so it can be able
> to test another program in the same conditions it tested the previous
> program. The question is, can I revert a VM to a previous snapshot
> using
> the Xen API?

Yes: use the call
  VM.revert(session ref, VM ref)
where 'VM ref' is an existing snapshot (disk snapshot) or checkpoint (disk + 
memory snapshot)

Note that reverting to a checkpoint (disk + memory snapshot) will result in the 
VM being suspended. To make it run again you must call 'VM.resume'.

NB VM.revert is in the development version of xapi.

Hope that helps,
Dave

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api