heat launch an instance
在包含Orchestration服务的环境中,可以创建启动实例的堆栈
创建yam文件
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: cirros_test
flavor: m1.tiny
key_name: demo
networks:
- network: { get_param: NetID } 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 ] }
[root@armstrong ~]# source keystone_demo
注意,yam文件里的image,flavor,key_name可以利用openstack CLI获取
[root@armstrong ~(keystone_demo)]# openstack flavor list
+----+-----------+-------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-----------+-------+------+-----------+-------+-----------+
| | m1.tiny | | | | | True |
| | m1.small | | | | | True |
| | m1.medium | | | | | True |
| | m1.large | | | | | True |
| | m1.xlarge | | | | | True |
+----+-----------+-------+------+-----------+-------+-----------+
[root@armstrong ~(keystone_demo)]# openstack image list
+--------------------------------------+----------------+--------+
| ID | Name | Status |
+--------------------------------------+----------------+--------+
| 9d3a6eba-2e28-422c-950a-d62240a14257 | cirros_test | active |
| 9fee7ec6-6cce-4df0--c9d94153fb98 | test_armstrong | active |
+--------------------------------------+----------------+--------+
[root@armstrong ~(keystone_demo)]# openstack keypair create demo
[root@armstrong ~(keystone_demo)]# openstack keypair list
+------+-------------------------------------------------+
| Name | Fingerprint |
+------+-------------------------------------------------+
| demo | f6::ea:aa:8a:f9:bc::a0::::e1:f7::fa |
+------+-------------------------------------------------+
[root@armstrong ~(keystone_demo)]# export NET_ID=$(openstack network list | awk '/ private / { print $2 }')
[root@armstrong ~(keystone_demo)]# openstack stack create -t demo-template.yml --parameter "NetID=$NET_ID" stack
+---------------------+----------------------------------------------------------------------------------------------------------+
| Field | Value |
+---------------------+----------------------------------------------------------------------------------------------------------+
| id | a98a9958-088d---f7698884ce40 |
| stack_name | stack |
| description | Launch a basic instance with CirrOS image using the ``m1.tiny`` flavor, ``mykey`` key, and one network. |
| creation_time | --13T07::37Z |
| updated_time | None |
| stack_status | CREATE_IN_PROGRESS |
| stack_status_reason | Stack CREATE started |
+---------------------+----------------------------------------------------------------------------------------------------------+
[root@armstrong ~(keystone_demo)]# openstack stack list
+--------------------------------------+------------+--------------------+----------------------+--------------+
| ID | Stack Name | Stack Status | Creation Time | Updated Time |
+--------------------------------------+------------+--------------------+----------------------+--------------+
| a98a9958-088d---f7698884ce40 | stack | CREATE_IN_PROGRESS | --13T07::37Z | None |
+--------------------------------------+------------+--------------------+----------------------+--------------+
虚机启动后会变为COMPLETE
[root@armstrong ~(keystone_demo)]# openstack stack list
+--------------------------------------+------------+-----------------+----------------------+--------------+
| ID | Stack Name | Stack Status | Creation Time | Updated Time |
+--------------------------------------+------------+-----------------+----------------------+--------------+
| a98a9958-088d---f7698884ce40 | stack | CREATE_COMPLETE | --13T07::37Z | None |
+--------------------------------------+------------+-----------------+----------------------+--------------+ [root@armstrong ~(keystone_demo)]# openstack stack show stack
+-----------------------+---------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+---------------------------------------------------------------------------------------------------------------------------+
| id | a98a9958-088d---f7698884ce40 |
| stack_name | stack |
| description | Launch a basic instance with CirrOS image using the ``m1.tiny`` flavor, ``mykey`` key, and one network. |
| creation_time | --13T07::37Z |
| updated_time | None |
| stack_status | CREATE_COMPLETE |
| stack_status_reason | Stack CREATE completed successfully |
| parameters | NetID: c53a005b-03af--b92e-2fd2acedcd1d |
| | OS::project_id: 5a55ee4fa9474c31a372e3dc8a951cf6 |
| | OS::stack_id: a98a9958-088d---f7698884ce40 |
| | OS::stack_name: stack |
| | |
| outputs | - description: Name of the instance. |
| | output_key: instance_name |
| | output_value: stack-server-m4qegurg52pm |
| | - description: IP address of the instance. |
| | output_key: instance_ip |
| | output_value: 10.0.0.8 |
| | |
| links | - href: http://192.168.122.209:8004/v1/5a55ee4fa9474c31a372e3dc8a951cf6/stacks/stack/a98a9958-088d-4882-8102-f7698884ce40 |
| | rel: self |
| | |
| parent | None |
| disable_rollback | True |
| deletion_time | None |
| stack_user_project_id | 932859b5db654e1bae13956d90b45a63 |
| capabilities | [] |
| notification_topics | [] |
| stack_owner | None |
| timeout_mins | None |
| tags | None |
+-----------------------+---------------------------------------------------------------------------------------------------------------------------+ 显示实例的名称和IP地址,并与OpenStack客户端的输出进行比较
[root@armstrong ~(keystone_demo)]# openstack stack output show --all stack
+---------------+-------------------------------------------------+
| Field | Value |
+---------------+-------------------------------------------------+
| instance_name | { |
| | "output_value": "stack-server-m4qegurg52pm", |
| | "output_key": "instance_name", |
| | "description": "Name of the instance." |
| | } |
| instance_ip | { |
| | "output_value": "10.0.0.8", |
| | "output_key": "instance_ip", |
| | "description": "IP address of the instance." |
| | } |
+---------------+-------------------------------------------------+ [root@armstrong ~(keystone_demo)]# openstack server list
+--------------------------------------+---------------------------+--------+------------------+-------------+---------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+---------------------------+--------+------------------+-------------+---------+
| f6879d35-7c12-4ddf-bb4a-c51f501a7328 | stack-server-m4qegurg52pm | ACTIVE | private=10.0.0.8 | cirros_test | m1.tiny |
+--------------------------------------+---------------------------+--------+------------------+-------------+---------+
heat launch an instance的更多相关文章
- 14. Launch an instance
Controller Node: 1. source demo-openrc.sh 2. ssh-keygen 3. nova keypair-add --pub-key ~/.ssh/id_rsa. ...
- Launch an instance from a volume
从image boot,并且attach一个no-bootable volume: $ nova boot --flavor --image -af91-43d8-b5e6-a4506aa8f369 ...
- 将 instance 部署到 OVS Local Network - 每天5分钟玩转 OpenStack(130)
上一节创建了 OVS 本地网络 first_local_net,今天我们会部署一个 instance 到该网络并分析网络结构.launch 一个 instance,选择 first_local_net ...
- 将 instance 连接到 first_local_net - 每天5分钟玩转 OpenStack(82)
上一节 first_local_net 已经就绪,下面创建 instance 并将其连接到该网络. 将 instance 连接到 first_local_net launch 一个 instance, ...
- openstack-lanch an instance and nova compute log analysis
1. how to launch an instance: [root@localhost ~(keystone_admin)]# nova flavor-list+----+-----------+ ...
- 照着官网来安装openstack pike之创建并启动instance
有了之前组件(keystone.glance.nova.neutron)的安装后,那么就可以在命令行创建并启动instance了 照着官网来安装openstack pike之environment设置 ...
- Launch Instance---source for openstack
If you want to create an instance that uses ephemeral storage, meaning the instance data is lost whe ...
- multiple users to one ec2 instance setup
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/managing-users.html usually when use pem file as ...
- OpenStack 初探(一) -- All-In-One模式部署(初学OpenStack必备)
OpenStack 初探(一) -- All-In-One模式部署(初学OpenStack必备) 一.操作前需了解: 1. OpenStack提供IaaS(基础设施即服务)服务,它是开源的云计 ...
随机推荐
- CentOS 6下PXE+Kickstart无人值守安装操作系统
一.简介1.1 什么是PXEPXE(Pre-boot Execution Environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作 ...
- Spring boot 集成Spring Security
依赖jar <dependency> <groupId>org.springframework.cloud</groupId> <artifactId> ...
- Design and Implementation of Global Path Planning System for Unmanned Surface Vehicle among Multiple Task Points
Design and Implementation of Global Path Planning System for Unmanned Surface Vehicle among Multiple ...
- Spring 学习之bean的理解
前言:对于使用Spring框架的开发人员来说,我们主要做的主要有两件事情:①开发Bean;②配置Bean;而Spring帮我们做的就是根据配置文件来创建Bean实例,并调用Bean实例的方法来完成“依 ...
- Oracle字符集的查看查询和Oracle字符集的设置修改(转载)
本文主要讨论以下几个部分:如何查看查询oracle字符集. 修改设置字符集以及常见的Oracle UTF8字符集和Oracle exp 字符集问题. 一.什么是Oracle字符集 Oracle字符集是 ...
- spring-bean(xml方式DI)
三种属性注入方式 构造函数注入 1.在Bean实体中写入构造函数(带参构造) 2. <bean id=”该bean的名称” class=”注入的bean的全路径”> <constru ...
- RabbitMQ安装---rpm安装
首先介绍一下个人的安装环境是Linux-centos7: 一.安装和配置rabbitmq的准备工作: 下载erlang: wget http://www.rabbitmq.com/release ...
- 一个优秀的SSH远程终端工具
SSH远程终端工具是一款在Windows界面下用来访问远端不同系统下的服务器,从而比较好的达到远程控制终端的目的.向我们操控集群的时候,如果每台机器都安装一个显示器和键盘也是一个不小的花费,而远程终端 ...
- node服务端渲染(完整demo)
简介 nodejs搭建多页面服务端渲染 技术点 koa 搭建服务 koa-router 创建页面路由 nunjucks 模板引擎组合html webpack打包多页面 node端异步请求 服务端日志打 ...
- 我的Hibernate学习
以下博客均为引用, 侵删 Hibernate初级 HQL和SQL的区别 https://blog.csdn.net/aaa1117a8w5s6d/article/details/7757097 ...