Using Terraform with PowerVC to deploy new AIX VMsIBM PowerVC Architect, Joe Cropper published an excellent article last year, in which he described how Terraform can be used with PowerVC, to deploy workloads in an Openstack environment. You can read it here:
http
I tested this in my lab recently. I downloaded Terraform to my Macbook and configured it to communicate with my PowerVC management server. Then I deployed a new AIX VM. It worked like a charm! I was impressed with how easy and quick it was to configure and use.
cgibson@xwing : ~/Do Terraform v0.11.7 + provider.openstack v1.6.0
Following Joe’s instructions, I configured the main.tf file:
cgibson@xwing : ~/Do provider "openstack" { user_name = "pvcadmin" password = "abc123" tenant_name = "ibm-default" domain_name = "Default" auth_url = "htt insecure = true }
resource "ope name = "TF-VM" image_id = "aae flavor_id = "ee5
network { uuid = "113 name = "VLAN55" } }
I deployed a new VM with “terraform apply”.
cgibson@xwing : ~/Do
An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: + create
Terraform will perform the following actions:
+ open id: acce acce all_ avai flav flav forc imag imag name netw netw netw netw netw netw netw netw netw regi secu stop
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.
Enter a value: yes
open acce acce all_ avai flav flav forc imag image_name: "" => "<computed>" name netw netw netw netw netw netw netw netw netw region: secu stop open open open open open open
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
cgibson@xwing : ~/Do total 198736 -rwxrwxr-x@ 1 cgibson staff 83486736 11 Apr 02:52 terraform -rw-r--r--@ 1 cgibson staff 17754416 25 Jun 13:00 terr -rw-r--r-- 1 cgibson staff 466 27 Jun 16:31 main.tf -rw-r--r-- 1 cgibson staff 318 6 Jul 11:56 terr -rw-r--r-- 1 cgibson staff 2521 6 Jul 11:56 terraform.tfstate
cgibson@xwing : ~/Do { "version": 3, "ter "serial": 10, "lineage": "c58 "modules": [ { "path": [ "root" ], "outputs": {}, "resources": { "ope "type": "ope "depends_on": [], "primary": { }, "deposed": [],
"provider": "pro } }, "depends_on": [] } ] }
After a few minutes, I could ssh into the new VM, from my Macbook.
cgibson@xwing : ~/Do
cgibson@xwing : ~/Do PING 10.2.55.108 (10.2.55.108): 56 data bytes 64 bytes from 10.2.55.108: icmp_seq=0 ttl=253 time=27.739 ms 64 bytes from 10.2.55.108: icmp_seq=1 ttl=253 time=22.941 ms 64 bytes from 10.2.55.108: icmp_seq=2 ttl=253 time=23.213 ms ^C --- 10.2.55.108 ping statistics --- 3 packets transmitted, 3 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 22.9 cgibson@xwing : ~/Do
cgibson@xwing : ~/Do root@10.2.55.108's password: Last unsuccessful login: Thu Jul 5 20:27:26 CDT 2018 on ssh from 10.2.55.222 Last login: Thu Jul 5 20:27:29 CDT 2018 on /dev/pts/0 from 10.2.55.222 **** * * * Welcome to AIX Version 7.2! * * * Please see the README file in /usr/lpp/bos for information pertinent to * * this release of the AIX Operating Syst * * **** # oslevel -s 7200-02-02-1810 # lparstat -i Node Name Partition Name Partition Numb Type Mode Entitled Capa ...
When I was done with the VM, I deleted it with “terraform destroy”.
cgibson@xwing : ~/Do open
An execution plan has been generated and is shown below. Resource actions are indicated with the following symbols: - destroy
Terraform will perform the following actions:
- open
Plan: 0 to add, 0 to change, 1 to destroy.
Do you really want to destroy? Terraform will destroy all your managed infrastructure, as shown above. There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes
open open open open
Destroy complete! Resources: 1 destroyed.
On the PowerVC server, I saw corresponding messages appear in the log and observed the creation and deletion of the VM.
Creation of new VM
VM removal
|