前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >pci-api support

pci-api support

作者头像
后端云
发布2018-10-24 11:57:09
7220
发布2018-10-24 11:57:09
举报
文章被收录于专栏:后端云

1 Use case 1.1 List and show PCI devices on VMs 1.2 List and show PCI stats on hypervisors 1.3 List PCI devices on the nodes 1.4 Get PCI device detailed information

2 What the REST PCI API will look like

The PCI API should incloude 3 interfaces:

We should extend server API to add PCI assignment information. When you use the server API, the result contains the PCI device information. For example: Use case: List an show PCI devices on VMs Request:

代码语言:javascript
复制
GET v2/{tenant_id}/servers/{server_id}

Nova-client command :

代码语言:javascript
复制
nova list
nova show VM name 

The response JSON will contain the variable “os-pci:pci_devices”:

代码语言:javascript
复制
{ "server": {"os-pci:pci_devices": [{"id": 1}], "tenant_id": "openstack", "user_id": "fake"}}

you can see which PCI device was used by the server of interest to you. The value of “os-pci-devices” means this VM used one PCI device(id=1).

We also should extend hypervisor API to add PCI stats information. We use the hypervisor api can also get the PCI stats in the results. For example: Use case : List an show PCI stats on hypervisors Request:

代码语言:javascript
复制
GET v2/{tenant_id}/os-hypervisors/{hypervisor_hostname}

Nova-client command :

代码语言:javascript
复制
nova hypervisor-list
nova hypervisor-show id 

The response JOSN contains the variable “pci_stats”:

代码语言:javascript
复制
{"hypervisor": {"pci_stats": [{"count": 5, "vendor_id": "8086", "product_id": "1520", "extra_info": {"phys_function": "abc", "key1": "value1"}}}]}

We also need to add PCI APIs like to get PCI device information. Use case : List PCI devices on the nodes Request:

代码语言:javascript
复制
GET v2/{tenant_id}/os-pci

Nova-client command :

nova pci-list

The response JSON may like below :

代码语言:javascript
复制
{"pci_devices": [{ "address": "0000:04:10.0",  "compute_node_id": 1, "id": 1, "product_id": "1520",  "status": "available",  "vendor_id": "8086" } ]}

Request:

代码语言:javascript
复制
GET v2/{tenant_id}/os-pci/detail

The response JSON may like below :

代码语言:javascript
复制
{ "pci_devices": [ { "address": "0000:04:10.0", "compute_node_id": 1, "created_at": null, "deleted": false,  "deleted_at": null, "dev_id": "pci_0000_04_10_0",  "dev_type": "type-VF", "extra_info": { "key1": "value1", "key2": "value2", "phys_function": "0x004" }, "id": 1, "instance_uuid": "246ca", "label": "label_8086_1520", "product_id": "1520", "status": "available",  "updated_at": null, "vendor_id": "8086"}]}

Use case : Show PCI device infomation Request:

GET v2/{tenant_id}/os-pci/{pci_device_id} Nova-client command :

nova pci-show id The response JSON may like below :

代码语言:javascript
复制
{"pci_device": { "address": "0000:04:10.0","compute_node_id": 1, "created_at": null, "deleted": false, "deleted_at": null, "dev_id": "pci_0000_04_10_0", "dev_type": "type-VF", "extra_info": {"key1": "value1", "key2": "value2", "phys_function": "0x004"}, "id": 1, "instance_uuid": "246ca", "label": "label_8086_1520", "product_id": "1520",  "status": "available",  "updated_at": null, "vendor_id": "8086"}}

We intend to add the PCI APIs into V2 and V3. The patch may be big, so I want to split the patch into 3 parts in V2 and V3.

  • extend the sever API.
  • extend hypervisor API.
  • add PCI API.
本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2017-05-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 后端云 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档