【发布时间】:2016-05-04 02:52:06
【问题描述】:
我需要获取特定租户可用的服务器列表。
假设租户的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
有人看看,指导我解决这个问题。
【问题讨论】:
标签: python openstack openstack-nova