Ask Your Question
2

what is the hostId parameter in server details? [closed]

asked 2013-10-30 04:59:20 -0500

tzafrir gravatar image

Hi,

How can I match a hypervisor (IDs are integers: 1,2,3...) to a server? I can get the hypervisor name from the server details, but i'd like to get the ID of the hypervisor (host).

I know I can do the opposite - get the servers of each hypervisor, but I wonder what the hostId is referencing.

server details:

{"server": {"status": "ACTIVE", "updated": "2013-10-29T12:32:20Z",

"hostId": "380a3cb5901763eaca27cc2c93713d93b79c8fed0e8d926e25cfd64a", ...

hypervisor details:

{ "hypervisor":{ "id":1, ...

Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by koolhead17
close date 2014-07-15 02:20:43.767189

Comments

Hi, I am stuck in the same question but I would like to add a comment, I found that the hostId can be a hash of tenant id and/or project id and/or some unique host identifier but I don't know yet how it really is calculated.Here is a https://lists.launchpad.net/openstack/msg03231.html (link) to the discussion list. I would like to know if you found a answer for this question. Thanks.

BrunoGraz gravatar imageBrunoGraz ( 2014-06-18 04:22:15 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2014-07-11 09:20:15 -0500

BrunoGraz gravatar image

This is how hostId is generated, a hash between the project id and the hypervisor name.

import hashlib
sha_hash = hashlib.sha224(projectid + hypervisorname)  
print sha_hash.hexdigest()
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

2 followers

Stats

Asked: 2013-10-30 04:59:20 -0500

Seen: 3,258 times

Last updated: Jul 11 '14