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

Openstack provider / openstack_compute_instance_v2 resources do not export access_ip_vX addresses since v0.6.11 #5358

Closed
bkarypid opened this issue Feb 27, 2016 · 8 comments · Fixed by #5366
Labels

Comments

@bkarypid
Copy link

I upgraded to version 0.6.11 from 0.6.3 and I noticed that the openstack_compute_instance_v2 resources do not export the access_ip_v4 and v6 addresses anymore. An excerpt from my terraform.tfstate file:

 "resources": {
            "openstack_compute_instance_v2.test-instance.0": {
                "type": "openstack_compute_instance_v2",
                "depends_on": [
                    "template_file.test-file"
                ],
                "primary": {
                    "id": "xxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxx",
                    "attributes": {
                        "access_ip_v4": "",
                        "access_ip_v6": "",
                        "config_drive": "true",
                        "flavor_id": "general1-4",
                        "flavor_name": "4 GB General Purpose v1",

...................................................................................................................................

I tried with v0.6.12 and the issue remains. It works fine in versions 0.6.10 and below with the exact same config (i tried with 0.6.3 and 0.6.10 and the access IPs were exported properly), so something must have been introduced in the Openstack provider in v0.6.11 that causes this issue.

FYI this might only affect the Rackspace implementation of Openstack (I've only tried it in Rackspace), so I understand that there are differences anyway, however until v0.6.10 I was able to retrieve these values without any problems.

Any thoughts?

@jtopjian
Copy link
Contributor

I'm quite positive this is a Rackspace issue. I just used 0.6.12 yesterday to register an access_ip_v6 address with Route 53.

However, with that said, if it worked before with Rackspace, maybe it can work again. There were some changes to how fixed and floating IPs were used starting in 0.6.11.

Are you using a network block within your instances? If so, try setting access_network = true to the network you want to use for the access_ip_v* stuff. Let me know if that doesn't work and I'll take a closer look.

Can you also post the Terraform configuration you're using?

@bkarypid
Copy link
Author

Unfortunately adding access_network = true to the network block I want to use for the access_ip_v4 didn't have any effect. Tried again with 0.6.10 (without the access_network param) and worked fine.

This is the Terraform config for one of the compute resources:

resource "openstack_compute_instance_v2" "test-instance" {
region = "${var.region}"
name = "test-instance-${count.index}"
flavor_id = "${var.instance_type}"
image_id = "${var.image_id}"
count = "${var.instances}"
key_pair = "${var.key_pair}"
network =
{
uuid = "${var.public_network_id}"
name = "${var.public_network_name}"
access_network = "true"
}
config_drive = "true"
user_data = "${template_file.user_data.rendered}"
}

The access ip should be computed, and I can still ssh to the server just fine, I just can't get the ip back from terraform, as it is empty in the state file. Everything else works fine.

@jtopjian
Copy link
Contributor

@bkarypid I've just opened #5366 which might resolve this issue. Are you able to compile from source and test it out?

Instructions on how to build from source can be found here. Replace provider-azure with provider-openstack and you'll be good to go.

@bkarypid
Copy link
Author

@jtopjian I've just compiled the openstack provider from source, after updating the code with your changes, and it works fine now. I can retrieve the access IPs properly. Many thanks for taking the time to look into this. I hope that this makes it through to the next Terraform release; in the meantime we'll probably have to work with v0.6.10. Again, many thanks for your help!

@jtopjian
Copy link
Contributor

@bkarypid That's great news! I've just merged the code in, so it'll definitely be part of 0.6.13 when it's released. Until then feel free to use the binary you compiled :)

@jtopjian
Copy link
Contributor

@bkarypid Also, it's very interesting to know that you're using the OpenStack provider successfully with Rackspace. I think you're the first to mention that (though others may be doing it).

Can you provide any customizations you do with your provider and resource configurations? I could add it to the documentation for other users to follow. 😄

@bkarypid
Copy link
Author

bkarypid commented Mar 1, 2016

@jtopjian Unfortunately I'm not doing anything too fancy really.

The issue about not being able to create networking resources for Rackspace with Terraform (for the reason mentioned here: #1560) still persists and, in addition, security groups can't be created as well, I believe because Rackspace expects an API call to /security-groups, but I think Terraform uses the default Openstack endpoint /os-security-groups.

That being said, we can still create networks (and probably other resources that might not be possible to create through Terraform at the moment) by means outside from Terraform (eg. through the Rackspace console or via the nova client) and then pass the IDs and names into the appropriate Terraform variables, so that they can be referenced in the network blocks of the compute instances. If the Rackspace provider is completed it would be great of course, but this still isn't an extreme compromise, given for example that instances can be provisioned without any issues through Terraform.

In terms of config, nothing really special in the provider configuration; an auth_url with the value of https://identity.api.rackspacecloud.com/v2.0 along with a region (for example LON) will be fine, provided that user_name password and tenant_name are provided correctly. For more details on resource config you could have a look at the repo I referenced above (though as I said, nothing quite fancy).

@ghost
Copy link

ghost commented Apr 27, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants