pulumi / pulumi-vsphere

A Pulumi resource package for VMWare VSphere, providing multi-language access to vCenter Server and ESXi
Apache License 2.0
52 stars 5 forks source link

Error when creating folder with datacenter id #536

Open mzakutny0 opened 6 days ago

mzakutny0 commented 6 days ago

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).

iwahbe commented 6 days ago

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

guineveresaenger commented 2 days ago

Hi @mzakutny0, it is possible that this issue is related to upstream https://github.com/hashicorp/terraform-provider-vsphere/issues/854 or https://github.com/hashicorp/terraform-provider-vsphere/issues/132.

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

xzizka commented 11 hours ago

Hello, I am a colleague of @mzakutny0. I don't know if issues mentioned above are related. The issue https://github.com/hashicorp/terraform-provider-vsphere/issues/132 was solved in 2017, so it should not be an issue anymore. I think it is more related to https://github.com/hashicorp/terraform-provider-vsphere/issues/803 than to https://github.com/hashicorp/terraform-provider-vsphere/issues/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.