openstack 用nova API 指定 compute node 创建 instance
感谢朋友支持本博客,欢迎共同探讨交流,因为能力和时间有限,错误之处在所难免,欢迎指正!
假设转载,请保留作者信息。
博客地址:http://blog.csdn.net/qq_21398167
原博文地址:http://blog.csdn.net/qq_21398167/article/details/46924597
我们在博客中能够知道 能用命令行定向创建虚拟机到指定计算节点
http://blog.csdn.net/qq_21398167/article/details/46710175
nova boot --image fedora --flavor 1 test1 --availability-zone nova:node-1
为此我想看看是否能通过API 创建这种instance
通过查看 官网中的开源API 能够看到
http://blog.csdn.net/qq_21398167/article/details/46530305
中有这样一个API:
- create(name,image,flavor,meta=None,
files=None, reservation_id=None,min_count=None,max_count=None,security_groups=None,
userdata=None, key_name=None, availability_zone=None,
block_device_mapping=None,block_device_mapping_v2=None,nics=None,scheduler_hints=None,config_drive=None,
disk_config=None,**kwargs) -
Create (boot) a new server.
Parameters: - name – Something to name the server.
- image – The Image to boot with.
- flavor – The Flavor to boot onto.
- meta – A dict of arbitrary key/value metadata to store for thisserver. Both keys and values must be <=255 characters.
- files – A dict of files to overrwrite on the server upon boot.Keys are file names (i.e./etc/passwd) and valuesare the file contents (either as a string or as afile-like object).
A maximum of five entries is allowed,and each file must be 10k or less. - reservation_id – a UUID for the set of servers being requested.
- min_count – (optional extension) The minimum number ofservers to launch.
- max_count – (optional extension) The maximum number ofservers to launch.
- security_groups – A list of security group names
- userdata – user data to pass to be exposed by the metadataserver this can be a file type object as well or astring.
- key_name – (optional extension) name of previously createdkeypair to inject into the instance.
- availability_zone – Name of the availability zone for instanceplacement.
- block_device_mapping – (optional extension) A dict of blockdevice mappings for this server.
- block_device_mapping_v2 – (optional extension) A dict of blockdevice mappings for this server.
- nics – (optional extension) an ordered list of nics to beadded to this server, with information aboutconnected networks, fixed IPs, port etc.
- scheduler_hints – (optional extension) arbitrary key-value pairsspecified by the client to help boot an instance
- config_drive – (optional extension) value for config driveeither boolean, or volume-id
- disk_config – (optional extension) control how the disk ispartitioned when the server is created. possiblevalues are ‘AUTO’ or ‘MANUAL’.
这个API 中有同样參数 --availability-zone
所以直接在使用这个API 的时候将默认參数 None 替换成你想定向的那个计算节点名就Ok了!
openstack 用nova API 指定 compute node 创建 instance的更多相关文章
- 《转》 Openstack Grizzly 指定 compute node 创建 instance
声明:此文档仅仅做学习交流使用,请勿用作其它商业用途 作者:朝阳_tony 邮箱:linzhaolover@gmail.com 2013年6月4日9:37:44 星期二 转载请注明出处:http:// ...
- openstack nova 源码解析 — Nova API 执行过程从(novaclient到Action)
目录 目录 Nova API Nova API 的执行过程 novaclient 将 Commands 转换为标准的HTTP请求 PasteDeploy 将 HTTP 请求路由到具体的 WSGI Ap ...
- [原][openstack-pike][compute node][issue-1]openstack-nova-compute.service holdoff time over, scheduling restart.
在安装pike compute node节点的时候遇到启动nova-compute失败,问题如下(注意红色字体): [root@compute1 nova]# systemctl start ope ...
- Openstack之Nova创建虚机流程分析
前言 Openstack作为一个虚拟机管理平台,核心功能自然是虚拟机的生命周期的管理,而负责虚机管理的模块就是Nova. 本文就是openstack中Nova模块的分析,所以本文重点是以 ...
- Openstack组件部署 — Nova_Install and configure a compute node
目录 目录 前文列表 Prerequisites 先决条件 Install and configure a compute node Install the packages Edit the etc ...
- OpenStack:安装Nova
>安装Nova1. 安装# apt-get install nova-novncproxy novnc nova-api \ nova-ajax-console-proxy nova-cert ...
- OpenStack核心组件-nova计算服务
1. nova介绍 Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova 来实现的. ...
- openstack核心组件--nova计算服务(3)
一.nova介绍: Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova ...
- OpenStack组件——Nova计算资源管理
1.nova介绍 Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova 来实现的. ...
随机推荐
- vue经验总结
1. vue中获取dom节点时机 vue组件中获取dom节点一定要在mounted周期之后的下一次事件循环,包括 component.$refs,component.$el,component.$ch ...
- Activity启动创建 (AcitivtyManageService,ActivityThread,Activity)
ActivityThead,ActivityManagerService,Activity <<Android内核剖析>>中有一章节专门介绍 Activity框架和管理结构A ...
- docker 集群 kubernetes 1.8 构建
1.环境说明:操作系统:CentOS7Kubernetes 版本:v1.8.3Docker 版本:v17.06-ce master 192.168.10.220 etcd kube-apiser ...
- java读取文件的基本操作
import java.io.FileInputStream; /** * 使用FileInputStream读取文件 */ public class FileRead { /** * @param ...
- 字符串(bzoj 1856)
Description lxhgww最近接到了一个生成字符串的任务,任务需要他把n个1和m个0组成字符串,但是任务还要求在组成的字符串中,在任意的前k个字符中,1的个数不能少于0的个数.现在lxhgw ...
- PNG图片透明 IE6 解决方法
原文发布时间为:2009-11-18 -- 来源于本人的百度文章 [由搬家工具导入] png透明解决办法 第1 种方法:定义一个样式,给某个div应用这个样式后,div的透明png背景图片自动透明了。 ...
- spring一些总结
Spring中三种实例化bean的方法: 1)使用类构造器 <bean id="orderService" class="cn.itcast.OrderServ ...
- 【eclipse】导入/导出开发环境(包括编辑器字体颜色大小等)
Eclipse的 File -> Export(导出),在窗口中展开 General(常规) -> Perferences(首选项)-->Export all(全部导出)然后点击 N ...
- VIM的修炼等级
用vim 快两年了 看过教程也不少,总的来说还是得自己多练习,当自己觉得有需要的时候,再添加功能.这里分享个看过的最好的教程,出自贴吧的某个朋友,写的很好 零 学会盲打 壹 配置文件先从最简开始,在 ...
- iptables之centos6版本详解
1 Linux防火墙概述 Linux防火墙实际指的是Linux下的Netfilter/Iptables.Netfilter/Iptables是2.4.x/2.6.x版本Linux内核集成的IP信息包过 ...