日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

openstack 用nova API 指定 compute node 创建 instance

發布時間:2025/3/20 编程问答 35 豆豆
生活随笔 收集整理的這篇文章主要介紹了 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了!


轉載于:https://www.cnblogs.com/yutingliuyl/p/6773532.html

總結

以上是生活随笔為你收集整理的openstack 用nova API 指定 compute node 创建 instance的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。