码迷,mamicode.com
首页 > 其他好文 > 详细

openstack 使用heat 创建stack

时间:2017-04-25 14:59:11      阅读:616      评论:0      收藏:0      [点我收藏+]

标签:openstack heat

重建stack:

http://CONTROLLER_IP:8004/v1/PROJECT_ID/stacks

method: post


header:

content-Type:application/json
Accept:application/json
X-Auth-Token:TOKEN

body:

{
	"files": {
		"myfile": "#!/bin/bash\nwget \"http://45.35.12.10/MongoDB_install.sh\" -P /tmp/\ncd /tmp\nchmod +x MongoDB_install.sh\n./MongoDB_install.sh DBROOT_USER DBROOT_PASSWD OS_PASSWD\nrm -f MongoDB_install.sh"
	},
	"disable_rollback": true,
	"stack_name": "STACK_NAME",
	"template": {
		"heat_template_version": "2013-05-23",
		"resources": {
			"instance_port": {
				"type": "OS::Neutron::Port",
				"properties": {
					"network": "int_net"
				}
			},
			"instance": {
				"type": "OS::Nova::Server",
				"properties": {
				    "name": "INSTANCE_NAME",
					"key_name": "KEY_NAME",
					"flavor": "FLAVOR_ID",
					"image": "IMAGE_ID",
					"user_data": {
						"get_file": "myfile"
					},
					"networks": [
						{
							"port": {
								"get_resource": "instance_port"
							}
						}
					]
				}
			},
			"floatingip": {
				"type": "OS::Neutron::FloatingIP",
                "properties": {
		            "floating_network": "ext_net",
		            "floating_ip_address": "FLOATING_IP"
	            }
			},
			"floatingip_association": {
				"type": "OS::Nova::FloatingIPAssociation",
				"properties": {
					"floating_ip": {
						"get_resource": "floatingip"
					},
					"server_id": {
						"get_resource": "instance"
					}
				}
			}
		}
	}
}

获取应用重装状态

URL: 

http://CONTROLLER_IP:8774/v2.1/servers/INSTANCE_ID/action

method: post

Header:

Content-Type:application/json
Accept:application/json
X-Auth-Token:TOKEN



openstack 使用heat 创建stack

标签:openstack heat

原文地址:http://132408.blog.51cto.com/122408/1919146

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!