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

New to Terraform, getting error when I try to run one of the examples here. #3

Open
jt0dd opened this issue Sep 25, 2022 · 0 comments

Comments

@jt0dd
Copy link

jt0dd commented Sep 25, 2022

I asked a much more detailed question about this here: https://stackoverflow.com/questions/73846433/getting-error-keypair-data-is-invalid-failed-to-generate-fingerprint-when-try

Basically when I try to run this example, I get an error.

terraform apply
openstack_networking_network_v2.generic: Refreshing state... [id=78d4b357-94e9-4e44-a4b7-1d511272ab67]
openstack_compute_secgroup_v2.http: Refreshing state... [id=c6df510c-dac9-4c9a-8aa2-24d13ad1bb05]
openstack_compute_secgroup_v2.ssh: Refreshing state... [id=85d5c066-96e6-4ce9-8e6d-3b080f44154d]
openstack_networking_subnet_v2.http: Refreshing state... [id=5a2d02d8-8060-4dd9-96dc-9be2817d605a]
openstack_networking_port_v2.http: Refreshing state... [id=2df06d20-4e64-479a-8bca-687efdb2d9cc]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the
following symbols:
  + create

Terraform will perform the following actions:

  # openstack_compute_floatingip_associate_v2.http will be created
  + resource "openstack_compute_floatingip_associate_v2" "http" {
      + floating_ip = (known after apply)
      + id          = (known after apply)
      + instance_id = (known after apply)
      + region      = (known after apply)
    }

  # openstack_compute_instance_v2.http will be created
  + resource "openstack_compute_instance_v2" "http" {
      + access_ip_v4        = (known after apply)
      + access_ip_v6        = (known after apply)
      + all_metadata        = (known after apply)
      + all_tags            = (known after apply)
      + availability_zone   = (known after apply)
      + flavor_id           = (known after apply)
      + flavor_name         = "t2.medium"
      + force_delete        = false
      + id                  = (known after apply)
      + image_id            = (known after apply)
      + image_name          = "Centos 8"
      + key_pair            = "user-key"
      + name                = "http"
      + power_state         = "active"
      + region              = (known after apply)
      + security_groups     = (known after apply)
      + stop_before_destroy = false
      + user_data           = "e0f40e5d4bf87b308d752b6281ee2b6879051561"

      + network {
          + access_network = false
          + fixed_ip_v4    = (known after apply)
          + fixed_ip_v6    = (known after apply)
          + floating_ip    = (known after apply)
          + mac            = (known after apply)
          + name           = (known after apply)
          + port           = "2df06d20-4e64-479a-8bca-687efdb2d9cc"
          + uuid           = (known after apply)
        }
    }

  # openstack_compute_keypair_v2.user_key will be created
  + resource "openstack_compute_keypair_v2" "user_key" {
      + fingerprint = (known after apply)
      + id          = (known after apply)
      + name        = "user-key"
      + private_key = (known after apply)
      + public_key  = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAjpC1hwiOCCmKEWxJ4qzTTsJbKzndLotBCz5PcwtUnflmU+gHJtWMZKpuEGVi29h0A/+ydKek1O18k10Ff+4tyFjiHDQAnOfgWf7+b1yK+qDip3X1C0UPMbwHlTfSGWLGZqd9LvEFx9k3h/M+VtMvwR1lJ9LUyTAImnNjWG7TaIPmui30HvM2UiFEmqkr4ijq45MyX2+fLIePLRIF61p4whjHAQYufqyno3BS48icQb4p6iVEZPo4AE2o9oIyQvj2mx4dk5Y8CgSETOZTYDOR3rU2fZTRDRgPJDH9FWvQjF5tA0p3d9CoWWd2s6GKKbfoUIi8R/Db1BSPJwkqB"
      + region      = (known after apply)
    }

  # openstack_networking_floatingip_v2.http will be created
  + resource "openstack_networking_floatingip_v2" "http" {
      + address    = (known after apply)
      + all_tags   = (known after apply)
      + dns_domain = (known after apply)
      + dns_name   = (known after apply)
      + fixed_ip   = (known after apply)
      + id         = (known after apply)
      + pool       = "external-network"
      + port_id    = (known after apply)
      + region     = (known after apply)
      + tenant_id  = (known after apply)
    }

  # openstack_networking_router_interface_v2.http will be created
  + resource "openstack_networking_router_interface_v2" "http" {
      + id        = (known after apply)
      + port_id   = (known after apply)
      + region    = (known after apply)
      + router_id = (known after apply)
      + subnet_id = "5a2d02d8-8060-4dd9-96dc-9be2817d605a"
    }

  # openstack_networking_router_v2.generic will be created
  + resource "openstack_networking_router_v2" "generic" {
      + admin_state_up          = (known after apply)
      + all_tags                = (known after apply)
      + availability_zone_hints = (known after apply)
      + distributed             = (known after apply)
      + enable_snat             = (known after apply)
      + external_gateway        = (known after apply)
      + external_network_id     = "f67f0d72-0ddf-11e4-9d95-e1f29f417e2f"
      + id                      = (known after apply)
      + name                    = "router-generic"
      + region                  = (known after apply)
      + tenant_id               = (known after apply)

      + external_fixed_ip {
          + ip_address = (known after apply)
          + subnet_id  = (known after apply)
        }
    }

Plan: 6 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

openstack_compute_keypair_v2.user_key: Creating...
openstack_networking_router_v2.generic: Creating...
openstack_networking_floatingip_v2.http: Creating...
╷
│ Error: Unable to create openstack_compute_keypair_v2 user-key: Bad request with: [POST http://192.168.22.129/compute/v2.1/os-keypairs], error message: {"badRequest": {"code": 400, "message": "Keypair data is invalid: failed to generate fingerprint"}}
│
│   with openstack_compute_keypair_v2.user_key,
│   on 010-ssh-key.tf line 3, in resource "openstack_compute_keypair_v2" "user_key":
│    3: resource "openstack_compute_keypair_v2" "user_key" {
│
╵
╷
│ Error: Error creating openstack_networking_router_v2: Resource not found
│
│   with openstack_networking_router_v2.generic,
│   on 020-network.tf line 4, in resource "openstack_networking_router_v2" "generic":
│    4: resource "openstack_networking_router_v2" "generic" {
│
╵
╷
│ Error: No network found with name: external-network
│
│   with openstack_networking_floatingip_v2.http,
│   on 060-instance_http.tf line 31, in resource "openstack_networking_floatingip_v2" "http":
│   31: resource "openstack_networking_floatingip_v2" "http" {

Did I make some mistake here? I'm running TF in a Windows 11 environment. My OpenStack is running in an Ubuntu VM. I don't really understand the purpose of the key pair here, to be honest, much less what might be wrong with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant