How to launch an instance in OpenStack using Terraform?

0 votes

Hi Guys,

I am new in Terraform. I have my OpenStack Cloud. I want to launch one instance in OpenStack using Terraform. How can I do that?

Jul 5 in OpenStack by akhtar
• 18,250 points
48 views

1 answer to this question.

0 votes

Hi@akhtar,

You need to use openstack_compute_instance_v2 resource to launch an instance in OpenStack. This resource automatically connects to your OpenStack Cloud from Terraform. I have attached one example for your reference.

provider "openstack" {
  user_name   = "demo"
  tenant_name = "demo"
  password    = "647a07963bf74375"
  auth_url    = "openstack_url"
  region      = "RegionOne"
}

resource "openstack_compute_instance_v2" "basic" {
  name            = "myimage"
  image_id        = "4892a7c5-dc0d-48cd-bd70-0e6c77bd7668"
  flavor_name       = "m1.small"
  network {
    name = "private"
  }
}

I hope this will give you some ideas.

answered Jul 5 by MD
• 42,420 points

Related Questions In OpenStack

0 votes
1 answer

How to launch one instance in OpenStack from CLI?

Hi@akhtar, You need to login to your OpenStack ...READ MORE

answered Jul 5 in OpenStack by MD
• 42,420 points
46 views
0 votes
1 answer

How to create an image in OpenStack?

Hi@akhtar, Actually this is the fun in OpenStack. ...READ MORE

answered Mar 16 in OpenStack by MD
• 42,420 points
232 views
0 votes
1 answer

How to update an image properties in OpenStack?

Hi@akhtar, You can update your image properties. Follow ...READ MORE

answered Mar 16 in OpenStack by MD
• 42,420 points
44 views
0 votes
1 answer

How do I configure Block Storage to use an NFS storage back end in OpenStack?

Hi@akhtar, You can use NFS technology for your ...READ MORE

answered Mar 19 in OpenStack by MD
• 42,420 points
128 views
0 votes
1 answer

How to connect OpenStack Cloud with Terraform?

Hi@akhtar, To connect any Cloud, Terraform has a ...READ MORE

answered Jul 5 in OpenStack by MD
• 42,420 points
44 views
0 votes
1 answer

Can anyone explain, how nova works internally?

Hi@akhtar, Nova is comprised of multiple server process, ...READ MORE

answered Mar 17 in OpenStack by MD
• 42,420 points
72 views
0 votes
1 answer

Instance is not pingable from outside in OpenStack!

Ho@akhtar, There is nothing wrong. But when you ...READ MORE

answered Mar 17 in OpenStack by MD
• 42,420 points
386 views
0 votes
1 answer

How to reset error state of a instance into active in OpenStack env?

Hi@akhtar, There are some scenarios where some instances ...READ MORE

answered Mar 17 in OpenStack by MD
• 42,420 points
309 views
0 votes
1 answer

How to create an instance in OpenStack?

Hi@akhtar, When we try to launch an instance ...READ MORE

answered Mar 17 in OpenStack by anonymous
• 42,420 points
99 views
0 votes
1 answer

Not able to launch an instance in OpenStack?

Hi@akhtar, You might get this error because you ...READ MORE

answered Mar 20 in OpenStack by MD
• 42,420 points
82 views