Automate OpenStack Security Group with Terraform

Heat is the main project in the OpenStack Orchestration program. We can use heat to automate security group implementation. If you have NSXv plugin integrated with your OpenStack environment, you can use Heat template to automate your NSX DFW rules implementation as well. Here I will show you how to use Terraform to do the …

Continue reading Automate OpenStack Security Group with Terraform

OpenStack CLI to create a VM

To create a VM in OpenStack, you can use a Nova CLI as the below: nova boot --flavor SMALL4_2CPU_4GBRAM_80GBDISK --image rhel7 --nic net-id=eafea72a-c26e-4f73-826c-552da03cf532  myRHEL--availability-zone avz01 Except the name of the virtual machine, you need to find out all other requested parameters (flavor, image, net-id and availability-zone) so that you can use  "nova boot". Please refer the CLI below …

Continue reading OpenStack CLI to create a VM

Automate OpenStack with Terraform

Terraform can be used with Openstack for auto-provisioing. Today, I will shows a working Terraform example in Openstack. Firstly, define a Openstack provider for Terraform. Provider: provider "openstack" { user_name = "${var.openstack_user_name}" password = "${var.openstack_password}" tenant_name = "project1" auth_url = "http://keystone.openstack.com.au:5000/v3" domain_name = "DOMAINNAME" } Terraform currently support the following Openstack resource type: Compute, Network, …

Continue reading Automate OpenStack with Terraform

Heat stack operation CLI

List all heat stacks in one Openstack project heat stack-list create a new heat stacks heat stack-create stackname -f template.yml update a existing heat stacks heat stack-update stackname -f template.yml update a existing heat stacks heat stack-delete stackname check stack create/update/delete progress heat event-list stackname display stack information heat stack-show stackname display resource information for a stack heat resource-list stackname display all VM …

Continue reading Heat stack operation CLI

How to quickly find which project one VM belongs to

In multi-tenants OpenStack environment, you possibly need to quickly find which project one VM belongs to. From CLI, I just found out a quick way. Step 1: [root@openstack RC]# nova list --all-tenants | grep 10.42.130.174 | 1c1c1051-2b28-47a6-9019-9ac2e3670587 | lnxau2004-001 | bc1dff54cfc841dfb8cc5b56e75d10e9 | ACTIVE | - | Running | sls1-dev-isd-waz001=10.42.130.174 From the output of Step 1, we …

Continue reading How to quickly find which project one VM belongs to

OpenStack Neutron CLI for NSXv

Create a new shared network neutron net-create network1 --name network1 --shared Create a new exclusive network neutron net-create network1 --name network1 Create a VLAN network neutron net-create net-vlan --provider:segmentation_id VLAN-ID --provider:network_type vlan --provider:physical_network DVS-Switch-ID Create a subnet neutron subnet-create network1 172.16.31.0/24 --name subnet01 --allocation-pool start=172.16.31.2,end=172.16.31.254 --disable-dhcp --gateway 172.16.31.1 Create a DLR neutron router-create dlr01 --distributed True Create a Edge neutron router-create --distributed false …

Continue reading OpenStack Neutron CLI for NSXv