Uh oh!
There was an error while loading. Please reload this page.
[4.7] CLOUDSTACK-8715: qemu-guest-agent support on KVM - #1027
[4.7] CLOUDSTACK-8715: qemu-guest-agent support on KVM#1027ustcweizhou wants to merge 7 commits into
Conversation
…st Agent This commit adds a additional VirtIO channel with the name 'org.qemu.guest_agent.0' to all Instances. With the Qemu Guest Agent the Hypervisor gains more control over the Instance if these tools are present inside the Instance, for example: * Power control * Flushing filesystems In the future this should allow safer snapshots on KVM since we can instruct the Instance to flush the filesystems prior to snapshotting the disk. More information: http://wiki.qemu.org/Features/QAPI/GuestAgent Keep in mind that on Ubuntu AppArmor still needs to be disabled since the default AppArmor profile doesn't allow libvirt to write into /var/lib/libvirt/qemu
wido
commented
Nov 3, 2015
Overall this seems OK, but I personally think that we can enable it by default on all KVM guests. It doesn't hurt to add the port. We can detect if the port is open or not. Also, we don't need external Python code to send commands, we can do this directly from Java. |
ustcweizhou
commented
Nov 3, 2015
The virtio console is a bridge between hypervisor and vm instance. I am not sure if customers feel good/friendly with this. I donot know if libvirt-java 0.5.1 supports qemu guest agent. If yes, we can send commands/data directly from java. It is another way for implementation. |
DaanHoogland
commented
Nov 4, 2015
ran the regression set with some f results: and results: The two failures seem not related so I will run them again. |
wido
commented
Nov 4, 2015
@ustcweizhou I don't see the difference personally, as a admin you already have full access to the Instance if you want to. But this PR conflicts with mine, they can't be merged both :) |
sspans
commented
Nov 4, 2015
Consistent Snapshots are not possible without freeze/thaw via the guest-agent. That said it's quite possible to disable the agent on particularly sensitive VM's if one feels the need, |
wido
commented
Nov 4, 2015
@sspans Indeed. Users can stop/disable the agent or even block specific commands if they wish to. As CloudStack we don't control what's in the Instance, so it's the user who decides if he/she wants the Agent or not. |
wido
commented
Nov 4, 2015
So I wrote #985 which adds a channel by default to all guests. The question is, how do we proceed. Which one goes in? |
ustcweizhou
commented
Nov 4, 2015
wido
commented
Nov 4, 2015
@ustcweizhou Ah, I see indeed. So the discussion is:
|
ustcweizhou
commented
Nov 4, 2015
@wido@sspans
|
wido
commented
Nov 6, 2015
@ustcweizhou I looked at the code more closely and it looks good. However, I would still vote for having the Agent port always enabled. This saves a lot of code and a lot of testing as well. I would also remove the Python code and write a Java Util which directly talks to the local Unix socket. So, we always enable a Guest Agent port and when we want to talk to the Instance we send a ping. If it responds, it responds. If not, we assume there is no Agent in there. |
ustcweizhou
commented
Nov 6, 2015
@wido thanks for your review. good to hear that. The function checkGuestAgentSync in the commit is used to verify if the guest agent works. |
wido
commented
Nov 9, 2015
I'm going to take a look at this via @borisroman today. I'm also working on a patch for libvirt-java, since using those bindings you can also send Qemu Guest Agent commands, even easier :) |
NuxRo
commented
Nov 9, 2015
Great stuff, +1 for having the channel enabled by default. |
wido
commented
Nov 9, 2015
I've just send a patch upstream to libvirt-java so that we can use Libvirt for sending commands to Instances: https://www.redhat.com/archives/libvir-list/2015-November/msg00247.html A small piece of example Java code: https://gist.github.com/wido/30457cbe66e3965f00de I will work on my PR #985 to get this all imported. |
wido
commented
Nov 12, 2015
@ustcweizhou Could you close this PR? #985 has some new patches which use libvirt. Some of your code also went in there :) |
ustcweizhou
commented
Nov 12, 2015
@wido sure , closed. |
@wido can you check if these codes are useful for you?