Skip to content
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

Unable to get remote libvirt uri to work #168

Closed
artiommocrenco opened this issue Oct 26, 2023 · 4 comments
Closed

Unable to get remote libvirt uri to work #168

artiommocrenco opened this issue Oct 26, 2023 · 4 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@artiommocrenco
Copy link

What happened?

Pulumi and this provider always try to use my local libvirt connection.

I tried setting the pulumi config value for libvirt uri, also tried setting the LIBVIRT_DEFAULT_URI with export, no matter what I try for python, I'm not able to get remote libvirt uri to work. It's always creating resources locally. I tried nuking the stack several times, refreshing, destroying everything - but it didn't help.

In the same terminal window, when I run virsh, I'm getting expected behavior when changing LIBVIRT_DEFAULT_URI. Also, virt-manager works fine too with different connections I have.

When I unset the env var, and unset the config value, I do get the error:

    error: pulumi:providers:libvirt resource 'default_0_4_1' has a problem: Provider is missing a required configuration key, try `pulumi config set libvirt:uri`: libvirt connection URI for operations. See https://libvirt.org/uri.html

Then, I set it, and the error goes away:

# tried using the IP address too. kiv01 is in my /etc/hosts
export LIBVIRT_DEFAULT_URI='qemu+ssh://root@kiv01/system'

Then, in the same shell of course, I run pulumi up -d and I get this message among others (same when using the config variable):

    debug: Configuring provider for 'qemu+ssh://root@kiv01/system': &{map[uri:0xc000189180] <nil> <nil> 0xc0006bae00 map[] <nil> {{<nil>} <nil>} 0xc0004003e0 0xc0005444e0 0xc0006fac30 false {1 {0 0}} false false}

However, the resource is created locally and not remotely. I tried running wireshark, I can see no ssh traffic when using pulumi this way.

Example

"""A Python Pulumi program"""

import pulumi
import pulumi_libvirt as libvirt

# this is always created locally for me
domain = libvirt.Domain('pulumi')

Output of pulumi about

CLI
Version 3.89.0
Go Version go1.21.3
Go Compiler gc

Plugins
NAME VERSION
libvirt 0.4.1
python unknown

Host
OS arch
Version "rolling"
Arch x86_64

This project is written in python: executable='/usr/bin/python3' version='3.11.5'

Found no pending operations associated with prod

Backend
Name laptop
URL file://~
User user
Organizations
Token type personal

Dependencies:
NAME VERSION
pip 23.3.1
pulumi-libvirt 0.4.1
setuptools 68.2.2
wheel 0.41.2

Pulumi locates its logs in /tmp by default

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@artiommocrenco artiommocrenco added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Oct 26, 2023
@artiommocrenco
Copy link
Author

I guess it's "upstream": dmacvicar/terraform-provider-libvirt#1040

@mikhailshilkov
Copy link
Member

@artiommocrenco The upstream says it works in 0.7.1 which corresponds to 0.4.0 in Pulumi. Does that version work for you?

@mikhailshilkov mikhailshilkov added awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Oct 27, 2023
@artiommocrenco
Copy link
Author

@artiommocrenco The upstream says it works in 0.7.1 which corresponds to 0.4.0 in Pulumi. Does that version work for you?

It was my first day using pulumi, so I wasn't sure how to downgrade. But in terraform, I checked yesterday and yes 0.7.1 is the newest working version for me. So pulumi 0.4.0 should be working, will rewrite from tf later

@artiommocrenco artiommocrenco changed the title Unable to get remote libvirt uri to work with python Unable to get remote libvirt uri to work Oct 27, 2023
@mikhailshilkov mikhailshilkov removed the awaiting-feedback Blocked on input from the author label Oct 28, 2023
@mikhailshilkov mikhailshilkov self-assigned this Sep 23, 2024
@mikhailshilkov mikhailshilkov added resolution/fixed This issue was fixed and removed awaiting-upstream The issue cannot be resolved without action in another repository (may be owned by Pulumi). labels Sep 23, 2024
@mikhailshilkov
Copy link
Member

Closing based on the comment above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

2 participants