dmacvicar / terraform-provider-libvirt

Terraform provider to provision infrastructure with Linux's KVM using libvirt
Apache License 2.0
1.59k stars 458 forks source link

Connect remotely to libvirt hypervisior requires additional packages on client host #793

Closed lz006 closed 3 years ago

lz006 commented 3 years ago

Hi, I tried to manage guests on my kvm server remotely by using your provider "terraform-provider-libvirt" ( btw thanks for that!). Unfortunately "terraform plan" always gave me :

Error: Failed to instantiate provider "libvirt" to obtain schema: Unrecognized remote plugin message: 

This usually means that the plugin is either invalid or simply
needs to be recompiled to support the latest protocol.

After "strace-ing" it turned out binary "terraform-provider-libvirt" looks for a file called "libvirt-lxc.so" which was not present on my linux laptop. After installing "libvirt-daemon-driver-lxc" everything works:

sudo apt install libvirt-daemon-driver-lxc

main.tf:

provider "libvirt" {
 uri   = "qemu+ssh://root@mypc:22/system"
}

Maybe it's worth adding this information to your docs?

System Information

Linux distribution

Client: Ubuntu 20.04 KVM Server: CentOS 8.2

Terraform version

v0.12.29 v.0.13.4

Provider and libvirt versions

./terraform-provider-libvirt 0.6.2+git.1585292411.8cbe9ad0 Compiled against library: libvirt 4.0.0 Using library: libvirt 6.0.0 2020/10/21 16:41:53 virError(Code=1, Domain=10, Message='internal error: Cannot find suitable emulator for x86_64')

MalloZup commented 3 years ago

@lz006 hi thx for issue.

To me seems your issue something more ubuntu related.

Since the whole provider is distro agnostic, it might be tricky to add such "generic" documentation about installing libvirt and configuring it on various distros.

E.g your issue seems more a bug on Ubuntu libvirt pkg and lxc library.

In that sense, It wouldn't be the right solution to add such documentation here in this project.

I think you should open a bug against ubuntu distro and state that there is this hidden dep.

The libvirt-provider is just a consumer of the various KVM/LIBVIRT implementation packaging of each LInux distros.

For this reason I'm closing this issue as invalid.

But thank you for this issues and efforts. :heart: