感谢朋友支持本博客,欢迎共同探讨交流,因为能力和时间有限,错误之处在所难免,欢迎指正!

假设转载,请保留作者信息。

博客地址: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的更多相关文章

  1. 《转》 Openstack Grizzly 指定 compute node 创建 instance

    声明:此文档仅仅做学习交流使用,请勿用作其它商业用途 作者:朝阳_tony 邮箱:linzhaolover@gmail.com 2013年6月4日9:37:44 星期二 转载请注明出处:http:// ...

  2. openstack nova 源码解析 — Nova API 执行过程从(novaclient到Action)

    目录 目录 Nova API Nova API 的执行过程 novaclient 将 Commands 转换为标准的HTTP请求 PasteDeploy 将 HTTP 请求路由到具体的 WSGI Ap ...

  3. [原][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 ...

  4. Openstack之Nova创建虚机流程分析

    前言        Openstack作为一个虚拟机管理平台,核心功能自然是虚拟机的生命周期的管理,而负责虚机管理的模块就是Nova. 本文就是openstack中Nova模块的分析,所以本文重点是以 ...

  5. Openstack组件部署 — Nova_Install and configure a compute node

    目录 目录 前文列表 Prerequisites 先决条件 Install and configure a compute node Install the packages Edit the etc ...

  6. OpenStack:安装Nova

    >安装Nova1. 安装# apt-get install nova-novncproxy novnc nova-api \  nova-ajax-console-proxy nova-cert ...

  7. OpenStack核心组件-nova计算服务

    1. nova介绍 Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova 来实现的. ...

  8. openstack核心组件--nova计算服务(3)

    一.nova介绍:       Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova ...

  9. OpenStack组件——Nova计算资源管理

    1.nova介绍 Nova 是 OpenStack 最核心的服务,负责维护和管理云环境的计算资源.OpenStack 作为 IaaS 的云操作系统,虚拟机生命周期管理也就是通过 Nova 来实现的. ...

随机推荐

  1. bzoj2553【beijing2011】禁忌

    题意:http://www.lydsy.com/JudgeOnline/problem.php?id=2553 sol  :puts("nan"); (逃~ ac自动机+矩阵快速幂 ...

  2. Codeforces Round #362 (Div. 2) B 模拟

    B. Barnicle time limit per test 1 second memory limit per test 256 megabytes input standard input ou ...

  3. TCP面试题之为什么会有TIME_WAIT状态

    1.确保有足够的时间让对方收到ACK包:(一来一去刚好是2MSL) 2.避免新旧连接混淆 MSL(最大报文段的生成时间)在RFC793中规定hi2分钟,实际应用是30秒,1分钟,2分钟等:

  4. 生成静态页面方法 .NET

    原文发布时间为:2009-09-30 -- 来源于本人的百度文章 [由搬家工具导入] 采用模板法:【例子中的两个页面以及生成的页面均在同一个目录,自己可以去改】 模板Template.htm: < ...

  5. powershell常用

    对于powershell,比较强大的shell,可以直接调用.net进行下载等等 get-command|where-object{$_.name -like 'write*'} get-wmiobj ...

  6. 【字符集及字符编码】UTF-8、UTF-16和UTF-32

    UTF-32 用 4 个字节存储每一个字符,以保证能把 UCS 完全表达出来.但实际上 UCS 的字符数量根本不需要用 32 位表示,UTF-32 极大地浪费了空间.另外,由于组合字符的存在,定长表示 ...

  7. linux安全机制学习【转】

    转自:http://blog.csdn.net/qq_20307987/article/details/51307820 曾经一度想学来着,今天看到一个链接,讲的很好,算是写一下加深印象吧 1 栈溢出 ...

  8. 编译程序加不加 -lpthread 的区别【转】

    转自:http://www.cnblogs.com/Swartz/articles/3939382.html 作者:Lokki 出处:http://www.cnblogs.com/Swartz/ 欢迎 ...

  9. 【Linux】可重入函数和线程安全的区别与联系【转】

    转自:http://blog.csdn.net/scenlyf/article/details/52074444 版权声明:本文为博主原创文章,未经博主允许不得转载. *****可重入函数 函数被不同 ...

  10. linux中的strip命令简介------给文件脱衣服【转】

    转自:http://blog.csdn.net/stpeace/article/details/47090255 版权声明:本文为博主原创文章,转载时请务必注明本文地址, 禁止用于任何商业用途, 否则 ...