找回密码
 注册
查看: 3965|回复: 0

stack脚本写法

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2017-11-10 15:15:52 | 显示全部楼层 |阅读模式

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 ] }

" t( N, [- O/ U2 N! Y) C# U5 V

创建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


0 G7 h0 d. j/ ?7 s
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 04:26 , Processed in 0.018402 second(s), 22 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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