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

Vsphere Docs: No import sections are provided. #254

Open
MitchellGerdisch opened this issue Apr 25, 2023 · 7 comments
Open

Vsphere Docs: No import sections are provided. #254

MitchellGerdisch opened this issue Apr 25, 2023 · 7 comments
Assignees
Labels
area/docs Improvements or additions to documentation kind/bug Some behavior is incorrect or out of spec

Comments

@MitchellGerdisch
Copy link

What happened?

Other providers include a pulumi import section for each resource.
The vSphere docs are missing this.

It's not intuitively obvious what the resource type is (appears to be of the form vsphere:index/ResourceType:resourcetype
and it's not clear what correct vsphere IDs look like.

So having this documentation would be very helpful.

Expected Behavior

Have import sections for he resources.

Steps to reproduce

Go to the vsphere provider docs and pick a resource, e.g. https://www.pulumi.com/registry/packages/vsphere/api-docs/virtualmachine/

Look for an import section like seen else where (e.g. https://www.pulumi.com/registry/packages/aws/api-docs/iot/thing/#import).

Output of pulumi about

N/A

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

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

MitchellGerdisch commented Apr 26, 2023

FYI: Import for VM looks like:

pulumi import vsphere:index/virtualMachine:VirtualMachine name /DATACENTER/RESOURCEPOOL/vm/VMNAME

Fixed typo as per @JCBlouin comment below.

@iwahbe iwahbe added area/docs Improvements or additions to documentation and removed needs-triage Needs attention from the triage team labels Apr 26, 2023
@iwahbe
Copy link
Member

iwahbe commented Apr 26, 2023

Thanks @MitchellGerdisch. We have added this to our docs quality epic.

@JCBlouin
Copy link

Any progress on this? I want to bring our VMWare environment under Pulumi control but not being able to import existing resources is hampering that effort.
The command @MitchellGerdisch kindly provided isn't working for me. When I try that I get "error: Preview failed: unrecognized resource type (Read): vsphere:index/virtualmachine:VirtualMachine"

@JCBlouin
Copy link

Ah, I found the problem with the command @MitchellGerdisch posted - it needs to be:
vsphere:index/virtualMachine:VirtualMachine

I figured that out by creating a test VM and looking at the resulting URN in Pulumi.
I can do that for other resources but I don't think I'd ever have figured out the ID format.
Also, I'd prefer not to have to do all this by guessing/trial and error.

@MitchellGerdisch
Copy link
Author

@JCBlouin Sorry about the typo and thanks for providing the corrected version.
I'll edit my original comment accordingly.

@evilhamsterman
Copy link

Another thing is importing resources that require information about other resources. Like trying to import a Distributed Virtual Switch requires providing a datacenter

pulumi import vsphere:index/distributedVirtualSwitch:DistributedVirtualSwitch dvs VmwareDistributedVirtualSwitch-dvs-62
Previewing import (dev):
     Type                                       Name     Plan       Info
     pulumi:pulumi:Stack                        it-dev              1 error
 =   └─ vsphere:index:DistributedVirtualSwitch  dvs  import     1 error

Diagnostics:
  vsphere:index:DistributedVirtualSwitch (dvs-csq):
    error: Preview failed: importing VmwareDistributedVirtualSwitch-dvs-62: error locating DVS: please specify a datacenter

  pulumi:pulumi:Stack (it-dev):
    error: preview failed

The ID for each resource is different too. Some take a UID, some a folder location.

@iwahbe
Copy link
Member

iwahbe commented Sep 27, 2024

I suspect that this will be fixed by #597. I'll add needs-triage as a reminder to check after vsphere has been published with new docs.

@iwahbe iwahbe added the needs-triage Needs attention from the triage team label Sep 27, 2024
@guineveresaenger guineveresaenger removed the needs-triage Needs attention from the triage team label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Improvements or additions to documentation kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

5 participants