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 来实现的. ...
随机推荐
- hashcode和equals方法
转自https://www.cnblogs.com/keyi/p/7119825.html 一.equals方法的作用 1.默认情况(没有覆盖equals方法)下equals方法都是调用Object类 ...
- Codeforces Round #363 (Div. 2) C dp或贪心 两种方法
Description Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasy ...
- 《插件》一个比较好用的 chrome浏览器的json格式化插件
插件名: JSON-Handle 下载地址: http://jsonhandle.sinaapp.com/ 插件下载后,在浏览器输入:chrome://extensions/ 将下 ...
- 【CF1068D】Array Without Local Maximums(计数DP)
题意: n<=1e5 思路:卡内存 dp[i][j][k]表示当前第i个数字为j,第i-1个数字与第i个之间大小关系为k的方案数(a[i-1]<a[i],=,>) 转移时使用前缀和和 ...
- 如何查看用pip命令安装的软件的安装路径
怎么查看python的pip install xx安装的软件的安装路径? pip freeze命令可以查看用pip安装的软件有哪些 要查看安装路径,在执行一次命令pip install xx,就会告诉 ...
- XmlRootElement
作用是 java对象 <---> xml文件 之间的转换 JAXB Annotation @XmlRootElement // xml 文件的根元素 @XmlElement @Xm ...
- 修复无法启动的mariadb
一直在用的数据库,今天无论如何启动不了了,最后在archlinux wiki上查到了解决方法: mysql_install_db --user=mysql --basedir=/usr --datad ...
- android的动态代码
1,Android代码设置Shape,corners,Gradient (http://blog.csdn.net/houshunwei/article/details/17392409) int ...
- 【转载】Word2010编号列表&多级列表
1.引用场景 对于一份标准.漂亮的word文档,编号列表和多级列表的设置时必不可少的,正因为有它们,文档看起来才更专业,使用起来才更加的方便.如下面截图一般,这是十分常见的多级列表设置 ...
- TP5 多条件whereOr查询
问题背景:最近在用ThinkPHP 5开发项目的过程中,发现根据筛选条件做or查询的时候,连贯操作不可以使用where进行条件查询了. 首先列出一个user数据表的信息: uid uname grad ...