Professional Documents
Culture Documents
OpenStack
Ing. Ruben Cordova
Pontifical Catholic University of Peru
1
Outline
1. Bash tools
1. awk
2. Python
1. ‘os’ library
2. ‘subprocess’ library
3. Heat
1. Architecture
2. HOT format
2
Bash Tools: awk
1. Print line
openstack server list | awk ‘NR==4’
2. Print column
openstack network list | awk ‘{print $4}’
3. Match pattern
openstack service list | awk '($6=="identity")'
3
Python Scripting
‘os’ library
Execute command in a subshell and get return code
Example
p = os.system (‘ls -lh’)
‘subprocess’ library
Newer module, intended to replace os
Allows to capture ‘stdout’ and ‘stderr’
Example
p = subprocess.Popen(“ls –lh”, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, err = p.communicate()
exit_code = p.wait()
4
Activity 1
5
Heat
6
Heat: Architecture [2]
7
Heat: Architecture
Heat-api
OpenStack-native REST API
Processes API requests by sending them to heat-engine
Heat-api-cfn
AWS Query API compatible with AWS CloudFormation
Processes API requests and send them to heat-engine
Heat-engine
Orchestrates the launching of templates
Provides events back to API consumer
8
Heat: HOT Format
9
Bibliography
10