易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 3960|回复: 0
收起左侧

stack脚本写法

[复制链接]
发表于 2017-11-10 15:15:52 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x

root@storage:~/heat# cat demo-template.yml

heat_template_version: 2015-10-15

description: Launch a basic instance with CirrOS image using the

             ``m1.tiny`` flavor, ``mykey`` key,  and one network.

parameters:

  NetID:

    type: string

    description: Network ID to use for the instance.

resources:

  server:

    type: OS::Nova::Server

    properties:

      image: { get_parm: Image_ID }

      flavor: zoom.medium

      key_name: key

      networks:

      - network: { get_param: Net_ID }

outputs:

  instance_name:

    description: Name of the instance.

    value: { get_attr: [ server, name ] }

  instance_ip:

    description: IP address of the instance.

    value: { get_attr: [ server, first_address ] }


$ C" Y+ W$ C6 o

创建Stack

root@storage:~/heat# vim create_stack.sh

IMAGE_ID=$(nova image-list | awk '/ Ubuntu16.04-server-clouding-powerpc64el / { print $2 }')

NET_ID=$(openstack network list | awk '/ private / { print $2 }')

heat stack-create Ubuntu-clouding.stack -f demo-template.yml \

-P Image_ID=$IMAGE_ID \

-P Net_ID=$NET_ID \

#openstack stack create -t demo-template.yml --parameter "NetID=$NET_ID" --parameter "Net_ID=$IMAGE_ID" stack


" V2 ]# D% B6 Y! r
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )点击这里给我发消息

GMT+8, 2026-4-9 01:06 , Processed in 0.047054 second(s), 23 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表