openstack
  • Introduction
  • 安装教程
    • config
      • mariadb
        • openstack.cnf
      • rabbitmq
      • memcached
        • memcached
      • httpd
        • httpd.conf
      • keystone
        • keystone.conf
        • wsgi-keystone.conf
      • glance
        • glance-api.conf
        • glance-registry.conf
      • nova
        • 00-nova-placement-api.conf
        • nova.conf.controller
        • nova.conf.compute
      • neutron
        • neutron.conf.controller
        • neutron.conf.compute
        • ml2_conf.ini
        • linuxbridge_agent.ini.controller
        • linuxbridge_agent.ini.compute
        • l3_agent.ini
        • dhcp_agent.ini
        • metadata_agent.ini
      • cinder
        • cinder.conf.controller
        • cinder.conf.volume
      • horizon
        • local_settings
        • openstack-dashboard.conf
    • shell
      • common.sh
      • controller.sh
      • nova-compute.sh
      • cinder-volume.sh
    • admin-openrc
  • Keystone
  • API
    • Nova
      • 创建实例
  • spice证书管理
    • 硬重启
      • 代码追踪
    • 操作手册
Powered by GitBook
On this page
  • API
  • Header参数
  • Body参数
  • Reference

Was this helpful?

  1. API
  2. Nova

创建实例

API

POST /servers

Header参数

"X-Auth-Token" : <token>

Body参数

{
    "server" : {
        "name" : "postman-server",
        "imageRef" : "09a155a7-0c3d-4756-9dbc-55f8b18dfbc8",
        "flavorRef" : "eeca58d6-d4c2-45f2-a664-617726ca249b",
        "networks" : [
            {
                "uuid" : "1d0f4c48-cfa0-4f1a-8572-e2092cb9fcd5"
            }
        ]
    }
}

上述body参数中

  • name:是用户自定义

  • imageRef:镜像的id,可以用openstack image list获取

$ openstack image list
+--------------------------------------+--------+--------+
| ID                                   | Name   | Status |
+--------------------------------------+--------+--------+
| 09a155a7-0c3d-4756-9dbc-55f8b18dfbc8 | cirros | active |
+--------------------------------------+--------+--------+
  • flavorRef:模板的id,可以用openstack flavor list获取

$ openstack flavor list
+--------------------------------------+----------+------+------+-----------+-------+-----------+
| ID                                   | Name     |  RAM | Disk | Ephemeral | VCPUs | Is Public |
+--------------------------------------+----------+------+------+-----------+-------+-----------+
| eeca58d6-d4c2-45f2-a664-617726ca249b | 1c-1g-1g | 1024 |    1 |         0 |     1 | True      |
+--------------------------------------+----------+------+------+-----------+-------+-----------+
  • networks.uuid:网络的id,可以用openstack network list获取

$ openstack network list
+--------------------------------------+------+--------------------------------------+
| ID                                   | Name | Subnets                              |
+--------------------------------------+------+--------------------------------------+
| 1d0f4c48-cfa0-4f1a-8572-e2092cb9fcd5 | net1 | fef6693a-705c-4a87-ac38-f878a5489ffc |
+--------------------------------------+------+--------------------------------------+

Reference

PreviousNovaNextspice证书管理

Last updated 5 years ago

Was this helpful?

https://www.sdnlab.com/20506.html
https://developer.openstack.org/api-ref/compute/?expanded=create-server-detail