Advertisement
Guest User

Untitled

a guest
Apr 29th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. "Agent Group.yaml"
  2.  
  3. heat_template_version: 2013-05-23
  4.  
  5. parameters:
  6. agent_network:
  7. type: string
  8. constraints:
  9. - custom_constraint: neutron.network
  10. flavor:
  11. type: string
  12. default: "m1.small"
  13. key_name:
  14. type: string
  15. default: StorPerf
  16. security_group_name:
  17. type: string
  18. default: StorPerf
  19. volume_size:
  20. type: number
  21. description: Size of the volume to be created.
  22. default: 1
  23. constraints:
  24. - range: { min: 1, max: 1024 }
  25. description: must be between 1 and 1024 Gb.
  26. agent_count:
  27. type: number
  28. default: 1
  29. constraints:
  30. - range: { min: 1, max: 512 }
  31. description: must be between 1 and 512 agents.
  32.  
  33.  
  34. resources:
  35. slaves:
  36. type: OS::Heat::ResourceGroup
  37. properties:
  38. count: {get_param: agent_count}
  39. resource_def: {
  40. type: "storperf-agent.yaml",
  41. properties: {
  42. agent_network: {get_param: agent_network},
  43. flavor: {get_param: flavor},
  44. key_name: {get_param: key_name},
  45. volume_size: {get_param: volume_size},
  46. security_group_name: {get_param: security_group_name}
  47. }
  48. }
  49.  
  50. storperf_security_group:
  51. type: OS::Neutron::SecurityGroup
  52. properties:
  53. description: An open security group to allow all access to the StorPerf slaves
  54. name: {get_param: security_group_name}
  55. rules:
  56. - remote_ip_prefix: 0.0.0.0/0
  57. protocol: tcp
  58. direction: ingress
  59. - remote_ip_prefix: 0.0.0.0/0
  60. protocol: icmp
  61. direction: ingress
  62.  
  63.  
  64. outputs:
  65. slave_ips: {
  66. description: "Slave addresses",
  67. value: { get_attr: [ slaves, storperf_agent_ip] }
  68. }
  69.  
  70. =================================================================================================
  71.  
  72. "storperf-agent.yaml"
  73.  
  74. heat_template_version: 2013-05-23
  75.  
  76. parameters:
  77. flavor:
  78. type: string
  79. default: m1.small
  80. image:
  81. type: string
  82. default: 'StorPerf Ubuntu 14.04'
  83. key_name:
  84. type: string
  85. default: StorPerf
  86. username:
  87. type: string
  88. default: storperf
  89. security_group_name:
  90. type: string
  91. default: StorPerf
  92. volume_size:
  93. type: number
  94. description: Size of the volume to be created.
  95. default: 1
  96. constraints:
  97. - range: { min: 1, max: 1024 }
  98. description: must be between 1 and 1024 Gb.
  99. agent_network:
  100. type: string
  101. constraints:
  102. - custom_constraint: neutron.network
  103.  
  104. resources:
  105.  
  106. storperf_agent:
  107. type: "OS::Nova::Server"
  108. properties:
  109. name: storperf-agent
  110. image: { get_param: image }
  111. flavor: { get_param: flavor }
  112. key_name: { get_param: key_name }
  113. networks:
  114. - port: { get_resource: storperf_agent_port }
  115. user_data: { get_resource: storperf_agent_config }
  116. user_data_format: RAW
  117.  
  118. storperf_agent_config:
  119. type: "OS::Heat::CloudConfig"
  120. properties:
  121. cloud_config:
  122. users:
  123. - name: { get_param: username }
  124. - default
  125. package_update: false
  126. package_upgrade: false
  127. manage_etc_hosts: localhost
  128.  
  129. storperf_agent_port:
  130. type: "OS::Neutron::Port"
  131. properties:
  132. network_id: { get_param: agent_network }
  133. security_groups:
  134. - { get_param: security_group_name }
  135.  
  136. agent_volume:
  137. type: OS::Cinder::Volume
  138. properties:
  139. size: { get_param: volume_size }
  140.  
  141. agent_volume_att:
  142. type: OS::Cinder::VolumeAttachment
  143. properties:
  144. instance_uuid: { get_resource: storperf_agent }
  145. volume_id: { get_resource: agent_volume}
  146.  
  147. outputs:
  148. storperf_agent_ip:
  149. description: The IP address of the agent on the StorPerf network
  150. value: { get_attr: [ storperf_agent, first_address ] }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement