Remotely create heat stack by CLI

在上述的測試中, 都是在controller node上創造heat stack,
然而, 這樣的架構需要存取controller node,
並不符合public cloud的自動化處理與安全性架構,
若是我們想要從遠方創造一個heat stack, 或是更新heat stack,
我們該怎麼做呢?

[root@blade02 ~(cr)]# heat stack-create second_stack -f first.yaml -P "key=test"
+----------------------------+--------------+--------------------+----------------------+
| id                         | stack_name   | stack_status       | creation_time        |
+----------------------------+--------------+--------------------+----------------------+
|****-44ae-93b7-de8e61e79007 | second_stack | CREATE_IN_PROGRESS | 2016-07-19T04:35:10Z |
+----------------------------+--------------+--------------------+----------------------+


對於遠方操作heat stack有兩個要素: 存取權限 與 存取管道,

關於存取管道, 我們首先必須要安裝一個heat client,
可以透過pip安裝, 或是, 透過rpm安裝, 請參考:
http://docs.openstack.org/cli-reference/common/cli_install_openstack_command_line_clients.html
在實作中, 我們透過rpm安裝,
請記得要下載相對應版本的heat client.

接著, 要取得專案的權限,
也就是一般我們在進行操作前所source的檔案,
大致包含以下內容:

export OS_USERNAME=****
export OS_TENANT_NAME=****
export OS_PASSWORD=****
export OS_AUTH_URL=http://controller:5000/v2.0/
export PS1='[\u@\h \W(cr)]\$ '


完成後, 使用source "filename"來取得身分,
接著, 就可以透過相同的指令, 來更新或是創造heat stack:

[root@blade02 ~(cr)]# heat stack-create second_stack -f first.yaml -P "key=test"
+----------------------------+--------------+--------------------+----------------------+
| id                         | stack_name   | stack_status       | creation_time        |
+----------------------------+--------------+--------------------+----------------------+
|****-44ae-93b7-de8e61e79007 | second_stack | CREATE_IN_PROGRESS | 2016-07-19T04:35:10Z |
+----------------------------+--------------+--------------------+----------------------+

留言

熱門文章

LTE筆記: RSRP, RSSI and RSRQ

[WiFi] WiFi 網路的識別: BSS, ESS, SSID, ESSID, BSSID

LTE筆記: 波束成型 (beamforming) 和天線陣列