qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [Qemu-discuss] How can we install RPMs in guest VM from


From: Puneet Bakshi
Subject: Re: [Qemu-devel] [Qemu-discuss] How can we install RPMs in guest VM from host machine using QEMU guest agents
Date: Thu, 12 Jun 2014 22:23:24 +0530

Including qemu-devel also.

I have a project environment where guest VMs are getting created and destroyed based on some (irrelevant) parameters (these guest VMs are instantiated with QEMU guest agent running and with any possible changes in that). There is a module in host which is controlling all this. I need to do following things from within that module.

1. Whenever a new guest VM is created, take (predefined) RPM packages from host to guest VM and install them.

2. Start a script in guest VM (at certain events).

3. Start a process in guest VM (at certain events).

I thought to address above issues by having a QEMU guest agent running inside guest VM which has one new command, to which I somehow pass RPMs using "virsh qemu-guest-agent ..." command.

    "virsh qemu-agent-command vm_01          \
        '{"execute":"guest-rpm-install",     \
          "arguments":{"path":"/usr/local/bin/ABC.rpm"}}

In existing qemu-ga code, I saw some examples where they fork() and execle() some stuff. I think I can achieve [2] and [3] using the same way.

But, I was getting stuck at [1] in how to transfer files from host to guest and do something with them. I thought I should be able to transfer files using channel like socket/virtio, but was not getting the clue on how to use them. Basically how can I do following.

    1. take some bulky file from host to guest
    2. perform some operation on that file
    3. get the result of that operation.

Regards,
~Puneet


On Thu, Jun 12, 2014 at 9:37 PM, Puneet Bakshi <address@hidden> wrote:
Forgot to mention that these guest VMs can be UNIX based or Windows.


On Thu, Jun 12, 2014 at 9:36 PM, Puneet Bakshi <address@hidden> wrote:
Thanks Dale for responding.

Actually, these guest VMs may or may not have scp, ftp, etc. What is assured is that they have the QEMU guest agent running and there is a possibility of having additional commands if required.

Let me put up my problem.

I have a project environment where guest VMs are getting created and destroyed based on some (irrelevant) parameters (these guest VMs are instantiated with QEMU guest agent running and with any possible changes in that). There is a module in host which is controlling all this. I need to do following things from within that module.

1. Whenever a new guest VM is created, take (predefined) RPM packages from host to guest VM and install them.

2. Start a script in guest VM (at certain events).

3. Start a process in guest VM (at certain events).

I thought to address above issues by having a QEMU guest agent running inside guest VM which has one new command, to which I somehow pass RPMs using "virsh qemu-guest-agent ..." command.

In existing qemu-ga code, I saw some examples where they fork() and execle() some stuff. I though I can achieve [2] and [3] using the same way.

But, I was getting stuck at [1] in how to transfer files from host to guest and do something with them. I thought I should be able to transfer files using channel like socket/virtio, but was not getting the clue on how to use them.

Regards,


On Thu, Jun 12, 2014 at 8:42 PM, Dale R. Worley <address@hidden> wrote:
> From: Puneet <address@hidden>

> I am able to pass arguments from host to guest VM but how am I supposed to
> pass the whole RPM image from host to guest (which the guest agent can
> receive and install)?

What occurs to me is:

    scp /usr/local/bin/ABC.rpm address@hidden:/usr/local/bin/ABC.rpm
    ssh address@hidden rpm --install -p /usr/local/bin/ABC.rpm

Dale




reply via email to

[Prev in Thread] Current Thread [Next in Thread]