- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
04-12-2018 07:18 AM
I am trying to automate a vm inside openstack in our Ocata environment using terraform. But I am having issues using the personality when i am building the instance. Using heat template the snippet of the code is as follows.
### Heat ####
user_data_format: RAW
config_drive: true
personality:
/config/init-cfg.txt: {get_file: "/root/bootstrap/config/init-cfg.txt"}
/config/bootstrap.xml: {get_file: "/root/bootstrap/config/bootstrap.xml"}
But in terraform, i cannot find a similar way of setting the personality function. So this is what I tried to use:
resource "openstack_compute_instance_v2" "pan81" {
# count = "${var.count}"
name = "pan01"
image_name = "PAN81"
flavor_name = "p1.large"
key_pair = "${var.openstack_keypair}"
security_groups = ["default"]
config_drive = "true"
metadata {
instance_test = "pan image"
}
network {
name = "terra-mgmt"
}
network {
name = "terra-north"
}
network {
port = "${openstack_networking_port_v2.terra-south-port.id}"
}
personality {
file = "init-cfg.txt"
contents = "/config/init-cfg.txt"
}
Terraform Error:
* openstack_compute_instance_v2.cirros: "personality.0.content": required field is not set
* openstack_compute_instance_v2.cirros: personality.0: invalid or unknown key: contents
Does anyone know how to properly configure the personality block inside the resource "openstack_compute_instance_v2"?
04-30-2018 11:05 AM
Looks you're using the Openstack terraform provider there.. I don't know anything about it, but Palo Alto Networks does have a terraform provider now. Would using it fit your use case? It was just updated last week to add Panorama support.
Here's the documentation for it (you just need to do terraform init
in a directory that has a panos resource to get the provider itself):
04-30-2018 11:18 AM
I am also using the pan provider but the issue with using the pan provider is that when an instance is being built in openstack, the pan provider is also called and fails. The pan provider is best when the instance is already reachable and built.
04-30-2018 11:51 AM
Ah, yes. This is a Terraform thing, where they aren't good at "use this provider only after this other provider has provisioned it."
Click Accept as Solution to acknowledge that the answer to your question has been provided.
The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!
These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!
The LIVEcommunity thanks you for your participation!