openstack nova 深入
一、概述:
由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 深入的更多相关文章
- OpenStack nova VM migration (live and cold) call flow
OpenStack nova compute supports two flavors of Virtual Machine (VM) migration: Cold migration -- mig ...
- 如何删除 OpenStack Nova 僵尸实例
转自:http://www.vpsee.com/2011/11/how-to-delete-a-openstack-nova-zombie-instance/ 前天强制重启一台 OpenStack N ...
- OpenStack Nova 制作 Windows 镜像
OpenStack Nova 制作 Windows 镜像 windows虚拟机ubuntuimage防火墙云计算 本贴转自http://www.vpsee.com 上次 VPSee 给 OpenS ...
- 深挖Openstack Nova - Scheduler调度策略
深挖Openstack Nova - Scheduler调度策略 一. Scheduler的作用就是在创建实例(instance)时,为实例选择出合适的主机(host).这个过程分两步:过滤(F ...
- OpenStack Nova
OpenStack Nova 简介 OpenStack 中的 Nova 负责维护和管理云环境的计算资源 Nova 在现有 Linux 服务器上作为一组守护线程来提供服务 Nova 由多个服务器进程组成 ...
- OpenStack Nova Release(Rocky to Train)
目录 文章目录 目录 前言 演进方向 Cellv2 更新 Rocky Support disabling a cell Stein Handling a down cell Train Count q ...
- OpenStack Nova 高性能虚拟机之 CPU 绑定
目录 文章目录 目录 前文列表 KVM KVM 的功能列表 KVM 工具集 KVM 虚拟机的本质是什么 vCPU 的调度与性能问题 Nova 支持的 vCPU 绑定 vcpu\_pin\_set 配置 ...
- OpenStack Nova 高性能虚拟机之 NUMA 架构亲和
目录 文章目录 目录 写在前面 计算平台体系结构 SMP 对称多处理结构 NUMA 非统一内存访问结构 MPP 大规模并行处理结构 Linux 上的 NUMA 基本对象概念 NUMA 调度策略 获取宿 ...
- Openstack Nova 源码分析 — 使用 VCDriver 创建 VMware Instance
目录 目录 前言 流程图 nova-compute vCenter 前言 在上一篇Openstack Nova 源码分析 - Create instances (nova-conductor阶段)中, ...
- Openstack Nova 源码分析 — Create instances (nova-conductor阶段)
目录 目录 前言 Instance Flavor Instance Status Virt Driver Resource Tracker nova-conductor Create Instance ...
随机推荐
- free的说明
http://www.cnblogs.com/peida/archive/2012/12/25/2831814.html
- 无脑抢标——算了吧
第一版时,我对拍拍贷是恐惧的,缓解我的恐惧的方法,就是寻找尽可能安全的方案.然后,我就发现了这个策略:超过信用等级普通利率的标的.A标一般16,B一般18--那我就寻找大于16的A,大于18的B,C我 ...
- How to Redirect in ASPNET Web API
You could set the Location header: public HttpResponseMessage Get() { var response = Request.Creat ...
- [Docker] Linking Node.js and MongoDB Containers
To do communcation between containers, we need to do link between containers. 1. Run a container wit ...
- 大量带BPM的跑步歌曲/跑步音乐下载
20150110停止更新告知:不知不觉本帖更新有近半年了.从最开始跑步已经四年多,一直是听着音乐跑的,音乐支持.陪伴.丰富着我的跑步之旅.直到上个月因一次觉得音乐吵,我开始有意地摘掉耳机去跑步,并开始 ...
- Oracle数据表中输入引号等特殊字符
Oracle输入特殊字符的特殊方法: UPDATE BOOKMARK SET BM_VALUE=q'/ --在这里写下需要输入的内容(可以包括引号.回车等特殊的符号),所见即所得 /' -- WHER ...
- android中实现拨号功能
1.要实现拨号功能,首先需要开启拨号权限 修改AndroidManifest.xml文件,添加如下内容: <uses-permission android:name="android. ...
- 微信小程序 - 沉浸式抽屉(非组件)
高度有限制,可作为管理界面,点击下载示例:drawer
- linux下jdk_tomcat+mysql配置那点事
(1)上传环境压缩包 apache-tomcat-7.0.47.tar.gz, jdk-7u71-linux-x64.gz, mysql-5.6.14.tar.gz通过xftp工具上传到/usr/lo ...
- Python 模块浅析
如果你退出Python解释器重新进入,以前创建的一切定义(变量和函数)就全部丢失了.因此,如果你想写一些长久保存的程序,最好使用一个文本编辑器来编写程序,把保存好的文件输入解释器. 我们称之为创建一个 ...