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

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

博客地址: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. [寒假集训第一场]gym101606 2017 United Kingdom and Ireland Programming Contest (UKIEPC 2017)

    3星场 难度在于英文题面太难读懂了QAQ 看样例猜题意的我 博客园的c++主题真丑 A Alien Sunset \(description\) 有\(n\)个星球,每个星球自转时间不一样,所以一天的 ...

  2. wsl折腾记

    参考1 wsl在哪 C:\Users\用户名\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndg ...

  3. Python与其他语言时间戳

    时间戳是自 1970 年 1 月 1 日(00:00:00 GMT)以来的秒数.它也被称为 Unix 时间戳(Unix Timestamp). Unix时间戳(Unix timestamp),或称Un ...

  4. jQuery 拖动排序

    原文发布时间为:2010-04-11 -- 来源于本人的百度文章 [由搬家工具导入] <!DOCTYPE html><html lang="en">< ...

  5. 【电脑使用经验】怎么查看无线网络中电脑的IP地址?

    1. 2. 3. 4. 5.

  6. Syslinux使用

    1. 介绍 Syslinux是一个功能强大的引导加载程序, 可以装在U盘上来引导系统 在5.00版本以前,几乎所有c32模块是独立的,即没有其他模块依赖:但在5.00以后,很多c32模块则是依赖于其他 ...

  7. TCP/IP和HTTP协议与Socket的区别联系

    参考资料: http://www.cnblogs.com/goodcandle/archive/2005/12/10/socket.html http://www.2cto.com/net/20121 ...

  8. hdu 5059(模拟)

    Help him Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  9. 前端js、jQuery实现日期格式化、字符串格式化

    1. js仿后台的字符串的StringFormat方法 在做前端页面时候,经常会对字符串进行拼接处理,但是直接使用字符串拼接,不但影响阅读,而且影响执行效率,且jQuery有没有定义字符串的Strin ...

  10. 调用Thread.interrupt()方法到底会发生什么?

    1. 当线程处于Blocked状态(sleep,wait,join),线程会退出阻塞状态,并抛出一个InterruptedException.park除外,它有响应但是不会抛出异常 2. 当线程处于R ...