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

Configuration for import target does not exist #2158

Closed
4 tasks done
Amonlol opened this issue Mar 16, 2024 · 5 comments
Closed
4 tasks done

Configuration for import target does not exist #2158

Amonlol opened this issue Mar 16, 2024 · 5 comments
Assignees
Labels
bug Type: Bug

Comments

@Amonlol
Copy link

Amonlol commented Mar 16, 2024

Community Guidelines

  • I have read and agree to the HashiCorp Community Guidelines .
  • Vote on this issue by adding a 👍 reaction to the original issue initial description to help the maintainers prioritize.
  • Do not leave "+1" or other comments that do not add relevant information or questions.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Terraform

v1.7.5 on linux_amd64

Terraform Provider

registry.terraform.io/hashicorp/vsphere v2.7.0

VMware vSphere

6.7.0 Update 3 (Build 16773714)

Description

I have a problem with importing existing vm's into my state. When I try to do

terraform import vsphere_virtual_machine.vm /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-01

govc output:

# govc find -u=************* | grep test
/depo_datacenter/vm/Nodes/test
/depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-01

Affected Resources or Data Sources

resource vsphere_virtual_machine

Terraform Configuration

My tf project structure:

.
├── main.tf
├── terraform.tfstate
└── variables.tf

main.tf: https://gist.github.com/Amonlol/8810fde6be99546c181004b53a11e127

variables.tf: https://gist.github.com/Amonlol/13147494384b3f407c0a6b0d94f8fdb0

Debug Output

terraform import vsphere_virtual_machine.vm /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-01

https://gist.github.com/Amonlol/3938d6fa4d9f8608f2d03b0b6c405169

However importing an existing folder works fine:

terraform import vsphere_folder.folder /depo_datacenter/vm/Nodes/test

https://gist.github.com/Amonlol/484ec07a41ccb87c1a6e0e3dec385549

Panic Output

No response

Expected Behavior

Terraform should import my existing vm into it's state

Actual Behavior

Error

Steps to Reproduce

terraform import vsphere_virtual_machine.vm

Environment Details

No response

Screenshots

No response

References

No response

@Amonlol Amonlol added bug Type: Bug needs-triage Status: Issue Needs Triage labels Mar 16, 2024
Copy link

Hello, Amonlol! 🖐

Thank you for submitting an issue for this provider. The issue will now enter into the issue lifecycle.

If you want to contribute to this project, please review the contributing guidelines and information on submitting pull requests.

@Amonlol Amonlol closed this as completed Mar 16, 2024
@Amonlol
Copy link
Author

Amonlol commented Mar 16, 2024

Terraform vsphere docs show importing as

terraform import vsphere_virtual_machine.vm /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-01

But in my case I should set index for my vm as

terraform import vsphere_virtual_machine.vm[0] /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-01

Question: But if I need to import more than 1 vm? I need to manually\script set index for each import? Or terraform can somehow import multiple vms at once?

terraform import vsphere_virtual_machine.vm[0] /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-01
terraform import vsphere_virtual_machine.vm[1] /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-02
terraform import vsphere_virtual_machine.vm[2] /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-03
...

# shortcut for that?
terraform import vsphere_virtual_machine.vm[*] /depo_datacenter/vm/Nodes/test/ubuntu-nodes-test-0*

@Amonlol Amonlol reopened this Mar 16, 2024
@tenthirtyam
Copy link
Collaborator

Hi @Amonlol 👋 ,

Could you please verify if this issue exists on vSphere 7.0 and later since vSphere 6.7 is no longer supported.

Ryan Johnson
Distinguished Engineer, VMware by Broadcom

@tenthirtyam tenthirtyam self-assigned this Jun 11, 2024
@tenthirtyam tenthirtyam added waiting-response Status: Waiting on a Response and removed needs-triage Status: Issue Needs Triage labels Jun 11, 2024
@github-actions github-actions bot removed the waiting-response Status: Waiting on a Response label Jun 11, 2024
@tenthirtyam tenthirtyam added the waiting-response Status: Waiting on a Response label Jun 11, 2024
@tenthirtyam tenthirtyam added this to the Backlog milestone Jun 12, 2024
@tenthirtyam
Copy link
Collaborator

No response from OP.

@tenthirtyam tenthirtyam closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2024
@github-actions github-actions bot removed the waiting-response Status: Waiting on a Response label Jul 2, 2024
Copy link

github-actions bot commented Aug 3, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2024
@tenthirtyam tenthirtyam removed this from the Backlog milestone Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants