0
我需要获取特定租户可用的服务器列表。Openstack - Nova客户端 - 为特定租户检索服务器
即考虑租户的tenant_id如下:
ee13ef5e10644f3782179bbfac1cdab5
现在我需要它仅适用于特定租户的服务器。
我试过的代码如下:
我无法得到结果。
它只是当我尝试相同时显示一个空列表。
from novaclient import client
import json
kwargs = {
"tenant_name":'admin',
"auth_url":'http://127.0.0.1:5000/v2.0',
"username":'admin',
"password":'password',
}
# Establish the connection Keystone
keystone = client.Client('2', 'admin', 'sop52maw', 'admin', 'http://127.0.0.1:5000/v2.0')
server_list = keystone.servers.list(search_opts={'tenant_id':'ee13ef5e10644f3782179bbfac1cdab5'})
print server_list
有人看看,并指导我排序这一个。