New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLOUDSTACK-8715: Add VirtIO channel to all Instances for the Qemu Gue… #985
Conversation
@wido Thanks for working on this, awesome! I was testing this PR and found that the SSVM and CPVM systemvms do not start properly. This is the error:
Here is the channel dir:
The I've installed the rpm package that I've built from this branch. The agent seems to run as root:
It was tested on a KVM hypervisor on CentOS 7. Ping me if you need more details. |
@remibergsma Hmm, was SELinux enabled on that system? Can't see any reason why it wouldn't work. All the directories exist. Do you by any chance have the XML the Agent generated for the SSVM for example? |
Hi @wido : SELinux is off:
The generated XML:
|
@remibergsma Ok, that is odd. A proper XML should look like this:
path is not required, that is computed by libvirt. But the state connected is probably the issue. I'll fix that. |
d3a0669
to
2f43a04
Compare
@borisroman Could you give this PR a spin? |
@wido I will also test it again today. |
I have same issue with Remi, |
succeed after the following change:
|
Hmm, ok. That should be allowed. Since we want the Guest tools also to be supported on SSVMs to control them properly. |
that is good idea. then we need to rebuild systemvm template with qemu-guest-agent |
by the way, for user vms, I think it is better to add the field in vm_instance/user_vm or zone/cluster/global setting to determine if the vm is qemu guest agent enabled. |
uservm can not start |
@ustcweizhou Which version of libvirt are you using? If you use libvirt 1.0.6 or newer, you can omit the path='...' attribute of the |
@wido ja, you got it. The issue happened on a host running with Ubuntu 12.04 (QEMU 1.2.1 and libvirt 0.9.13) |
@wido by the way, I just remember I have implemented some codes for qemu-guest-agent support , based on cloudstack 4.2.0 maybe. |
@ustcweizhou @remibergsma I just pushed a new version of the commit. On Ubuntu AppArmor needs to be disabled since the default profile for libvirt doesn't allow writing into /var/lib/libvirt/qemu. This is however already the case with the SSVM. This could be fixed by adding this to '/etc/apparmor.d/abstractions/libvirt-qemu': /var/lib/libvirt/qemu/channel/target/* rw, |
I justed pushed a new commit which uses libvirt-java for the communication with the Guest Agent. The build will fail since this patch for libvirt-java has not been accepted upstream: |
@wido nice, I will test it. |
@ustcweizhou Yes, it does. See the patches I posted above. |
Still working on this one. However, I need to get stuff into libvirt-java upstream. Working on that here: https://github.com/wido/libvirt-java/commits/qemu-guest-command |
Ok, godspeed. |
Any progress on getting the patches into upstream libvirt-java? @wido |
@nislim No, not really. The people at libvirt-java aren't the fastest. Thinking about forking it into CloudStack itself. |
b6a8707
to
68aad17
Compare
I just rebased the commit against master, but still waiting on libvirt-java. Really think we should fork libvirt-java to get this fixed. |
@@ -389,6 +389,8 @@ packages() { | |||
chroot . apt-get --no-install-recommends -q -y --force-yes install ipcalc | |||
#irqbalance from wheezy-backports | |||
chroot . apt-get --no-install-recommends -q -y --force-yes -t wheezy-backports install irqbalance | |||
#qemu guest agent | |||
chroot . apt-get --no-install-recommends -q -y --force-yes install qemu-guest-agent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to go in tools/appliance/definitions/systemvmtemplate
@wido thanks for the feature, can you rebase against latest master and push -f; update on the state of the PR We should have this feature. tag:needlove |
@rhtyd Done! Rebased against master |
Does this require a change to the system VM template? I am pulling this in for testing now... |
@swill Yes, it does. It install the Qemu Quest Agent inside the SSVM. It doesn't hurt to do that already, it is just that the libvirt-java bindings don't allow us to talk to the VMs. |
Thinking about closing this PR and coming up with two new ones. One which only adds the channel and installs Qemu Guest Agent in the SSVM. |
This failed during compiling:
Here is the error
|
…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
Closing this one in favor of #1545 |
…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:
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