一、概述:

  由nova --debug list查看到:

#nova --debug list
DEBUG (session:195) REQ: curl -g -i -X GET http://192.168.39.172:5000/v2.0 -H "Accept: application/json" -H "User-Agent: python-keystoneclient"
INFO (connectionpool:203) Starting new HTTP connection (1): 192.168.39.172
DEBUG (connectionpool:383) "GET /v2.0 HTTP/1.1" 200 340
DEBUG (session:224) RESP: [200] content-length: 340 vary: X-Auth-Token connection: keep-alive date: Tue, 06 Jun 2017 08:18:26 GMT content-type: application/json x-openstack-request-id: req-7a31faa4-497d-46e2-a137-51255744bd01
RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://192.168.39.172:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}} DEBUG (v2:76) Making authentication request to http://192.168.39.172:5000/v2.0/tokens
DEBUG (connectionpool:383) "POST /v2.0/tokens HTTP/1.1" 200 3327
DEBUG (session:195) REQ: curl -g -i -X GET http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/detail -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}eaa78ad5bbad815caccc425100e97714d032eb71"

INFO (connectionpool:203) Starting new HTTP connection (1): 192.168.39.172
DEBUG (connectionpool:383) "GET /v2/b8a56795b6d749cd8434f841868ee6a4/servers/detail HTTP/1.1" 200 4848
DEBUG (session:224) RESP: [200] date: Tue, 06 Jun 2017 08:18:26 GMT connection: keep-alive content-type: application/json content-length: 4848 x-compute-request-id: req-0452bc14-9ae0-46ad-b857-4102a0a23d72
RESP BODY: {"servers": [{"status": "ACTIVE", "updated": "2017-06-05T03:31:36Z", "hostId": "4c820983066e6ff21f0753adca9b55e75797235c0fb8fa1141efab4d", "OS-EXT-SRV-ATTR:host": "TS-M2-Cloud173", "addresses": {"NW": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:d5:ed:11", "version": 4, "addr": "192.168.0.189", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/2e3dd89c-ad59-4499-a3ff-6444ca74f7c3", "rel": "self"}, {"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/servers/2e3dd89c-ad59-4499-a3ff-6444ca74f7c3", "rel": "bookmark"}], "key_name": null, "image": "", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-000000d1", "OS-SRV-USG:launched_at": "2017-05-25T07:12:27.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "TS-M2-Cloud173", "flavor": {"id": "c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "links": [{"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/flavors/c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "rel": "bookmark"}]}, "id": "2e3dd89c-ad59-4499-a3ff-6444ca74f7c3", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "ACTIVE", "user_id": "c2102ee1835440e39eea98cf264f118e", "name": "New", "created": "2017-05-25T07:11:56Z", "tenant_id": "b8a56795b6d749cd8434f841868ee6a4", "OS-DCF:diskConfig": "AUTO", "os-extended-volumes:volumes_attached": [{"id": "a79fe8d0-efe9-47be-a54e-033a1ad08f71"}], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}, {"status": "ACTIVE", "updated": "2017-05-25T07:12:57Z", "hostId": "fbd0e31d7dd6d0f516942bc9b19f6a1733e0108121008d884e44d5b9", "OS-EXT-SRV-ATTR:host": "TS-M2-Cloud177", "addresses": {"NW": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:12:a4:f0", "version": 4, "addr": "192.168.0.188", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/8e61920f-150a-43e9-addd-85e3108ea771", "rel": "self"}, {"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/servers/8e61920f-150a-43e9-addd-85e3108ea771", "rel": "bookmark"}], "key_name": null, "image": "", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-000000d0", "OS-SRV-USG:launched_at": "2017-05-25T07:12:56.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "TS-M2-Cloud177", "flavor": {"id": "c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "links": [{"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/flavors/c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "rel": "bookmark"}]}, "id": "8e61920f-150a-43e9-addd-85e3108ea771", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "ACTIVE", "user_id": "c2102ee1835440e39eea98cf264f118e", "name": "test-1", "created": "2017-05-25T07:11:55Z", "tenant_id": "b8a56795b6d749cd8434f841868ee6a4", "OS-DCF:diskConfig": "AUTO", "os-extended-volumes:volumes_attached": [{"id": "dfc6abad-49bd-40a9-a7a5-4c868eb9e211"}], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}, {"status": "ACTIVE", "updated": "2017-05-19T03:35:37Z", "hostId": "fbd0e31d7dd6d0f516942bc9b19f6a1733e0108121008d884e44d5b9", "OS-EXT-SRV-ATTR:host": "TS-M2-Cloud177", "addresses": {"Office": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:82:15:4e", "version": 4, "addr": "192.168.39.68", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/34f0b3a5-4142-4276-b27d-bac7c64f9f90", "rel": "self"}, {"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/servers/34f0b3a5-4142-4276-b27d-bac7c64f9f90", "rel": "bookmark"}], "key_name": null, "image": "", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-000000c8", "OS-SRV-USG:launched_at": "2017-05-19T03:35:37.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "TS-M2-Cloud177", "flavor": {"id": "665a38e6-6f80-4dc2-ad97-89ca335358e6", "links": [{"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/flavors/665a38e6-6f80-4dc2-ad97-89ca335358e6", "rel": "bookmark"}]}, "id": "34f0b3a5-4142-4276-b27d-bac7c64f9f90", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "ACTIVE", "user_id": "c2102ee1835440e39eea98cf264f118e", "name": "test01", "created": "2017-05-19T03:35:24Z", "tenant_id": "b8a56795b6d749cd8434f841868ee6a4", "OS-DCF:diskConfig": "AUTO", "os-extended-volumes:volumes_attached": [{"id": "48e6d225-c43e-41a3-8890-8a3d40b4a38e"}], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}]} +--------------------------------------+------------------+--------+------------+-------------+----------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------------------+--------+------------+-------------+----------------------+
| 2e3dd89c-ad59-4499-a3ff-6444ca74f7c3 | New | ACTIVE | - | Running | NW=192.168.0.189 |
| 34f0b3a5-4142-4276-b27d-bac7c64f9f90 | test01 | ACTIVE | - | Running | Office=192.168.39.68 |
| 8e61920f-150a-43e9-addd-85e3108ea771 | test-1 | ACTIVE | - | Running | NW=192.168.0.188 |
+--------------------------------------+------------------+--------+------------+-------------+----------------------+

  由第二个请求可知,获取请求结果实质是通过二个请求即可(ps:第一个请求为token)

curl -g -i -X GET http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/detail -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: 28db6fe8c2ac45db850b96189c939629"
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 4848
X-Compute-Request-Id: req-cff95650-9cf8-442f-8a2c-fdc90c21443b
Date: Tue, 06 Jun 2017 08:21:06 GMT {"servers": [{"status": "ACTIVE", "updated": "2017-06-05T03:31:36Z", "hostId": "4c820983066e6ff21f0753adca9b55e75797235c0fb8fa1141efab4d", "OS-EXT-SRV-ATTR:host": "TS-M2-Cloud173", "addresses": {"NW": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:d5:ed:11", "version": 4, "addr": "192.168.0.189", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/2e3dd89c-ad59-4499-a3ff-6444ca74f7c3", "rel": "self"}, {"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/servers/2e3dd89c-ad59-4499-a3ff-6444ca74f7c3", "rel": "bookmark"}], "key_name": null, "image": "", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-000000d1", "OS-SRV-USG:launched_at": "2017-05-25T07:12:27.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "TS-M2-Cloud173", "flavor": {"id": "c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "links": [{"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/flavors/c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "rel": "bookmark"}]}, "id": "2e3dd89c-ad59-4499-a3ff-6444ca74f7c3", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "ACTIVE", "user_id": "c2102ee1835440e39eea98cf264f118e", "name": "New", "created": "2017-05-25T07:11:56Z", "tenant_id": "b8a56795b6d749cd8434f841868ee6a4", "OS-DCF:diskConfig": "AUTO", "os-extended-volumes:volumes_attached": [{"id": "a79fe8d0-efe9-47be-a54e-033a1ad08f71"}], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}, {"status": "ACTIVE", "updated": "2017-05-25T07:12:57Z", "hostId": "fbd0e31d7dd6d0f516942bc9b19f6a1733e0108121008d884e44d5b9", "OS-EXT-SRV-ATTR:host": "TS-M2-Cloud177", "addresses": {"NW": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:12:a4:f0", "version": 4, "addr": "192.168.0.188", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/8e61920f-150a-43e9-addd-85e3108ea771", "rel": "self"}, {"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/servers/8e61920f-150a-43e9-addd-85e3108ea771", "rel": "bookmark"}], "key_name": null, "image": "", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-000000d0", "OS-SRV-USG:launched_at": "2017-05-25T07:12:56.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "TS-M2-Cloud177", "flavor": {"id": "c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "links": [{"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/flavors/c0540dff-eadd-44b2-a6d4-a4f74409b9c4", "rel": "bookmark"}]}, "id": "8e61920f-150a-43e9-addd-85e3108ea771", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "ACTIVE", "user_id": "c2102ee1835440e39eea98cf264f118e", "name": "test-1", "created": "2017-05-25T07:11:55Z", "tenant_id": "b8a56795b6d749cd8434f841868ee6a4", "OS-DCF:diskConfig": "AUTO", "os-extended-volumes:volumes_attached": [{"id": "dfc6abad-49bd-40a9-a7a5-4c868eb9e211"}], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}, {"status": "ACTIVE", "updated": "2017-05-19T03:35:37Z", "hostId": "fbd0e31d7dd6d0f516942bc9b19f6a1733e0108121008d884e44d5b9", "OS-EXT-SRV-ATTR:host": "TS-M2-Cloud177", "addresses": {"Office": [{"OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:82:15:4e", "version": 4, "addr": "192.168.39.68", "OS-EXT-IPS:type": "fixed"}]}, "links": [{"href": "http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/34f0b3a5-4142-4276-b27d-bac7c64f9f90", "rel": "self"}, {"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/servers/34f0b3a5-4142-4276-b27d-bac7c64f9f90", "rel": "bookmark"}], "key_name": null, "image": "", "OS-EXT-STS:task_state": null, "OS-EXT-STS:vm_state": "active", "OS-EXT-SRV-ATTR:instance_name": "instance-000000c8", "OS-SRV-USG:launched_at": "2017-05-19T03:35:37.000000", "OS-EXT-SRV-ATTR:hypervisor_hostname": "TS-M2-Cloud177", "flavor": {"id": "665a38e6-6f80-4dc2-ad97-89ca335358e6", "links": [{"href": "http://192.168.39.172:8774/b8a56795b6d749cd8434f841868ee6a4/flavors/665a38e6-6f80-4dc2-ad97-89ca335358e6", "rel": "bookmark"}]}, "id": "34f0b3a5-4142-4276-b27d-bac7c64f9f90", "security_groups": [{"name": "default"}], "OS-SRV-USG:terminated_at": null, "OS-EXT-AZ:availability_zone": "ACTIVE", "user_id": "c2102ee1835440e39eea98cf264f118e", "name": "chengpeng_test01", "created": "2017-05-19T03:35:24Z", "tenant_id": "b8a56795b6d749cd8434f841868ee6a4", "OS-DCF:diskConfig": "AUTO", "os-extended-volumes:volumes_attached": [{"id": "48e6d225-c43e-41a3-8890-8a3d40b4a38e"}], "accessIPv4": "", "accessIPv6": "", "progress": 0, "OS-EXT-STS:power_state": 1, "config_drive": "", "metadata": {}}]}

  分析该url:http://192.168.39.172:8774/v2/b8a56795b6d749cd8434f841868ee6a4/servers/detail; 如何转换为底层请求具体的方法呢?

  1、nova-api来接收请求;其底层配置配置为/etc/nova/api-paste.ini

  2、可知app_factory路径为:nova/api/openstack/compute包中,查看其__init__.py文件:

  由此路由函数即可进行转换;

openstack nova 深入的更多相关文章

  1. OpenStack nova VM migration (live and cold) call flow

    OpenStack nova compute supports two flavors of Virtual Machine (VM) migration: Cold migration -- mig ...

  2. 如何删除 OpenStack Nova 僵尸实例

    转自:http://www.vpsee.com/2011/11/how-to-delete-a-openstack-nova-zombie-instance/ 前天强制重启一台 OpenStack N ...

  3. OpenStack Nova 制作 Windows 镜像

    OpenStack Nova 制作 Windows 镜像   windows虚拟机ubuntuimage防火墙云计算 本贴转自http://www.vpsee.com 上次 VPSee 给 OpenS ...

  4. 深挖Openstack Nova - Scheduler调度策略

    深挖Openstack Nova - Scheduler调度策略   一.  Scheduler的作用就是在创建实例(instance)时,为实例选择出合适的主机(host).这个过程分两步:过滤(F ...

  5. OpenStack Nova

    OpenStack Nova 简介 OpenStack 中的 Nova 负责维护和管理云环境的计算资源 Nova 在现有 Linux 服务器上作为一组守护线程来提供服务 Nova 由多个服务器进程组成 ...

  6. OpenStack Nova Release(Rocky to Train)

    目录 文章目录 目录 前言 演进方向 Cellv2 更新 Rocky Support disabling a cell Stein Handling a down cell Train Count q ...

  7. OpenStack Nova 高性能虚拟机之 CPU 绑定

    目录 文章目录 目录 前文列表 KVM KVM 的功能列表 KVM 工具集 KVM 虚拟机的本质是什么 vCPU 的调度与性能问题 Nova 支持的 vCPU 绑定 vcpu\_pin\_set 配置 ...

  8. OpenStack Nova 高性能虚拟机之 NUMA 架构亲和

    目录 文章目录 目录 写在前面 计算平台体系结构 SMP 对称多处理结构 NUMA 非统一内存访问结构 MPP 大规模并行处理结构 Linux 上的 NUMA 基本对象概念 NUMA 调度策略 获取宿 ...

  9. Openstack Nova 源码分析 — 使用 VCDriver 创建 VMware Instance

    目录 目录 前言 流程图 nova-compute vCenter 前言 在上一篇Openstack Nova 源码分析 - Create instances (nova-conductor阶段)中, ...

  10. Openstack Nova 源码分析 — Create instances (nova-conductor阶段)

    目录 目录 前言 Instance Flavor Instance Status Virt Driver Resource Tracker nova-conductor Create Instance ...

随机推荐

  1. Web安全学习规划

    一名合格的Web安全工程师是要具备很多的知识点,不但要对网站架构熟悉,通讯协议,测试流程与测试工具使用,漏洞利用脚本编写,还有需要经验的积累等. 互联网进入下半场,竞争越发的激烈,能与人工智能比肩的热 ...

  2. hdu 5411 CRB and Puzzle (矩阵高速幂优化dp)

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=5411 题意:按题目转化的意思是,给定N和M,再给出一些边(u,v)表示u和v是连通的,问走0,1,2... ...

  3. Masonry自动布局使用

    Masonry是一个轻量级的布局框架,采用更好的语法封装自动布局,它有自己的布局DSL.简洁明了并具有高可读性 而且同时支持 iOS 和 Max OS X. 下载 NSLayoutConstraint ...

  4. 从网易云音乐网页版无登陆下载MP3的办法

    用chrome浏览器就能办到 现在,你还为下载不到满意的音乐而苦恼吗?

  5. ArcGIS鼠标滚轮方向之注册表篇

    ArcMap鼠标滚轮方向的设置是记录在注册表信息中,那么我们做一个简单的测试.先打开注册表,将ReverseMouseWheel删除,再打开ArcMap进行鼠标滚轮方向设置. 设置完成后,刷新注册表, ...

  6. Spring 开发环境搭建(二)

    为了方面,直接使用eclipse,创建maven工程,创建成功之后 一.修改pom.xml,为了方面我就把Spring相关的jar包都引用了 <project xmlns="http: ...

  7. MAC LINUX 安装PYQT(事例)

    MAC安装 1.安装命令:brew install pyqt Warning: Your Xcode () is outdated Please install Xcode 5.0. Warning: ...

  8. MongoDB副本集配置系列三:副本集的认证方式

    1:副本集配置参考这篇博客: http://www.cnblogs.com/xiaoit/p/4478951.html 2:副本集的认证 假设有两台机器已经配置好了副本集(副本集罪一般最少3台机器,这 ...

  9. CTRL+SHIFT

    CTRL+SHIFT+鼠标左右,上下拖动,可快速实现平行和垂直上下复制的功能,

  10. 如何在eclipse中创建.properties文件

    打开file--new--other 选择general--file--next 选择要建在哪个文件名下,然后在底部的file name后输入properities文件名,finish即可