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

Error when creating folder with datacenter id #536

Open
mzakutny0 opened this issue Jun 27, 2024 · 4 comments
Open

Error when creating folder with datacenter id #536

mzakutny0 opened this issue Jun 27, 2024 · 4 comments
Labels
blocked The issue cannot be resolved without 3rd party action. kind/bug Some behavior is incorrect or out of spec

Comments

@mzakutny0
Copy link

mzakutny0 commented Jun 27, 2024

Describe what happened

When attempting to create a folder Pulumi returns attached error message. I can work with the datacenter variable freely through other functions and Pulumi cloud stack displays datacenterId in outputs.

Sample program

import pulumi
import pulumi_vsphere as vsphere
import pprint as pprint


datacenter = vsphere.get_datacenter(name="VSPHERE")
my_folder = vsphere.Folder("my folder", path="my-path/my-folder", type="vm", datacenter_id=datacenter.id)
pulumi.export("folder", my_folder)

Log output

    * creating urn:pulumi:<>::vmware::vsphere:index/folder:Folder::my-folder: 1 error occurred:
    * cannot find datacenter from path "/VSPHERE": NoPermission

Affected Resource(s)

No response

Output of pulumi about

CLI
Version      3.121.0
Go Version   go1.22.4
Go Compiler  gc

Plugins
KIND      NAME     VERSION
language  python   unknown
resource  vsphere  4.10.1

Host
OS       Microsoft Windows 11 Pro
Version  10.0.22631 Build 22631
Arch     x86_64

This project is written in python: executable='C:\mypath\venv\Scripts\python.exe' version='3.11.0'

Current Stack: <>

TYPE                                         URN
pulumi:pulumi:Stack                          urn:pulumi:NewStack::vmware::pulumi:pulumi:Stack::<>
pulumi:providers:vsphere                     urn:pulumi:NewStack::vmware::pulumi:providers:vsphere::default_4_10_1
vsphere:index/folder:Folder                  urn:pulumi:NewStack::vmware::vsphere:index/folder:Folder::my-folder


Found no pending operations associated with NewStack

Backend
Name           <>
URL            <>
User           <>
Organizations  <>
Token type     personal

Dependencies:
NAME            VERSION
pip             24.1
pulumi_vsphere  4.10.1
setuptools      70.1.1
wheel           0.43.0

Pulumi locates its logs in C:\mypath\AppData\Local\Temp 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).

@mzakutny0 mzakutny0 added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Jun 27, 2024
@iwahbe
Copy link
Member

iwahbe commented Jun 27, 2024

Hi @mzakutny0 Thanks for reporting this issue. I'll take a look at diagnosing the issue later today.

@guineveresaenger guineveresaenger removed the needs-triage Needs attention from the triage team label Jul 1, 2024
@guineveresaenger guineveresaenger self-assigned this Jul 1, 2024
@guineveresaenger
Copy link
Contributor

Hi @mzakutny0, it is possible that this issue is related to upstream hashicorp/terraform-provider-vsphere#854 or hashicorp/terraform-provider-vsphere#132.

Unfortunately, we are currently blocked on #540 to assist further.

@guineveresaenger guineveresaenger added the blocked The issue cannot be resolved without 3rd party action. label Jul 1, 2024
@guineveresaenger guineveresaenger removed their assignment Jul 1, 2024
@xzizka
Copy link

xzizka commented Jul 3, 2024

Hello, I am a colleague of @mzakutny0.
I don't know if issues mentioned above are related. The issue hashicorp/terraform-provider-vsphere#132 was solved in 2017, so it should not be an issue anymore. I think it is more related to hashicorp/terraform-provider-vsphere#803 than to hashicorp/terraform-provider-vsphere#854.

WORKAROUND
We already solved the issue by assigning a role System.Read as was mentioned in issue 854.
We no longer receive No permission error when calling govc datacenter.info, so we can consider it as a workaround.

@guineveresaenger Is it possible to see the generated Terraform file after we call pulumi up or pulumi destroy? Do you use Terraform or OpenTofu? How can I find what version of Terraform provider is used by the version of Pulumi I run?
Thank you.

@iwahbe
Copy link
Member

iwahbe commented Jul 18, 2024

Hi @xzizka, I'm glad you found a workardound.

To answer your other questions:
pulumi-vsphere uses terraform-provider-vsphere v2.8.2. It doesn't invoke the terraform CLI or generate any HCL. You can see the version of the upstream provider used by looking at the version of the upstream submodule checked into the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked The issue cannot be resolved without 3rd party action. kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

4 participants