terraform-provider-openstack: resource openstack_compute_instance_v2 doesn't support import

This issue was originally opened by @michalmedvecky as hashicorp/terraform#12198. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.9.0-dev (89acb5811a25e59e6a9d55cf5a2429846e3b5982+CHANGES)

Affected Resource(s)

openstack_compute_instance_v2

Terraform Configuration Files

resource "openstack_compute_instance_v2" "test" {
  name = "test"
  image_id = "ubuntu"
  flavor_name = "m1.large"
  key_pair = "misko"
  availability_zone = "mz"
}

Expected Behavior

resource should be imported

Actual Behavior

Error importing: 1 error(s) occurred:

* import openstack_compute_instance_v2.test (id: 2a98121a-5ec0-4694-98f2-9aff75bc666c): resource openstack_compute_instance_v2 doesn't support import

Steps to Reproduce

  1. create the .tf file
  2. get an id of one existing instance
  3. terraform import openstack_compute_instance_v2.test <my-instance-uuid>

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 23 (10 by maintainers)

Most upvoted comments

The lack of the ability to import or even a documented way to write the state by hand (utterly painful to next to impossible), is a non-starter. You cannot “take over” management of existing infrastructure without the ability to import ALREADY EXISTING (and likely in use/production) resources.

@jayaprakashr One other option might be to build a ‘parallel’ stack via Terraform in order to generate a state file. It’ll then be a case of copying that state file and modifying the resource UUID’s to match the HEAT generated resources…

Not pretty, but might un-block you…

There’s currently no ETA for this.

Can you explain your use-case where you are blocked from using Terraform because you can’t import instances?