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 execute a terraform plan #2057

Closed
2 of 4 tasks
T0myC opened this issue Nov 9, 2023 · 10 comments
Closed
2 of 4 tasks

Unable to execute a terraform plan #2057

T0myC opened this issue Nov 9, 2023 · 10 comments
Labels
question/provider Question: Provider

Comments

@T0myC
Copy link

T0myC commented Nov 9, 2023

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

Terraform Provider

v2.5.1

VMware vSphere

v7.0

Description

I try to create VM on a vSphere server using terraform.
In order to test my connection with my server, I try to get the content of the datacenter by using the vsphere_datacenter DataSource but it doesn't work.

Affected Resources or Data Sources

data/vsphere_datacenter

Terraform Configuration

terraform {
  required_providers {
    vsphere = {
      source  = "hashicorp/vsphere"
      version = "2.5.1"
    }
  }
}

provider "vsphere" {
  user                         = var.user
  password                 = var.passwd
  vsphere_server        = var.server
  allow_unverified_ssl = true
}

data "vsphere_datacenter" "datacenter" {
  name = var.datacenter
}

Debug Output

│ Error: invalid character '<' looking for beginning of value

│ with provider["registry.terraform.io/hashicorp/vsphere"],
│ on main.tf line 10, in provider "vsphere":
│ 10: provider "vsphere" {

Panic Output

No response

Expected Behavior

Get the informations about cluster

Actual Behavior

Get the error : "invalid character '<' looking for beginning of value"

Steps to Reproduce

Copy the code above and execute a terraform plan.

Environment Details

The vSphere server is in OVH private cloud secure by 2FA.

Screenshots

No response

References

No response

@T0myC T0myC added bug Type: Bug needs-triage Status: Issue Needs Triage labels Nov 9, 2023
Copy link

github-actions bot commented Nov 9, 2023

Hello, T0myC! 🖐

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.

@tenthirtyam tenthirtyam added question/provider Question: Provider and removed bug Type: Bug needs-triage Status: Issue Needs Triage labels Nov 9, 2023
@tenthirtyam
Copy link
Collaborator

A redacted. but similar example of the datacenter name would need to be provided.

│ Error: invalid character '<' looking for beginning of value
│
│ with provider["registry.terraform.io/hashicorp/vsphere"],
│ on main.tf line 10, in provider "vsphere":
│ 10: provider "vsphere" {

Looks like an issue in your variable name.

@T0myC
Copy link
Author

T0myC commented Nov 9, 2023

My variable var.server is "nameserver.ovh.com".
There is not '<' caracter.

@tenthirtyam
Copy link
Collaborator

More details are ideal for assistance.

Here are some examples of mine that may help in case it's syntax related.

https://github.com/tenthirtyam/terrafom-examples-vmware/tree/main/vsphere/vsphere-virtual-machine

@T0myC
Copy link
Author

T0myC commented Nov 9, 2023

Sorry but I don't know which details I could add because of the simplicity of the test ...
I just want to do what you have done at the beggining of each of your terraform file (get datcenter info).

It seems like the connection with the vSphere is OK because when I enter a wrong password or a wrong server name, I have the error saying : error setting up new vSphere SOAP client : Incorrect password/username or no such host.

It's like the API return HTML (so beginning by '<') and terraform was expecting something else.

@tenthirtyam
Copy link
Collaborator

Try the same connection with govc in govmomi.

@T0myC
Copy link
Author

T0myC commented Nov 10, 2023

When I try the same connection with govc, it works properly

@T0myC
Copy link
Author

T0myC commented Nov 16, 2023

Anyone has an idea please ?

@louisquentinjoucla
Copy link

louisquentinjoucla commented Nov 17, 2023

Hey!

All routes are not whitelisted with ovh 2FA! You need to setup a whitelist. Please read:
https://help.ovhcloud.com/csm/en-gb-vmware-use-2fa?id=kb_article_view&sysparm_article=KB0046140

Copy link

github-actions bot commented Apr 7, 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 Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question/provider Question: Provider
Projects
None yet
Development

No branches or pull requests

3 participants