Mauricio Tavares | 16 Jul 2012 03:52
Picon

Using virsh to load scripts for the guest machine

	Right on the top of

http://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html, 
it seems to imply you can load/send scripts to the vm guest using virsh. 
Is that possible? How and what are the limitations? Can you query the vm 
guest?
Eric Blake | 30 Jul 2012 19:50
Picon
Favicon
Gravatar

Re: Using virsh to load scripts for the guest machine

On 07/15/2012 07:52 PM, Mauricio Tavares wrote:
>     Right on the top of
> http://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html,
> it seems to imply you can load/send scripts to the vm guest using virsh.
> Is that possible? How and what are the limitations? Can you query the vm
> guest?

What type of scripts are you talking about?  You may be thinking more
about the capabilities of what libguestfs provides, for modifying disk
images.  In general, virsh itself controls how to start a guest, but not
the additional layers of communication (such as virtio, qemu-ga, or the
libguestfs appliance app) required for a host to command a guest to do
something from within the guest.

--

-- 
Eric Blake   eblake@...    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

_______________________________________________
libvirt-users mailing list
libvirt-users@...
https://www.redhat.com/mailman/listinfo/libvirt-users
Mauricio Tavares | 30 Jul 2012 20:00
Picon

Re: Using virsh to load scripts for the guest machine

On Mon, Jul 30, 2012 at 1:50 PM, Eric Blake <eblake@...> wrote:
> On 07/15/2012 07:52 PM, Mauricio Tavares wrote:
>>     Right on the top of
>> http://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html,
>> it seems to imply you can load/send scripts to the vm guest using virsh.
>> Is that possible? How and what are the limitations? Can you query the vm
>> guest?
>
> What type of scripts are you talking about?  You may be thinking more
> about the capabilities of what libguestfs provides, for modifying disk
> images.  In general, virsh itself controls how to start a guest, but not
> the additional layers of communication (such as virtio, qemu-ga, or the
> libguestfs appliance app) required for a host to command a guest to do
> something from within the guest.
>
      Basic one would be in case a machine has been paused for a long
time. You know as in "hey, you lazy vm! You have been sleeping for two
weeks! Now your clock is way off and poor ntp can't sync it back. So,
here's current date!"  So that could either be done by stopping ntp
and running ntpdate or actually being able to pass the host time
(adjusted for the timezone the vm is supposed to be at) to the vm.

> --
> Eric Blake   eblake@...    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
Alex Jia | 31 Jul 2012 05:16
Picon
Favicon

Re: Using virsh to load scripts for the guest machine

Hi Mauricio, 
Perhaps the following link is what you want:
http://libvirt.org/formatdomain.html#elementsTime (Time keeping)

-- 
Regards,     
Alex

----- Original Message -----
From: "Mauricio Tavares" <raubvogel@...>
To: "libvirt-users" <libvirt-users@...>
Sent: Tuesday, July 31, 2012 2:00:40 AM
Subject: Re: [libvirt-users] Using virsh to load scripts for the guest	machine

On Mon, Jul 30, 2012 at 1:50 PM, Eric Blake <eblake@...> wrote:
> On 07/15/2012 07:52 PM, Mauricio Tavares wrote:
>>     Right on the top of
>> http://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html,
>> it seems to imply you can load/send scripts to the vm guest using virsh.
>> Is that possible? How and what are the limitations? Can you query the vm
>> guest?
>
> What type of scripts are you talking about?  You may be thinking more
> about the capabilities of what libguestfs provides, for modifying disk
> images.  In general, virsh itself controls how to start a guest, but not
> the additional layers of communication (such as virtio, qemu-ga, or the
> libguestfs appliance app) required for a host to command a guest to do
> something from within the guest.
>
      Basic one would be in case a machine has been paused for a long
(Continue reading)

Eric Blake | 31 Jul 2012 15:41
Picon
Favicon
Gravatar

Re: [libvirt-users] Using virsh to load scripts for the guest machine

On 07/30/2012 12:00 PM, Mauricio Tavares wrote:
> On Mon, Jul 30, 2012 at 1:50 PM, Eric Blake <eblake <at> redhat.com> wrote:
>> On 07/15/2012 07:52 PM, Mauricio Tavares wrote:
>>>     Right on the top of
>>> http://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html,
>>> it seems to imply you can load/send scripts to the vm guest using virsh.
>>> Is that possible? How and what are the limitations? Can you query the vm
>>> guest?
>>
>> What type of scripts are you talking about?  You may be thinking more
>> about the capabilities of what libguestfs provides, for modifying disk
>> images.  In general, virsh itself controls how to start a guest, but not
>> the additional layers of communication (such as virtio, qemu-ga, or the
>> libguestfs appliance app) required for a host to command a guest to do
>> something from within the guest.
>>
>       Basic one would be in case a machine has been paused for a long
> time. You know as in "hey, you lazy vm! You have been sleeping for two
> weeks! Now your clock is way off and poor ntp can't sync it back. So,
> here's current date!"

That is something that fits better through qemu-ga, but no one has
implemented it yet (cc'ing qemu-devel in case I'm misrepresenting
things).  Of course, if we did have a qemu-ga command for pushing the
current time into the guest, then libvirt could usefully expose an API
to wrap that qemu-ga command.

--

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
(Continue reading)

Anthony Liguori | 1 Aug 2012 15:48

Re: [libvirt-users] Using virsh to load scripts for the guest machine

Eric Blake <eblake <at> redhat.com> writes:

> On 07/30/2012 12:00 PM, Mauricio Tavares wrote:
>> On Mon, Jul 30, 2012 at 1:50 PM, Eric Blake <eblake <at> redhat.com> wrote:
>>> On 07/15/2012 07:52 PM, Mauricio Tavares wrote:
>>>>     Right on the top of
>>>> http://www.centos.org/docs/5/html/5.2/Virtualization/chap-Virtualization-Managing_guests_with_virsh.html,
>>>> it seems to imply you can load/send scripts to the vm guest using virsh.
>>>> Is that possible? How and what are the limitations? Can you query the vm
>>>> guest?
>>>
>>> What type of scripts are you talking about?  You may be thinking more
>>> about the capabilities of what libguestfs provides, for modifying disk
>>> images.  In general, virsh itself controls how to start a guest, but not
>>> the additional layers of communication (such as virtio, qemu-ga, or the
>>> libguestfs appliance app) required for a host to command a guest to do
>>> something from within the guest.
>>>
>>       Basic one would be in case a machine has been paused for a long
>> time. You know as in "hey, you lazy vm! You have been sleeping for two
>> weeks! Now your clock is way off and poor ntp can't sync it back. So,
>> here's current date!"
>
> That is something that fits better through qemu-ga, but no one has
> implemented it yet (cc'ing qemu-devel in case I'm misrepresenting
> things).  Of course, if we did have a qemu-ga command for pushing the
> current time into the guest, then libvirt could usefully expose an API
> to wrap that qemu-ga command.

Could you setup a wiki page on qemu.org with a list of qemu-ga
(Continue reading)

Eric Blake | 2 Aug 2012 01:17
Picon
Favicon
Gravatar

Re: [libvirt-users] Using virsh to load scripts for the guest machine

On 08/01/2012 07:48 AM, Anthony Liguori wrote:
>>>       Basic one would be in case a machine has been paused for a long
>>> time. You know as in "hey, you lazy vm! You have been sleeping for two
>>> weeks! Now your clock is way off and poor ntp can't sync it back. So,
>>> here's current date!"
>>
>> That is something that fits better through qemu-ga, but no one has
>> implemented it yet (cc'ing qemu-devel in case I'm misrepresenting
>> things).  Of course, if we did have a qemu-ga command for pushing the
>> current time into the guest, then libvirt could usefully expose an API
>> to wrap that qemu-ga command.
> 
> Could you setup a wiki page on qemu.org with a list of qemu-ga
> commands that libvirt would like?

I gave it a shot (feel free to improve it)
http://wiki.qemu.org/Features/GuestAgent/UsefulCommands

--

-- 
Eric Blake   eblake <at> redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Mauricio Tavares | 2 Aug 2012 16:23
Picon

Re: [Qemu-devel] Using virsh to load scripts for the guest machine

On Wed, Aug 1, 2012 at 7:17 PM, Eric Blake <eblake@...> wrote:
> On 08/01/2012 07:48 AM, Anthony Liguori wrote:
>>>>       Basic one would be in case a machine has been paused for a long
>>>> time. You know as in "hey, you lazy vm! You have been sleeping for two
>>>> weeks! Now your clock is way off and poor ntp can't sync it back. So,
>>>> here's current date!"
>>>
>>> That is something that fits better through qemu-ga, but no one has
>>> implemented it yet (cc'ing qemu-devel in case I'm misrepresenting
>>> things).  Of course, if we did have a qemu-ga command for pushing the
>>> current time into the guest, then libvirt could usefully expose an API
>>> to wrap that qemu-ga command.
>>
>> Could you setup a wiki page on qemu.org with a list of qemu-ga
>> commands that libvirt would like?
>
> I gave it a shot (feel free to improve it)
> http://wiki.qemu.org/Features/GuestAgent/UsefulCommands
>
      Dumb question: how do I create an account so I too can do some editing?
> --
> Eric Blake   eblake@...    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>

Gmane