fog / fog-libvirt

libvirt provider for fog
MIT License
16 stars 44 forks source link

Add qemu-guest-agent channel. #57

Closed olifre closed 4 years ago

olifre commented 6 years ago

Fixes #55.

This adds a qemu-guest-agent channel. It allows to instruct the VM from the hypervisor e.g. to freeze filesystems for snapshotting. With RHEL 7 / CentOS 7, if the agent channel is present, anaconda installs and activates the guest agent automatically.

People might want to configure this (on / off), but I would vote to have this on by default

strzibny commented 5 years ago

I don't mind this being default if there no objections but in your patch this is not configurable.

olifre commented 5 years ago

I don't mind this being default if there no objections but in your patch this is not configurable.

I am unsure on how to make it configurable, since I am not really an expert of libfog and the API. Can you give me some pointers on how to add it, or add the configurability part to this PR? It's probably rather straightforward once one knows which parts need to be touched.

strzibny commented 5 years ago

I believe you have to add attribute here: https://github.com/fog/fog-libvirt/blob/master/lib/fog/libvirt/models/compute/server.rb#L14

A default value here: https://github.com/fog/fog-libvirt/blob/master/lib/fog/libvirt/models/compute/server.rb#L465

And then use plain old ERB for inserting the value in the template:

<%= guest_agent %>
olifre commented 5 years ago

@strzibny Thanks! I now made the guest-agent toggleable, on by default. Configuring the name or the complete XML snippet is not really useful IMHO, since this is the name expected by libvirt / virsh and used in default guest agent configurations. So I just added a bool which allows to turn the agent channel on or off.

olifre commented 5 years ago

Any news on this?

olifre commented 4 years ago

@strzibny I've now rebased on current master and manually fixed the conflicts - would be nice to get this merged.

strzibny commented 4 years ago

Yes, I think this is fine. Thanks for your contribution!